Interface Cursor<K,V>
-
- Type Parameters:
K- Type of the record's keyV- Type of the record's value
- All Superinterfaces:
AutoCloseable,Closeable,SequentialCursor<K,V>
- All Known Implementing Classes:
EmptyCursor
public interface Cursor<K,V> extends SequentialCursor<K,V>
Sequential cursor extended with navigation methods.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanpositionToIndex(int index)Positions the cursor to the specified index within the tree.booleanpositionToKey(ByteSequence key)Positions the cursor to the provided key if it exists in the tree.booleanpositionToKeyOrNext(ByteSequence key)Positions the cursor to the provided key if it exists in the tree, or else the lesser key greater than the provided key in the tree.booleanpositionToLastKey()Positions the cursor to the last key in the tree.
-
-
-
Method Detail
-
positionToKey
boolean positionToKey(ByteSequence key)
Positions the cursor to the provided key if it exists in the tree.- Parameters:
key- the key where to position the cursor- Returns:
trueif the cursor could be positioned to the key,falseotherwise
-
positionToKeyOrNext
boolean positionToKeyOrNext(ByteSequence key)
Positions the cursor to the provided key if it exists in the tree, or else the lesser key greater than the provided key in the tree.- Parameters:
key- the key where to position the cursor- Returns:
trueif the cursor could be positioned to the key or the next one,falseotherwise
-
positionToLastKey
boolean positionToLastKey()
Positions the cursor to the last key in the tree.- Returns:
trueif the cursor could be positioned to the last key,falseotherwise
-
positionToIndex
boolean positionToIndex(int index)
Positions the cursor to the specified index within the tree. Implementations may take advantage of optimizations provided by the underlying storage, such as counted B-Trees.- Parameters:
index- the index where the cursor should be positioned, (0 is the first record).- Returns:
trueif the cursor could be positioned to the index,falseotherwise
-
-