QueryProcessor.SF.kNNset
Class kNNset

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

public class kNNset
extends QuerySFIndex

Class implementing the k-NN-set algorithm for solving a query with a scoring function.


Field Summary
 
Fields inherited from class QueryProcessor.SF.QuerySF
sf
 
Fields inherited from class QueryProcessor.Query
q
 
Constructor Summary
kNNset(Image q, ScoringFunction sf, FeatureManager fm, SortedAccess sam)
          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 total number of computed distances.
 long getImageRetrievalTime()
          Returns the time spent for retrieving features from the DB.
 ScoredResultImage getNext()
          Returns the next best image.
 int getRandomAccessCount()
          Returns the number of performed random accesses.
 int getRandomAccessDistances()
          Returns the number of distances computed outside of the index.
 long getRandomAccessTime()
          Returns the time needed to perform random accesses.
 int getSortedAccessCount()
          Returns the number of performed sorted accesses.
 int getSortedAccessDistances()
          Returns the number of distances computed by the index.
 long getSortedAccessTime()
          Returns the time needed to perform sorted accesses.
 long getTime()
          Returns the time needed to perform the whole algorithm.
 boolean resetDistances()
          Resets the number of computed distances.
 
Methods inherited from class QueryProcessor.SF.ImgIdx.QuerySFIndex
kNN, range
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

kNNset

public kNNset(Image q,
              ScoringFunction sf,
              FeatureManager fm,
              SortedAccess sam)
Basic constructor.

Parameters:
q - Query image.
sf - Scoring function to be used.
fm - The feature manager to be used.
sam - The sorted access manager to be used
Method Detail

createCursor

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

Specified by:
createCursor in class QuerySFIndex
Returns:
true, always.

closeCursor

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

Specified by:
closeCursor in class QuerySFIndex
Returns:
true, always.

getNext

public ScoredResultImage getNext()
Returns the next best image.

Specified by:
getNext in class QuerySFIndex
Returns:
The next image of the cursor, null if no such image exist.

getSortedAccessTime

public long getSortedAccessTime()
Returns the time needed to perform sorted accesses.

Returns:
The time needed to perform sorted accesses (in milliseconds).

getRandomAccessTime

public long getRandomAccessTime()
Returns the time needed to perform random accesses.

Returns:
The time needed to perform random accesses (in milliseconds).

getImageRetrievalTime

public long getImageRetrievalTime()
Returns the time spent for retrieving features from the DB.

Returns:
The time spent for retrieving features from the DB (in milliseconds).

getTime

public long getTime()
Returns the time needed to perform the whole algorithm.

Returns:
The time needed to perform the whole algorithm (in milliseconds).

getRandomAccessCount

public int getRandomAccessCount()
Returns the number of performed random accesses.

Returns:
The number of performed random accesses.

getSortedAccessCount

public int getSortedAccessCount()
Returns the number of performed sorted accesses.

Returns:
The number of performed sorted accesses.

getRandomAccessDistances

public int getRandomAccessDistances()
Returns the number of distances computed outside of the index.

Returns:
The number of distances computed outside of the index.

getSortedAccessDistances

public int getSortedAccessDistances()
Returns the number of distances computed by the index.

Returns:
The number of distances computed by the index.

getDistances

public int getDistances()
Returns the total number of computed distances.

Specified by:
getDistances in class QuerySFIndex
Returns:
The total number of computed distances.

resetDistances

public boolean resetDistances()
Resets the number of computed distances.

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