com.sleepycat.util.keyrange
Class RangeCursor
public
class
RangeCursor
extends Object
implements Cloneable
A cursor-like interface that enforces a key range. The method signatures
are actually those of SecondaryCursor, but the pKey parameter may be null.
It was done this way to avoid doubling the number of methods.
This is not a fully general implementation of a range cursor and should
not be used directly by applications; however, it may evolve into a
generally useful range cursor some day.
Method Summary |
protected boolean | checkRecordNumber()
If the database is a RECNO or QUEUE database, we know its keys are
record numbers. |
void | close() |
protected void | closeCursor(Cursor cursor)
Closes the given cursor. |
int | count() |
OperationStatus | delete() |
RangeCursor | dup(boolean samePosition)
Create a cloned range cursor. |
protected Cursor | dupCursor(Cursor cursor, boolean samePosition)
Dups the given cursor. |
OperationStatus | getCurrent(DatabaseEntry key, DatabaseEntry pKey, DatabaseEntry data, LockMode lockMode) |
Cursor | getCursor()
Returns the underlying cursor. |
OperationStatus | getFirst(DatabaseEntry key, DatabaseEntry pKey, DatabaseEntry data, LockMode lockMode) |
OperationStatus | getLast(DatabaseEntry key, DatabaseEntry pKey, DatabaseEntry data, LockMode lockMode) |
OperationStatus | getNext(DatabaseEntry key, DatabaseEntry pKey, DatabaseEntry data, LockMode lockMode) |
OperationStatus | getNextDup(DatabaseEntry key, DatabaseEntry pKey, DatabaseEntry data, LockMode lockMode) |
OperationStatus | getNextNoDup(DatabaseEntry key, DatabaseEntry pKey, DatabaseEntry data, LockMode lockMode) |
OperationStatus | getPrev(DatabaseEntry key, DatabaseEntry pKey, DatabaseEntry data, LockMode lockMode) |
OperationStatus | getPrevDup(DatabaseEntry key, DatabaseEntry pKey, DatabaseEntry data, LockMode lockMode) |
OperationStatus | getPrevNoDup(DatabaseEntry key, DatabaseEntry pKey, DatabaseEntry data, LockMode lockMode) |
OperationStatus | getSearchBoth(DatabaseEntry key, DatabaseEntry pKey, DatabaseEntry data, LockMode lockMode) |
OperationStatus | getSearchBothRange(DatabaseEntry key, DatabaseEntry pKey, DatabaseEntry data, LockMode lockMode) |
OperationStatus | getSearchKey(DatabaseEntry key, DatabaseEntry pKey, DatabaseEntry data, LockMode lockMode) |
OperationStatus | getSearchKeyRange(DatabaseEntry key, DatabaseEntry pKey, DatabaseEntry data, LockMode lockMode) |
OperationStatus | getSearchRecordNumber(DatabaseEntry key, DatabaseEntry pKey, DatabaseEntry data, LockMode lockMode) |
boolean | isInitialized()
Returns whether the cursor is initialized at a valid position. |
OperationStatus | put(DatabaseEntry key, DatabaseEntry data) |
OperationStatus | putAfter(DatabaseEntry key, DatabaseEntry data) |
OperationStatus | putBefore(DatabaseEntry key, DatabaseEntry data) |
OperationStatus | putCurrent(DatabaseEntry data) |
OperationStatus | putNoDupData(DatabaseEntry key, DatabaseEntry data) |
OperationStatus | putNoOverwrite(DatabaseEntry key, DatabaseEntry data) |
Creates a range cursor.
Creates a range cursor with a duplicate range.
protected boolean checkRecordNumber()
If the database is a RECNO or QUEUE database, we know its keys are
record numbers. We treat a non-positive record number as out of bounds,
that is, we return NOTFOUND rather than throwing
IllegalArgumentException as would happen if we passed a non-positive
record number into the DB cursor. This behavior is required by the
collections interface.
public void close()
protected void closeCursor(
Cursor cursor)
Closes the given cursor.
public int count()
Create a cloned range cursor. The caller must clone the underlying
cursor before using this constructor, because cursor open/close is
handled specially for CDS cursors outside this class.
protected
Cursor dupCursor(
Cursor cursor, boolean samePosition)
Dups the given cursor.
Returns the underlying cursor. Used for cloning.
public boolean isInitialized()
Returns whether the cursor is initialized at a valid position.