org.gcube.indexmanagement.featureindexlibrary.vafile
Class VAFile

java.lang.Object
  extended by org.gcube.indexmanagement.featureindexlibrary.vafile.VAFile
All Implemented Interfaces:
FeatureIndex

public class VAFile
extends Object
implements FeatureIndex

The VAFile index

Author:
UoA

Constructor Summary
VAFile(VAFileParams params)
          Creates a new instance
 
Method Summary
 void addFeatureVector(FeatureVectorElement elem)
          Adds a new element
 void addFeatureVector(FeatureVectorElement[] elem)
          Adds new elements
 void commit()
          Commits additions
 String getIndexID()
          Returns the index id of the index instance
 long getNumberOfElements()
          Retrieves the number of elements in the index
 ArrayList<RankedResultElement> lookup(float[] vector, int k)
          Performs a lookup with default parameter values
 ArrayList<RankedResultElement> lookup(float[] vector, int k, LookupParams lp)
          Performs a lookup with default parameter values
 void removeEntry(String id)
          Removes the record from the index
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VAFile

public VAFile(VAFileParams params)
       throws Exception
Creates a new instance

Parameters:
params - The index creation parameters
Throws:
Exception - An error
Method Detail

addFeatureVector

public void addFeatureVector(FeatureVectorElement elem)
                      throws Exception
Description copied from interface: FeatureIndex
Adds a new element

Specified by:
addFeatureVector in interface FeatureIndex
Parameters:
elem - The element to add
Throws:
Exception - an error
See Also:
FeatureIndex.addFeatureVector(org.gcube.indexmanagement.featureindexlibrary.commons.FeatureVectorElement)

addFeatureVector

public void addFeatureVector(FeatureVectorElement[] elem)
                      throws Exception
Description copied from interface: FeatureIndex
Adds new elements

Specified by:
addFeatureVector in interface FeatureIndex
Parameters:
elem - the elements to add
Throws:
Exception - an error
See Also:
FeatureIndex.addFeatureVector(org.gcube.indexmanagement.featureindexlibrary.commons.FeatureVectorElement[])

commit

public void commit()
            throws Exception
Description copied from interface: FeatureIndex
Commits additions

Specified by:
commit in interface FeatureIndex
Throws:
Exception - an error
See Also:
FeatureIndex.commit()

getNumberOfElements

public long getNumberOfElements()
                         throws Exception
Description copied from interface: FeatureIndex
Retrieves the number of elements in the index

Specified by:
getNumberOfElements in interface FeatureIndex
Returns:
the number of elements
Throws:
Exception - an error
See Also:
FeatureIndex.getNumberOfElements()

lookup

public ArrayList<RankedResultElement> lookup(float[] vector,
                                             int k)
                                      throws Exception
Description copied from interface: FeatureIndex
Performs a lookup with default parameter values

Specified by:
lookup in interface FeatureIndex
Parameters:
vector - the vectror to search for
k - the number of results
Returns:
the results
Throws:
Exception - an error
See Also:
FeatureIndex.lookup(float[], int)

lookup

public ArrayList<RankedResultElement> lookup(float[] vector,
                                             int k,
                                             LookupParams lp)
                                      throws Exception
Description copied from interface: FeatureIndex
Performs a lookup with default parameter values

Specified by:
lookup in interface FeatureIndex
Parameters:
vector - the vectror to search for
k - the number of results
lp - lookup parameters
Returns:
the results
Throws:
Exception - an error
See Also:
FeatureIndex.lookup(float[], int, org.gcube.indexmanagement.featureindexlibrary.commons.LookupParams)

removeEntry

public void removeEntry(String id)
                 throws Exception
Description copied from interface: FeatureIndex
Removes the record from the index

Specified by:
removeEntry in interface FeatureIndex
Parameters:
id - the id to remove
Throws:
Exception - an error
See Also:
FeatureIndex.removeEntry(java.lang.String)

getIndexID

public String getIndexID()
                  throws Exception
Returns the index id of the index instance

Specified by:
getIndexID in interface FeatureIndex
Returns:
The index ID
Throws:
Exception - An unrecoverable for the operation error occured
See Also:
FeatureIndex.getIndexID()


Copyright © 2012. All Rights Reserved.