public class VAFile extends Object implements FeatureIndex
| Constructor and Description |
|---|
VAFile(VAFileParams params)
Creates a new instance
|
| Modifier and Type | Method and Description |
|---|---|
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
|
public VAFile(VAFileParams params) throws Exception
params - The index creation parametersException - An errorpublic void addFeatureVector(FeatureVectorElement elem) throws Exception
FeatureIndexaddFeatureVector in interface FeatureIndexelem - The element to addException - an errorFeatureIndex.addFeatureVector(org.gcube.indexmanagement.featureindexlibrary.commons.FeatureVectorElement)public void addFeatureVector(FeatureVectorElement[] elem) throws Exception
FeatureIndexaddFeatureVector in interface FeatureIndexelem - the elements to addException - an errorFeatureIndex.addFeatureVector(org.gcube.indexmanagement.featureindexlibrary.commons.FeatureVectorElement[])public void commit()
throws Exception
FeatureIndexcommit in interface FeatureIndexException - an errorFeatureIndex.commit()public long getNumberOfElements()
throws Exception
FeatureIndexgetNumberOfElements in interface FeatureIndexException - an errorFeatureIndex.getNumberOfElements()public ArrayList<RankedResultElement> lookup(float[] vector, int k) throws Exception
FeatureIndexlookup in interface FeatureIndexvector - the vectror to search fork - the number of resultsException - an errorFeatureIndex.lookup(float[], int)public ArrayList<RankedResultElement> lookup(float[] vector, int k, LookupParams lp) throws Exception
FeatureIndexlookup in interface FeatureIndexvector - the vectror to search fork - the number of resultslp - lookup parametersException - an errorFeatureIndex.lookup(float[], int, org.gcube.indexmanagement.featureindexlibrary.commons.LookupParams)public void removeEntry(String id) throws Exception
FeatureIndexremoveEntry in interface FeatureIndexid - the id to removeException - an errorFeatureIndex.removeEntry(java.lang.String)public String getIndexID() throws Exception
getIndexID in interface FeatureIndexException - An unrecoverable for the operation error occuredFeatureIndex.getIndexID()Copyright © 2014. All Rights Reserved.