final class DataCursor
extends java.lang.Object
implements java.lang.Cloneable
This class operates on a view and takes care of reading and updating indices, calling bindings, constraining access to a key range, etc.
Modifier and Type | Field and Description |
---|---|
(package private) static int |
REPOS_EOF
Repositioned failed, no records on or after the key/data pair given.
|
(package private) static int |
REPOS_EXACT
Repositioned exactly to the key/data pair given.
|
(package private) static int |
REPOS_NEXT
Repositioned on a record following the key/data pair given.
|
Constructor and Description |
---|
DataCursor(DataView view,
boolean writeAllowed)
Creates a cursor for a given view.
|
DataCursor(DataView view,
boolean writeAllowed,
CursorConfig config)
Creates a cursor for a given view.
|
DataCursor(DataView view,
boolean writeAllowed,
java.lang.Object singleKey)
Creates a cursor for a given view and single key range.
|
DataCursor(DataView view,
boolean writeAllowed,
java.lang.Object beginKey,
boolean beginInclusive,
java.lang.Object endKey,
boolean endInclusive)
Creates a cursor for a given view and key range.
|
DataCursor(DataView view,
DataCursor[] indexCursors,
JoinConfig joinConfig,
boolean closeIndexCursors)
Creates a join cursor.
|
Modifier and Type | Method and Description |
---|---|
(package private) DataCursor |
cloneCursor()
Clones a cursor preserving the current position.
|
(package private) void |
close()
Closes the associated cursor.
|
(package private) int |
count()
Calls Cursor.count(), no join cursor allowed.
|
(package private) OperationStatus |
delete()
Perform an arbitrary database 'delete' operation.
|
(package private) OperationStatus |
findBoth(java.lang.Object key,
java.lang.Object value,
boolean lockForWrite)
Find the given key and value using getSearchBoth if possible or a
sequential scan otherwise, no join cursor allowed.
|
(package private) OperationStatus |
findValue(java.lang.Object value,
boolean findFirst)
Find the given value using getSearchBoth if possible or a sequential
scan otherwise, no join cursor allowed.
|
(package private) OperationStatus |
getCurrent(boolean lockForWrite)
Binding version of Cursor.getCurrent(), no join cursor allowed.
|
(package private) java.lang.Object |
getCurrentKey()
Returns the key object for the last record read.
|
(package private) int |
getCurrentRecordNumber()
Returns the record number for the last record read.
|
(package private) java.lang.Object |
getCurrentValue()
Returns the value object for the last record read.
|
(package private) RangeCursor |
getCursor()
Returns the internal range cursor.
|
(package private) OperationStatus |
getFirst(boolean lockForWrite)
Binding version of Cursor.getFirst(), join cursor is allowed.
|
(package private) DatabaseEntry |
getKeyThang()
Returns the internal key entry.
|
(package private) OperationStatus |
getLast(boolean lockForWrite)
Binding version of Cursor.getLast(), no join cursor allowed.
|
(package private) LockMode |
getLockMode(boolean lockForWrite)
Returns the lock mode to use for a getXxx() operation.
|
(package private) OperationStatus |
getNext(boolean lockForWrite)
Binding version of Cursor.getNext(), join cursor is allowed.
|
(package private) OperationStatus |
getNextDup(boolean lockForWrite)
Binding version of Cursor.getNextDup(), no join cursor allowed.
|
(package private) OperationStatus |
getNextNoDup(boolean lockForWrite)
Binding version of Cursor.getNext(), join cursor is allowed.
|
(package private) OperationStatus |
getPrev(boolean lockForWrite)
Binding version of Cursor.getPrev(), no join cursor allowed.
|
(package private) OperationStatus |
getPrevDup(boolean lockForWrite)
Binding version of Cursor.getPrevDup(), no join cursor allowed.
|
(package private) OperationStatus |
getPrevNoDup(boolean lockForWrite)
Binding version of Cursor.getPrevNoDup(), no join cursor allowed.
|
(package private) DatabaseEntry |
getPrimaryKeyThang()
Returns the internal primary key entry, which is the same object as the
key entry if the cursor is not for a secondary database.
|
(package private) KeyRange |
getRange()
Returns the range for this cursor.
|
(package private) OperationStatus |
getSearchKey(java.lang.Object key,
java.lang.Object value,
boolean lockForWrite)
Binding version of Cursor.getSearchKey(), no join cursor allowed.
|
(package private) OperationStatus |
getSearchKeyRange(java.lang.Object key,
java.lang.Object value,
boolean lockForWrite)
Binding version of Cursor.getSearchKeyRange(), no join cursor allowed.
|
(package private) DatabaseEntry |
getValueThang()
Returns the internal value entry.
|
(package private) DataView |
getView()
Returns the view for this cursor.
|
(package private) boolean |
hasRecNumAccess()
Returns whether record number access is allowed.
|
(package private) boolean |
isWriteAllowed()
Returns whether write is allowed for this cursor, as specified to the
constructor.
|
(package private) OperationStatus |
put(java.lang.Object key,
java.lang.Object value,
java.lang.Object[] oldValue,
boolean useCurrentKey)
Binding version of Cursor.put(), optionally returning the old value and
optionally using the current key instead of the key parameter.
|
(package private) OperationStatus |
putAfter(java.lang.Object value)
Binding version of Cursor.putAfter().
|
(package private) OperationStatus |
putBefore(java.lang.Object value)
Binding version of Cursor.putBefore().
|
(package private) OperationStatus |
putCurrent(java.lang.Object value)
Binding version of Cursor.putCurrent().
|
(package private) OperationStatus |
putNoDupData(java.lang.Object key,
java.lang.Object value,
java.lang.Object[] oldValue,
boolean useCurrentKey)
Binding version of Cursor.putNoDupData(), optionally returning the old
value and optionally using the current key instead of the key parameter.
|
(package private) OperationStatus |
putNoOverwrite(java.lang.Object key,
java.lang.Object value,
boolean useCurrentKey)
Binding version of Cursor.putNoOverwrite(), optionally using the current
key instead of the key parameter.
|
(package private) boolean |
repositionExact(byte[] keyBytes,
byte[] priKeyBytes,
byte[] valueBytes,
boolean lockForWrite)
Repositions to a given raw key/data pair.
|
(package private) int |
repositionRange(byte[] keyBytes,
byte[] priKeyBytes,
byte[] valueBytes,
boolean lockForWrite)
Repositions to a given raw key/data pair, or just past it if that record
has been deleted.
|
(package private) void |
useRangeKey()
Sets the key entry to the begin key of a single key range, so the next
time a putXxx() method is called that key will be used.
|
static final int REPOS_EXACT
static final int REPOS_NEXT
static final int REPOS_EOF
DataCursor(DataView view, boolean writeAllowed) throws DatabaseException
DatabaseException
DataCursor(DataView view, boolean writeAllowed, CursorConfig config) throws DatabaseException
DatabaseException
DataCursor(DataView view, boolean writeAllowed, java.lang.Object singleKey) throws DatabaseException
DatabaseException
DataCursor(DataView view, boolean writeAllowed, java.lang.Object beginKey, boolean beginInclusive, java.lang.Object endKey, boolean endInclusive) throws DatabaseException
DatabaseException
DataCursor(DataView view, DataCursor[] indexCursors, JoinConfig joinConfig, boolean closeIndexCursors) throws DatabaseException
DatabaseException
DataCursor cloneCursor() throws DatabaseException
DatabaseException
RangeCursor getCursor()
void close() throws DatabaseException
DatabaseException
int repositionRange(byte[] keyBytes, byte[] priKeyBytes, byte[] valueBytes, boolean lockForWrite) throws DatabaseException
DatabaseException
boolean repositionExact(byte[] keyBytes, byte[] priKeyBytes, byte[] valueBytes, boolean lockForWrite) throws DatabaseException
java.lang.IllegalStateException
- when the database has unordered keys or
unordered duplicates.DatabaseException
DataView getView()
KeyRange getRange()
boolean isWriteAllowed()
java.lang.Object getCurrentKey()
java.lang.Object getCurrentValue()
DatabaseEntry getKeyThang()
DatabaseEntry getPrimaryKeyThang()
DatabaseEntry getValueThang()
boolean hasRecNumAccess()
int getCurrentRecordNumber() throws DatabaseException
DatabaseException
OperationStatus getCurrent(boolean lockForWrite) throws DatabaseException
DatabaseException
OperationStatus getFirst(boolean lockForWrite) throws DatabaseException
DatabaseException
OperationStatus getNext(boolean lockForWrite) throws DatabaseException
DatabaseException
OperationStatus getNextNoDup(boolean lockForWrite) throws DatabaseException
DatabaseException
OperationStatus getNextDup(boolean lockForWrite) throws DatabaseException
DatabaseException
OperationStatus getLast(boolean lockForWrite) throws DatabaseException
DatabaseException
OperationStatus getPrev(boolean lockForWrite) throws DatabaseException
DatabaseException
OperationStatus getPrevNoDup(boolean lockForWrite) throws DatabaseException
DatabaseException
OperationStatus getPrevDup(boolean lockForWrite) throws DatabaseException
DatabaseException
OperationStatus getSearchKey(java.lang.Object key, java.lang.Object value, boolean lockForWrite) throws DatabaseException
DatabaseException
OperationStatus getSearchKeyRange(java.lang.Object key, java.lang.Object value, boolean lockForWrite) throws DatabaseException
DatabaseException
OperationStatus findBoth(java.lang.Object key, java.lang.Object value, boolean lockForWrite) throws DatabaseException
DatabaseException
OperationStatus findValue(java.lang.Object value, boolean findFirst) throws DatabaseException
DatabaseException
int count() throws DatabaseException
DatabaseException
OperationStatus putCurrent(java.lang.Object value) throws DatabaseException
DatabaseException
OperationStatus putAfter(java.lang.Object value) throws DatabaseException
DatabaseException
OperationStatus putBefore(java.lang.Object value) throws DatabaseException
DatabaseException
OperationStatus put(java.lang.Object key, java.lang.Object value, java.lang.Object[] oldValue, boolean useCurrentKey) throws DatabaseException
DatabaseException
OperationStatus putNoOverwrite(java.lang.Object key, java.lang.Object value, boolean useCurrentKey) throws DatabaseException
DatabaseException
OperationStatus putNoDupData(java.lang.Object key, java.lang.Object value, java.lang.Object[] oldValue, boolean useCurrentKey) throws DatabaseException
DatabaseException
void useRangeKey()
OperationStatus delete() throws DatabaseException
DatabaseException
LockMode getLockMode(boolean lockForWrite)
Copyright (c) 2004-2012 Oracle. All rights reserved.