net.obsearch.index
Interface IndexShort<O extends OBShort>

Type Parameters:
O - An object of type OBShort that will be stored in the index.
All Superinterfaces:
Index<O>
All Known Implementing Classes:
DistPermShort, Sketch64Short

public interface IndexShort<O extends OBShort>
extends Index<O>

An Index interface for distance functions that return Shorts.

Since:
0.7
Author:
Arnoldo Jose Muller Molina

Field Summary
 
Fields inherited from interface net.obsearch.Index
ID_SIZE
 
Method Summary
 short[] fullMatchLite(O query, boolean filterSame)
          This method returns a list of all the distances of the query against the DB.
 void searchOB(O object, short r, Filter<O> filter, OBPriorityQueueShort<O> result)
          Searches the Index and returns OBResult (ID, OB and distance) elements that are closer to "object".
 void searchOB(O object, short r, OBPriorityQueueShort<O> result)
          Searches the Index and returns OBResult (ID, OB and distance) elements that are closer to "object".
 
Methods inherited from interface net.obsearch.Index
close, databaseSize, debug, delete, exists, freeze, getBox, getObject, getStats, getType, init, insert, insert, insertBulk, insertBulk, isFrozen, loadObject, resetStats, setPreFreezeCheck, totalBoxes
 

Method Detail

searchOB

void searchOB(O object,
              short r,
              OBPriorityQueueShort<O> result)
              throws NotFrozenException,
                     InstantiationException,
                     IllegalIdException,
                     IllegalAccessException,
                     OutOfRangeException,
                     OBException
Searches the Index and returns OBResult (ID, OB and distance) elements that are closer to "object". The closest element is at the beginning of the list and the farthest elements is at the end of the list. You can control the size of the resulting set when you create the object "result". This becomes the k parameter of the search.

Parameters:
object - The object that has to be searched
r - The range to be used
result - A priority queue that will hold the result
Throws:
NotFrozenException - if the index has not been frozen.
OBException - User generated exception
IllegalAccessException - If there is a problem when instantiating objects O
InstantiationException - If there is a problem when instantiating objects O
IllegalIdException - This exception is left as a Debug flag. If you receive this exception please report the problem to: http://code.google.com/p/obsearch/issues/list
OutOfRangeException - If the distance of any object to any other object exceeds the range defined by the user.

searchOB

void searchOB(O object,
              short r,
              Filter<O> filter,
              OBPriorityQueueShort<O> result)
              throws NotFrozenException,
                     InstantiationException,
                     IllegalIdException,
                     IllegalAccessException,
                     OutOfRangeException,
                     OBException
Searches the Index and returns OBResult (ID, OB and distance) elements that are closer to "object". The closest element is at the beginning of the list and the farthest elements is at the end of the list. You can control the size of the resulting set when you create the object "result". This becomes the k parameter of the search. The parameter "filter" is used to remove unwanted objects from the result (a select where clause). Users are responsible to implement at least one filter that can be used with their O.

Parameters:
object - The object that has to be searched
r - The range to be used
result - A priority queue that will hold the result
Throws:
NotFrozenException - if the index has not been frozen.
OBException - User generated exception
IllegalAccessException - If there is a problem when instantiating objects O
InstantiationException - If there is a problem when instantiating objects O
IllegalIdException - This exception is left as a Debug flag. If you receive this exception please report the problem to: http://code.google.com/p/obsearch/issues/list
OutOfRangeException - If the distance of any object to any other object exceeds the range defined by the user.

fullMatchLite

short[] fullMatchLite(O query,
                      boolean filterSame)
                      throws OBException,
                             IllegalAccessException,
                             InstantiationException
This method returns a list of all the distances of the query against the DB. This helps to calculate EP values in a cheaper way. results that are equal to the original object are added or skipped based on "filterSame" as Float.MAX_VALUE

Parameters:
query -
filterSame - if True we do not return objects o such that query.equals(o)
Returns:
Throws:
OBException
InstantiationException
IllegalAccessException


Copyright © 2007-2011 Arnoldo Jose Muller Molina. All Rights Reserved.