org.gcube.indexmanagement.featureindexlibrary.commons
Interface FeatureIndex

All Known Implementing Classes:
FullVectorScan, VAFile

public interface FeatureIndex

Feature index interface

Author:
UoA

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 params)
          Performs a lookup with default parameter values
 void removeEntry(String id)
          Removes the record from the index
 

Method Detail

addFeatureVector

void addFeatureVector(FeatureVectorElement elem)
                      throws Exception
Adds a new element

Parameters:
elem - The element
Throws:
Exception - An unrecoverable for the operation error occured

addFeatureVector

void addFeatureVector(FeatureVectorElement[] elem)
                      throws Exception
Adds new elements

Parameters:
elem - The elements
Throws:
Exception - An unrecoverable for the operation error occured

commit

void commit()
            throws Exception
Commits additions

Throws:
Exception - An unrecoverable for the operation error occured

getNumberOfElements

long getNumberOfElements()
                         throws Exception
Retrieves the number of elements in the index

Returns:
the number of results
Throws:
Exception - An unrecoverable for the operation error occured

removeEntry

void removeEntry(String id)
                 throws Exception
Removes the record from the index

Parameters:
id - The id of the record
Throws:
Exception - An unrecoverable for the operation error occured

lookup

ArrayList<RankedResultElement> lookup(float[] vector,
                                      int k)
                                      throws Exception
Performs a lookup with default parameter values

Parameters:
vector - The prototype vector
k - The number of results
Returns:
The results
Throws:
Exception - An unrecoverable for the operation error occured

lookup

ArrayList<RankedResultElement> lookup(float[] vector,
                                      int k,
                                      LookupParams params)
                                      throws Exception
Performs a lookup with default parameter values

Parameters:
vector - The prototype vector
k - The number of results
params - The parameters of the lookup
Returns:
The results
Throws:
Exception - An unrecoverable for the operation error occured

getIndexID

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

Returns:
The index ID
Throws:
Exception - An unrecoverable for the operation error occured


Copyright © 2013. All Rights Reserved.