|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sleepycat.collections.DataCursor
final class DataCursor
Represents a Berkeley DB cursor and adds support for indices, bindings and key ranges.
This class operates on a view and takes care of reading and updating indices, calling bindings, constraining access to a key range, etc.
Field Summary | |
---|---|
(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 Summary | |
---|---|
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,
Object singleKey)
Creates a cursor for a given view and single key range. |
|
DataCursor(DataView view,
boolean writeAllowed,
Object beginKey,
boolean beginInclusive,
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. |
Method Summary | |
---|---|
(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(Object key,
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(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) 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) 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(Object key,
Object value,
boolean lockForWrite)
Binding version of Cursor.getSearchKey(), no join cursor allowed. |
(package private) OperationStatus |
getSearchKeyRange(Object key,
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(Object key,
Object value,
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(Object value)
Binding version of Cursor.putAfter(). |
(package private) OperationStatus |
putBefore(Object value)
Binding version of Cursor.putBefore(). |
(package private) OperationStatus |
putCurrent(Object value)
Binding version of Cursor.putCurrent(). |
(package private) OperationStatus |
putNoDupData(Object key,
Object value,
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(Object key,
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static final int REPOS_EXACT
static final int REPOS_NEXT
static final int REPOS_EOF
Constructor Detail |
---|
DataCursor(DataView view, boolean writeAllowed) throws DatabaseException
DatabaseException
DataCursor(DataView view, boolean writeAllowed, CursorConfig config) throws DatabaseException
DatabaseException
DataCursor(DataView view, boolean writeAllowed, Object singleKey) throws DatabaseException
DatabaseException
DataCursor(DataView view, boolean writeAllowed, Object beginKey, boolean beginInclusive, Object endKey, boolean endInclusive) throws DatabaseException
DatabaseException
DataCursor(DataView view, DataCursor[] indexCursors, JoinConfig joinConfig, boolean closeIndexCursors) throws DatabaseException
DatabaseException
Method Detail |
---|
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
IllegalStateException
- when the database has unordered keys or
unordered duplicates.
DatabaseException
DataView getView()
KeyRange getRange()
boolean isWriteAllowed()
Object getCurrentKey() throws DatabaseException
DatabaseException
Object getCurrentValue() throws DatabaseException
DatabaseException
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(Object key, Object value, boolean lockForWrite) throws DatabaseException
DatabaseException
OperationStatus getSearchKeyRange(Object key, Object value, boolean lockForWrite) throws DatabaseException
DatabaseException
OperationStatus findBoth(Object key, Object value, boolean lockForWrite) throws DatabaseException
DatabaseException
OperationStatus findValue(Object value, boolean findFirst) throws DatabaseException
DatabaseException
int count() throws DatabaseException
DatabaseException
OperationStatus putCurrent(Object value) throws DatabaseException
DatabaseException
OperationStatus putAfter(Object value) throws DatabaseException
DatabaseException
OperationStatus putBefore(Object value) throws DatabaseException
DatabaseException
OperationStatus put(Object key, Object value, Object[] oldValue, boolean useCurrentKey) throws DatabaseException
DatabaseException
OperationStatus putNoOverwrite(Object key, Object value, boolean useCurrentKey) throws DatabaseException
DatabaseException
OperationStatus putNoDupData(Object key, Object value, Object[] oldValue, boolean useCurrentKey) throws DatabaseException
DatabaseException
void useRangeKey()
OperationStatus delete() throws DatabaseException
DatabaseException
LockMode getLockMode(boolean lockForWrite)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |