Main Page | Class Hierarchy | Data Structures | Directories | File List | Data Fields | Related Pages

com::sleepycat::collections::DataCursor Class Reference


Package Functions

 DataCursor (DataView view, boolean writeAllowed) throws DatabaseException
 DataCursor (DataView view, boolean writeAllowed, Object singleKey) throws DatabaseException
 DataCursor (DataView view, boolean writeAllowed, Object beginKey, boolean beginInclusive, Object endKey, boolean endInclusive) throws DatabaseException
 DataCursor (DataView view, DataCursor[] indexCursors, JoinConfig joinConfig, boolean closeIndexCursors) throws DatabaseException
DataCursor cloneCursor () throws DatabaseException
RangeCursor getCursor ()
void close () throws DatabaseException
DataView getView ()
KeyRange getRange ()
boolean isWriteAllowed ()
Object getCurrentKey () throws DatabaseException
Object getCurrentValue () throws DatabaseException
boolean hasRecNumAccess ()
int getCurrentRecordNumber () throws DatabaseException
OperationStatus getCurrent (boolean lockForWrite) throws DatabaseException
OperationStatus getFirst (boolean lockForWrite) throws DatabaseException
OperationStatus getNext (boolean lockForWrite) throws DatabaseException
OperationStatus getNextNoDup (boolean lockForWrite) throws DatabaseException
OperationStatus getNextDup (boolean lockForWrite) throws DatabaseException
OperationStatus getLast (boolean lockForWrite) throws DatabaseException
OperationStatus getPrev (boolean lockForWrite) throws DatabaseException
OperationStatus getPrevNoDup (boolean lockForWrite) throws DatabaseException
OperationStatus getPrevDup (boolean lockForWrite) throws DatabaseException
OperationStatus getSearchKey (Object key, Object value, boolean lockForWrite) throws DatabaseException
OperationStatus getSearchKeyRange (Object key, Object value, boolean lockForWrite) throws DatabaseException
OperationStatus getSearchBoth (Object key, Object value, boolean lockForWrite) throws DatabaseException
OperationStatus find (Object value, boolean findFirst) throws DatabaseException
int count () throws DatabaseException
OperationStatus putCurrent (Object value) throws DatabaseException
OperationStatus putAfter (Object value) throws DatabaseException
OperationStatus putBefore (Object value) throws DatabaseException
OperationStatus put (Object key, Object value, Object[] oldValue, boolean useCurrentKey) throws DatabaseException
OperationStatus putNoOverwrite (Object key, Object value, boolean useCurrentKey) throws DatabaseException
OperationStatus putNoDupData (Object key, Object value, Object[] oldValue, boolean useCurrentKey) throws DatabaseException
void useRangeKey ()
OperationStatus delete () throws DatabaseException
LockMode getLockMode (boolean lockForWrite)

Detailed Description

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.

Author:
Mark Hayes

Definition at line 30 of file DataCursor.java.


Constructor & Destructor Documentation

com::sleepycat::collections::DataCursor::DataCursor DataView  view,
boolean  writeAllowed
throws DatabaseException [inline, package]
 

Creates a cursor for a given view.

Definition at line 47 of file DataCursor.java.

com::sleepycat::collections::DataCursor::DataCursor DataView  view,
boolean  writeAllowed,
Object  singleKey
throws DatabaseException [inline, package]
 

Creates a cursor for a given view and single key range.

Definition at line 56 of file DataCursor.java.

References com::sleepycat::collections::DataView::subRange().

com::sleepycat::collections::DataCursor::DataCursor DataView  view,
boolean  writeAllowed,
Object  beginKey,
boolean  beginInclusive,
Object  endKey,
boolean  endInclusive
throws DatabaseException [inline, package]
 

Creates a cursor for a given view and key range.

Definition at line 65 of file DataCursor.java.

References com::sleepycat::collections::DataView::subRange().

com::sleepycat::collections::DataCursor::DataCursor DataView  view,
DataCursor[]  indexCursors,
JoinConfig  joinConfig,
boolean  closeIndexCursors
throws DatabaseException [inline, package]
 

Creates a join cursor.

Definition at line 77 of file DataCursor.java.

References com::sleepycat::collections::DataView::db, and com::sleepycat::collections::DataView::isSecondary().


Member Function Documentation

DataCursor com::sleepycat::collections::DataCursor::cloneCursor  )  throws DatabaseException [inline, package]
 

Clones a cursor preserving the current position.

Definition at line 100 of file DataCursor.java.

References cursor, com::sleepycat::collections::RangeCursor::dup(), initThangs(), keyThang, primaryKeyThang, and valueThang.

Referenced by com::sleepycat::collections::StoredIterator::clone().

void com::sleepycat::collections::DataCursor::close  )  throws DatabaseException [inline, package]
 

Closes the associated cursor.

Definition at line 163 of file DataCursor.java.

References close(), com::sleepycat::collections::CurrentTransaction::closeCursor(), com::sleepycat::collections::DataView::currentTxn, and com::sleepycat::collections::RangeCursor::getCursor().

Referenced by com::sleepycat::collections::DataView::append(), com::sleepycat::collections::DataView::clear(), close(), com::sleepycat::collections::DataView::isEmpty(), and com::sleepycat::collections::DataView::join().

int com::sleepycat::collections::DataCursor::count  )  throws DatabaseException [inline, package]
 

Calls Cursor.count(), no join cursor allowed.

Definition at line 491 of file DataCursor.java.

References com::sleepycat::collections::RangeCursor::count().

Referenced by com::sleepycat::collections::StoredIterator::count(), and com::sleepycat::collections::StoredValueSet::size().

OperationStatus com::sleepycat::collections::DataCursor::delete  )  throws DatabaseException [inline, package]
 

Perform an arbitrary database 'delete' operation.

Definition at line 642 of file DataCursor.java.

References com::sleepycat::collections::RangeCursor::delete().

Referenced by com::sleepycat::collections::DataView::clear(), com::sleepycat::collections::StoredIterator::remove(), and com::sleepycat::collections::StoredEntrySet::remove().

OperationStatus com::sleepycat::collections::DataCursor::find Object  value,
boolean  findFirst
throws DatabaseException [inline, package]
 

Find the given value using getSearchBoth if possible or a sequential scan otherwise, no join cursor allowed.

Definition at line 463 of file DataCursor.java.

References com::sleepycat::collections::DataView::dupsAllowed, com::sleepycat::collections::DataView::entityBinding, getFirst(), getLast(), getNext(), getPrev(), getSearchBoth(), com::sleepycat::collections::DataView::isSecondary(), and com::sleepycat::collections::DataView::useValue().

OperationStatus com::sleepycat::collections::DataCursor::getCurrent boolean  lockForWrite  )  throws DatabaseException [inline, package]
 

Binding version of Cursor.getCurrent(), no join cursor allowed.

Definition at line 262 of file DataCursor.java.

References com::sleepycat::collections::RangeCursor::getCurrent(), and getLockMode().

Object com::sleepycat::collections::DataCursor::getCurrentKey  )  throws DatabaseException [inline, package]
 

Returns the key object for the last record read.

Definition at line 213 of file DataCursor.java.

References com::sleepycat::collections::DataView::keyBinding, and com::sleepycat::collections::DataView::makeKey().

int com::sleepycat::collections::DataCursor::getCurrentRecordNumber  )  throws DatabaseException [inline, package]
 

Returns the record number for the last record read.

Definition at line 242 of file DataCursor.java.

References com::sleepycat::collections::DataView::btreeRecNumDb, com::sleepycat::collections::RangeCursor::getCursor(), and getLockMode().

Referenced by com::sleepycat::collections::StoredIterator::nextIndex(), and com::sleepycat::collections::StoredIterator::previousIndex().

Object com::sleepycat::collections::DataCursor::getCurrentValue  )  throws DatabaseException [inline, package]
 

Returns the value object for the last record read.

Definition at line 225 of file DataCursor.java.

References com::sleepycat::collections::DataView::makeValue().

RangeCursor com::sleepycat::collections::DataCursor::getCursor  )  [inline, package]
 

Returns the internal range cursor.

Definition at line 126 of file DataCursor.java.

Referenced by com::sleepycat::collections::DataView::append().

OperationStatus com::sleepycat::collections::DataCursor::getFirst boolean  lockForWrite  )  throws DatabaseException [inline, package]
 

Binding version of Cursor.getFirst(), join cursor is allowed.

Definition at line 273 of file DataCursor.java.

References com::sleepycat::collections::RangeCursor::getFirst(), and getLockMode().

Referenced by com::sleepycat::collections::DataView::clear(), find(), com::sleepycat::collections::DataView::isEmpty(), and com::sleepycat::collections::StoredValueSet::size().

OperationStatus com::sleepycat::collections::DataCursor::getLast boolean  lockForWrite  )  throws DatabaseException [inline, package]
 

Binding version of Cursor.getLast(), no join cursor allowed.

Definition at line 329 of file DataCursor.java.

References com::sleepycat::collections::RangeCursor::getLast(), and getLockMode().

Referenced by find().

LockMode com::sleepycat::collections::DataCursor::getLockMode boolean  lockForWrite  )  [inline, package]
 

Returns the lock mode to use for a getXxx() operation.

Definition at line 652 of file DataCursor.java.

References com::sleepycat::collections::DataView::currentTxn, and com::sleepycat::collections::CurrentTransaction::getWriteLockMode().

Referenced by getCurrent(), getCurrentRecordNumber(), getFirst(), getLast(), getNext(), getNextDup(), getNextNoDup(), getPrev(), getPrevDup(), getPrevNoDup(), getSearchBoth(), getSearchKeyRange(), and putNoDupData().

OperationStatus com::sleepycat::collections::DataCursor::getNext boolean  lockForWrite  )  throws DatabaseException [inline, package]
 

Binding version of Cursor.getNext(), join cursor is allowed.

Definition at line 288 of file DataCursor.java.

References getLockMode(), and com::sleepycat::collections::RangeCursor::getNext().

Referenced by com::sleepycat::collections::DataView::clear(), and find().

OperationStatus com::sleepycat::collections::DataCursor::getNextDup boolean  lockForWrite  )  throws DatabaseException [inline, package]
 

Binding version of Cursor.getNextDup(), no join cursor allowed.

Definition at line 318 of file DataCursor.java.

References getLockMode(), and com::sleepycat::collections::RangeCursor::getNextDup().

OperationStatus com::sleepycat::collections::DataCursor::getNextNoDup boolean  lockForWrite  )  throws DatabaseException [inline, package]
 

Binding version of Cursor.getNext(), join cursor is allowed.

Definition at line 303 of file DataCursor.java.

References getLockMode(), and com::sleepycat::collections::RangeCursor::getNextNoDup().

OperationStatus com::sleepycat::collections::DataCursor::getPrev boolean  lockForWrite  )  throws DatabaseException [inline, package]
 

Binding version of Cursor.getPrev(), no join cursor allowed.

Definition at line 340 of file DataCursor.java.

References getLockMode(), and com::sleepycat::collections::RangeCursor::getPrev().

Referenced by find().

OperationStatus com::sleepycat::collections::DataCursor::getPrevDup boolean  lockForWrite  )  throws DatabaseException [inline, package]
 

Binding version of Cursor.getPrevDup(), no join cursor allowed.

Definition at line 362 of file DataCursor.java.

References getLockMode(), and com::sleepycat::collections::RangeCursor::getPrevDup().

OperationStatus com::sleepycat::collections::DataCursor::getPrevNoDup boolean  lockForWrite  )  throws DatabaseException [inline, package]
 

Binding version of Cursor.getPrevNoDup(), no join cursor allowed.

Definition at line 351 of file DataCursor.java.

References getLockMode(), and com::sleepycat::collections::RangeCursor::getPrevNoDup().

KeyRange com::sleepycat::collections::DataCursor::getRange  )  [inline, package]
 

Returns the range for this cursor.

Definition at line 196 of file DataCursor.java.

OperationStatus com::sleepycat::collections::DataCursor::getSearchBoth Object  key,
Object  value,
boolean  lockForWrite
throws DatabaseException [inline, package]
 

Binding version of Cursor.getSearchBoth(), no join cursor allowed. Unlike SecondaryCursor.getSearchBoth, for a secondary this searches for the primary value not the primary key.

Definition at line 425 of file DataCursor.java.

References getLockMode(), com::sleepycat::collections::RangeCursor::getNextDup(), com::sleepycat::collections::RangeCursor::getSearchBoth(), com::sleepycat::collections::RangeCursor::getSearchKey(), com::sleepycat::collections::DataView::isSecondary(), com::sleepycat::collections::DataView::useKey(), and com::sleepycat::collections::DataView::useValue().

Referenced by com::sleepycat::collections::StoredEntrySet::contains(), find(), and com::sleepycat::collections::StoredEntrySet::remove().

OperationStatus com::sleepycat::collections::DataCursor::getSearchKey Object  key,
Object  value,
boolean  lockForWrite
throws DatabaseException [inline, package]
 

Binding version of Cursor.getSearchKey(), no join cursor allowed. Searches by record number in a BTREE-RECNO db with RECNO access.

Definition at line 374 of file DataCursor.java.

References com::sleepycat::collections::DataView::useKey().

Referenced by com::sleepycat::collections::StoredList::add(), com::sleepycat::collections::StoredList::addAll(), and com::sleepycat::collections::DataView::join().

OperationStatus com::sleepycat::collections::DataCursor::getSearchKeyRange Object  key,
Object  value,
boolean  lockForWrite
throws DatabaseException [inline, package]
 

Binding version of Cursor.getSearchKeyRange(), no join cursor allowed.

Definition at line 406 of file DataCursor.java.

References getLockMode(), com::sleepycat::collections::RangeCursor::getSearchKeyRange(), and com::sleepycat::collections::DataView::useKey().

DataView com::sleepycat::collections::DataCursor::getView  )  [inline, package]
 

Returns the view for this cursor.

Definition at line 188 of file DataCursor.java.

boolean com::sleepycat::collections::DataCursor::hasRecNumAccess  )  [inline, package]
 

Returns whether record number access is allowed.

Definition at line 234 of file DataCursor.java.

References com::sleepycat::collections::DataView::recNumAccess.

boolean com::sleepycat::collections::DataCursor::isWriteAllowed  )  [inline, package]
 

Returns whether write is allowed for this cursor, as specified to the constructor.

Definition at line 205 of file DataCursor.java.

OperationStatus com::sleepycat::collections::DataCursor::put Object  key,
Object  value,
Object[]  oldValue,
boolean  useCurrentKey
throws DatabaseException [inline, package]
 

Binding version of Cursor.put(), optionally returning the old value and optionally using the current key instead of the key parameter.

Definition at line 555 of file DataCursor.java.

References com::sleepycat::collections::RangeCursor::put().

OperationStatus com::sleepycat::collections::DataCursor::putAfter Object  value  )  throws DatabaseException [inline, package]
 

Binding version of Cursor.putAfter().

Definition at line 532 of file DataCursor.java.

References com::sleepycat::collections::RangeCursor::putAfter(), and com::sleepycat::collections::DataView::useValue().

Referenced by com::sleepycat::collections::StoredIterator::add().

OperationStatus com::sleepycat::collections::DataCursor::putBefore Object  value  )  throws DatabaseException [inline, package]
 

Binding version of Cursor.putBefore().

Definition at line 543 of file DataCursor.java.

References com::sleepycat::collections::RangeCursor::putBefore(), and com::sleepycat::collections::DataView::useValue().

Referenced by com::sleepycat::collections::StoredList::add(), com::sleepycat::collections::StoredIterator::add(), and com::sleepycat::collections::StoredList::addAll().

OperationStatus com::sleepycat::collections::DataCursor::putCurrent Object  value  )  throws DatabaseException [inline, package]
 

Binding version of Cursor.putCurrent().

Definition at line 501 of file DataCursor.java.

References com::sleepycat::collections::DataView::dupsOrdered, com::sleepycat::collections::RangeCursor::getCurrent(), com::sleepycat::collections::DataView::ordered, com::sleepycat::collections::RangeCursor::putCurrent(), and com::sleepycat::collections::DataView::useValue().

Referenced by com::sleepycat::collections::StoredIterator::set().

OperationStatus com::sleepycat::collections::DataCursor::putNoDupData Object  key,
Object  value,
Object[]  oldValue,
boolean  useCurrentKey
throws DatabaseException [inline, package]
 

Binding version of Cursor.putNoDupData(), optionally returning the old value and optionally using the current key instead of the key parameter.

Definition at line 579 of file DataCursor.java.

References com::sleepycat::collections::DataView::dupsAllowed, com::sleepycat::collections::DataView::dupsOrdered, getLockMode(), com::sleepycat::collections::RangeCursor::getSearchBoth(), com::sleepycat::collections::RangeCursor::put(), com::sleepycat::collections::RangeCursor::putNoDupData(), and com::sleepycat::collections::RangeCursor::putNoOverwrite().

Referenced by com::sleepycat::collections::StoredValueSet::add(), and com::sleepycat::collections::StoredIterator::add().

OperationStatus com::sleepycat::collections::DataCursor::putNoOverwrite Object  key,
Object  value,
boolean  useCurrentKey
throws DatabaseException [inline, package]
 

Binding version of Cursor.putNoOverwrite(), optionally using the current key instead of the key parameter.

Definition at line 567 of file DataCursor.java.

References com::sleepycat::collections::RangeCursor::putNoOverwrite().

Referenced by com::sleepycat::collections::StoredKeySet::add().

void com::sleepycat::collections::DataCursor::useRangeKey  )  [inline, package]
 

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.

Definition at line 632 of file DataCursor.java.

References com::sleepycat::collections::KeyRange::beginKey, and com::sleepycat::collections::KeyRange::singleKey.

Referenced by com::sleepycat::collections::StoredValueSet::add().


The documentation for this class was generated from the following file:
Generated on Sun Dec 25 12:15:00 2005 for Berkeley DB 4.4.16 by  doxygen 1.4.2