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 boolean
positionToIndex(int index)
Positions the cursor to the specified index within the tree.boolean
positionToKey(ByteSequence key)
Positions the cursor to the provided key if it exists in the tree.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.boolean
positionToLastKey()
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:
true
if the cursor could be positioned to the key,false
otherwise
-
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:
true
if the cursor could be positioned to the key or the next one,false
otherwise
-
positionToLastKey
boolean positionToLastKey()
Positions the cursor to the last key in the tree.- Returns:
true
if the cursor could be positioned to the last key,false
otherwise
-
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:
true
if the cursor could be positioned to the index,false
otherwise
-
-