QueryProcessor.SF.ImgIdx
Class WindsurfQuerySFMtree

java.lang.Object
  extended by QueryProcessor.Query
      extended by QueryProcessor.SF.QuerySF
          extended by QueryProcessor.SF.ImgIdx.QuerySFIndex
              extended by QueryProcessor.SF.ImgIdx.WindsurfQuerySFMtree

public class WindsurfQuerySFMtree
extends QuerySFIndex

Class representing a query for Windsurf with a scoring function to be solved with a M-tree.


Field Summary
protected  java.lang.String filename
          The absolute path of the file containing the index
 
Fields inherited from class QueryProcessor.SF.QuerySF
sf
 
Fields inherited from class QueryProcessor.Query
q
 
Constructor Summary
WindsurfQuerySFMtree(Image query, ScoringFunction sf, java.lang.String filename)
          Basic constructor.
 
Method Summary
 boolean closeCursor()
          Deletes the previously created cursor for sorted access.
 boolean createCursor()
          Creates a cursor for performing sorted access on the index.
 int getDistances()
          Returns the number of distance computations performed by the region index.
 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.
 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
 

Field Detail

filename

protected java.lang.String filename
The absolute path of the file containing the index

Constructor Detail

WindsurfQuerySFMtree

public WindsurfQuerySFMtree(Image query,
                            ScoringFunction sf,
                            java.lang.String filename)
Basic constructor.

Parameters:
query - Query image.
sf - Scoring function to be used.
filename - The absolute path of the file containing the index.
Method Detail

kNN

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

Overrides:
kNN in class QuerySFIndex
Parameters:
k - Number of requested results.
Returns:
Vector of query results.

range

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

Overrides:
range in class QuerySFIndex
Parameters:
r - Radius of the query.
Returns:
Vector of query results.

createCursor

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

Specified by:
createCursor in class QuerySFIndex
Returns:
true if the cursor was successfully created, false otherwise.

closeCursor

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

Specified by:
closeCursor in class QuerySFIndex
Returns:
true if the cursor was successfully deleted, false otherwise.

getNext

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

Specified by:
getNext in class QuerySFIndex
Returns:
The next image of the cursor.

resetDistances

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

Specified by:
resetDistances in class QuerySFIndex
Returns:
true if the count was successfully reset, false otherwise.

getDistances

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

Specified by:
getDistances in class QuerySFIndex
Returns:
Number of distance computations performed by the region index.