QueryProcessor.SF.ImgIdx
Class QuerySFIndex

java.lang.Object
  extended by QueryProcessor.Query
      extended by QueryProcessor.SF.QuerySF
          extended by QueryProcessor.SF.ImgIdx.QuerySFIndex
Direct Known Subclasses:
kNNset, WindsurfQuerySFMtree

public abstract class QuerySFIndex
extends QuerySF

Abstract class representing a query with a scoring function to be solved with an index.


Field Summary
 
Fields inherited from class QueryProcessor.SF.QuerySF
sf
 
Fields inherited from class QueryProcessor.Query
q
 
Constructor Summary
QuerySFIndex(Image q, ScoringFunction sf)
          Basic constructor.
 
Method Summary
abstract  boolean closeCursor()
          Deletes the previously created cursor for sorted access.
abstract  boolean createCursor()
          Creates a cursor for performing sorted access on the index.
abstract  int getDistances()
          Returns the number of distance computations performed by the region index.
abstract  ScoredResultImage getNext()
          Performs a sorted access on the existing cursor.
 java.util.Vector<ScoredResultImage> kNN(int k)
          Performs a k-nn query.
 java.util.Vector<ScoredResultImage> range(double r)
          Performs a range query.
abstract  boolean resetDistances()
          Resets the number of distance computations performed by the region index.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuerySFIndex

public QuerySFIndex(Image q,
                    ScoringFunction sf)
Basic constructor.

Parameters:
q - Query image.
sf - Scoring function to be used.
Method Detail

createCursor

public abstract boolean createCursor()
Creates a cursor for performing sorted access on the index.

Returns:
true if the cursor was successfully created, false otherwise.

closeCursor

public abstract boolean closeCursor()
Deletes the previously created cursor for sorted access.

Returns:
true if the cursor was successfully deleted, false otherwise.

kNN

public java.util.Vector<ScoredResultImage> kNN(int k)
Performs a k-nn query.

Specified by:
kNN in class QuerySF
Parameters:
k - Number of requested results.
Returns:
Vector of query results.

range

public java.util.Vector<ScoredResultImage> range(double r)
Performs a range query.

Parameters:
r - Radius of the query.
Returns:
Vector of query results.

getNext

public abstract ScoredResultImage getNext()
Performs a sorted access on the existing cursor.

Returns:
The next image of the cursor, null if no such image exist.

resetDistances

public abstract boolean resetDistances()
Resets the number of distance computations performed by the region index.

Returns:
true if the count was successfully reset, false otherwise.

getDistances

public abstract int getDistances()
Returns the number of distance computations performed by the region index.

Returns:
Number of distance computations performed by the region index.