org.hypergraphdb.storage
Class KeyScanResultSet<T>

java.lang.Object
  extended by org.hypergraphdb.storage.IndexResultSet<T>
      extended by org.hypergraphdb.storage.KeyScanResultSet<T>
All Implemented Interfaces:
java.util.Iterator<T>, HGRandomAccessResult<T>, HGSearchResult<T>, TwoWayIterator<T>, CloseMe

public class KeyScanResultSet<T>
extends IndexResultSet<T>

Scans the key elements of an index. Similar to KeyRangeForwardResultSet, but instead of returning the data, it returns the keys.

Author:
Borislav Iordanov

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.hypergraphdb.HGRandomAccessResult
HGRandomAccessResult.GotoResult
 
Field Summary
 
Fields inherited from interface org.hypergraphdb.HGSearchResult
EMPTY
 
Constructor Summary
KeyScanResultSet(BDBTxCursor cursor, com.sleepycat.db.DatabaseEntry keyIn, ByteArrayConverter<T> converter)
           
 
Method Summary
 HGRandomAccessResult.GotoResult goTo(T value, boolean exactMatch)
          Position the result set at a particular value if that value is indeed part of the result set.
 boolean isOrdered()
          Return true if the elements in this search result are in ordered and false otherwise.
 
Methods inherited from class org.hypergraphdb.storage.IndexResultSet
close, count, current, hasNext, hasPrev, next, prev, remove, removeCurrent
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeyScanResultSet

public KeyScanResultSet(BDBTxCursor cursor,
                        com.sleepycat.db.DatabaseEntry keyIn,
                        ByteArrayConverter<T> converter)
Method Detail

isOrdered

public boolean isOrdered()
Description copied from interface: HGSearchResult

Return true if the elements in this search result are in ordered and false otherwise. It is assumed that when elements are ordered, they are instances of java.lang.Comparable


goTo

public HGRandomAccessResult.GotoResult goTo(T value,
                                            boolean exactMatch)
Description copied from interface: HGRandomAccessResult

Position the result set at a particular value if that value is indeed part of the result set.

Specified by:
goTo in interface HGRandomAccessResult<T>
Overrides:
goTo in class IndexResultSet<T>
Parameters:
value - The value where this result set should be positioned.
exactMatch - A flag indicating whether the passed in value should match exactly a value in the result set, or whether the cursor should be positioned to the closest value. Here "closest" means "smallest greater than the value parameter.
Returns:
A GotoResult.