QueryProcessor.Utils
Class SortedAccess

java.lang.Object
  extended by QueryProcessor.Utils.SortedAccess
Direct Known Subclasses:
SortedAccessMtree

public abstract class SortedAccess
extends java.lang.Object

Abstract class for the management of sorted accesses to the region index.


Field Summary
protected  Image query
          The query image
protected  long time
          The time (in milliseconds) spent for sorted accesses
 
Constructor Summary
SortedAccess(Image query)
          Basic constructor.
 
Method Summary
protected abstract  int getBestSortedAccess()
          Selects the most appropriate region scan to be performed next.
 int getCount()
          Returns the number of performed sorted accesses.
abstract  int getDistances()
          Returns the number of distance computations performed by the region index.
 Image getImage()
          Returns the query image.
 SortedAccessResult getNext()
          Performs a sorted access (according to the local policy).
protected abstract  SortedAccessResult getNext(int index)
          Performs a sorted access on the specified region scan.
 long getTime()
          Returns the time needed to perform sorted accesses.
 void reset()
          Resets all the counters.
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
 

Field Detail

query

protected Image query
The query image


time

protected long time
The time (in milliseconds) spent for sorted accesses

Constructor Detail

SortedAccess

public SortedAccess(Image query)
Basic constructor.

Parameters:
query - The query image.
Method Detail

getImage

public Image getImage()
Returns the query image.

Returns:
The query image.

getBestSortedAccess

protected abstract int getBestSortedAccess()
Selects the most appropriate region scan to be performed next.

Returns:
Index of the best region scan.

getCount

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

Returns:
The number of performed sorted accesses.

getNext

protected abstract SortedAccessResult getNext(int index)
Performs a sorted access on the specified region scan.

Parameters:
index - Index of the region scan to be accessed.
Returns:
The result of the requested region scan (null if no such region scan exists or if the requested region scan has been completed).

getNext

public SortedAccessResult getNext()
Performs a sorted access (according to the local policy).

Returns:
The result of the most appropriate region scan (null if no region scan exists or if all region scans have been completed).

reset

public void reset()
Resets all the counters.


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.

getTime

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

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