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

com::sleepycat::collections::DataView Class Reference


Package Functions

 DataView (Database database, EntryBinding keyBinding, EntryBinding valueBinding, EntityBinding entityBinding, boolean writeAllowed, PrimaryKeyAssigner keyAssigner) throws IllegalArgumentException
DataView keySetView ()
DataView valueSetView ()
DataView valueSetView (Object singleKey) throws DatabaseException, KeyRangeException
DataView subView (Object beginKey, boolean beginInclusive, Object endKey, boolean endInclusive, EntryBinding keyBinding) throws DatabaseException, KeyRangeException
DataView configuredView (CursorConfig config)
CurrentTransaction getCurrentTxn ()
DatabaseEntry getSingleKeyThang ()
final Environment getEnv ()
final boolean isSecondary ()
boolean isEmpty () throws DatabaseException
OperationStatus append (Object value, Object[] retPrimaryKey, Object[] retValue) throws DatabaseException
Transaction useTransaction ()
void clear () throws DatabaseException
DataCursor join (DataView[] indexViews, Object[] indexKeys, JoinConfig joinConfig) throws DatabaseException
DataCursor join (DataCursor[] indexCursors, JoinConfig joinConfig) throws DatabaseException
boolean useKey (Object key, Object value, DatabaseEntry keyThang, KeyRange checkRange) throws DatabaseException
final boolean canDeriveKeyFromValue ()
void useValue (Object value, DatabaseEntry valueThang, DatabaseEntry checkKeyThang) throws DatabaseException
Object makeKey (DatabaseEntry keyThang) throws DatabaseException
Object makeValue (DatabaseEntry primaryKeyThang, DatabaseEntry valueThang) throws DatabaseException
KeyRange subRange (Object singleKey) throws DatabaseException, KeyRangeException
KeyRange subRange (Object beginKey, boolean beginInclusive, Object endKey, boolean endInclusive) throws DatabaseException, KeyRangeException

Detailed Description

Represents a Berkeley DB database and adds support for indices, bindings and key ranges.

This class defines 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 38 of file DataView.java.


Constructor & Destructor Documentation

com::sleepycat::collections::DataView::DataView Database  database,
EntryBinding  keyBinding,
EntryBinding  valueBinding,
EntityBinding  entityBinding,
boolean  writeAllowed,
PrimaryKeyAssigner  keyAssigner
throws IllegalArgumentException [inline, package]
 

Creates a view for a given database and bindings. The initial key range of the view will be open.

Definition at line 67 of file DataView.java.

References com::sleepycat::collections::CurrentTransaction::getInstanceInternal(), and com::sleepycat::collections::CurrentTransaction::isTxnMode().


Member Function Documentation

OperationStatus com::sleepycat::collections::DataView::append Object  value,
Object[]  retPrimaryKey,
Object[]  retValue
throws DatabaseException [inline, package]
 

Appends a value and returns the new key. If a key assigner is used it assigns the key, otherwise a QUEUE or RECNO database is required.

Definition at line 289 of file DataView.java.

References com::sleepycat::collections::PrimaryKeyAssigner::assignKey(), com::sleepycat::collections::KeyRange::check(), com::sleepycat::collections::DataCursor::close(), com::sleepycat::collections::DataCursor::getCursor(), com::sleepycat::collections::CurrentTransaction::isCDBCursorOpen(), useTransaction(), and useValue().

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

final boolean com::sleepycat::collections::DataView::canDeriveKeyFromValue  )  [inline, package]
 

Returns whether data keys can be derived from the value/entity binding of this view, which determines whether a value/entity object alone is sufficient for operations that require keys.

Definition at line 487 of file DataView.java.

void com::sleepycat::collections::DataView::clear  )  throws DatabaseException [inline, package]
 

Deletes all records in the current range.

Definition at line 349 of file DataView.java.

References com::sleepycat::collections::DataCursor::close(), com::sleepycat::collections::DataCursor::delete(), com::sleepycat::collections::DataCursor::getFirst(), and com::sleepycat::collections::DataCursor::getNext().

Referenced by com::sleepycat::collections::StoredContainer::clear().

DataView com::sleepycat::collections::DataView::configuredView CursorConfig  config  )  [inline, package]
 

Returns a new view with a specified cursor configuration.

Definition at line 218 of file DataView.java.

References cursorConfig.

Referenced by com::sleepycat::collections::StoredContainer::configuredClone().

CurrentTransaction com::sleepycat::collections::DataView::getCurrentTxn  )  [inline, package]
 

Returns the current transaction for the view or null if the environment is non-transactional.

Definition at line 230 of file DataView.java.

final Environment com::sleepycat::collections::DataView::getEnv  )  [inline, package]
 

Returns the environment for the database.

Definition at line 257 of file DataView.java.

References com::sleepycat::collections::CurrentTransaction::getEnvironment().

DatabaseEntry com::sleepycat::collections::DataView::getSingleKeyThang  )  [inline, package]
 

Returns the key thang for a single key range, or null if a single key range is not used.

Definition at line 249 of file DataView.java.

References com::sleepycat::collections::KeyRange::getSingleKey().

boolean com::sleepycat::collections::DataView::isEmpty  )  throws DatabaseException [inline, package]
 

Returns whether no records are present in the view.

Definition at line 274 of file DataView.java.

References com::sleepycat::collections::DataCursor::close(), and com::sleepycat::collections::DataCursor::getFirst().

Referenced by com::sleepycat::collections::StoredContainer::isEmpty().

final boolean com::sleepycat::collections::DataView::isSecondary  )  [inline, package]
 

Returns whether this is a view on a secondary database rather than directly on a primary database.

Definition at line 266 of file DataView.java.

Referenced by com::sleepycat::collections::StoredValueSet::add(), com::sleepycat::collections::DataCursor::DataCursor(), com::sleepycat::collections::DataCursor::find(), com::sleepycat::collections::DataCursor::getSearchBoth(), com::sleepycat::collections::StoredContainer::isSecondary(), and useKey().

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

Returns a cursor for this view that reads only records having the index key values at the specified cursors.

Definition at line 406 of file DataView.java.

DataCursor com::sleepycat::collections::DataView::join DataView[]  indexViews,
Object[]  indexKeys,
JoinConfig  joinConfig
throws DatabaseException [inline, package]
 

Returns a cursor for this view that reads only records having the specified index key values.

Definition at line 374 of file DataView.java.

References com::sleepycat::collections::DataCursor::close(), and com::sleepycat::collections::DataCursor::getSearchKey().

Referenced by com::sleepycat::collections::StoredCollection::join().

DataView com::sleepycat::collections::DataView::keySetView  )  [inline, package]
 

Return a new key-set view derived from this view by setting the entity and value binding to null.

Returns:
the derived view.

Definition at line 147 of file DataView.java.

References entityBinding, and valueBinding.

Object com::sleepycat::collections::DataView::makeKey DatabaseEntry  keyThang  )  throws DatabaseException [inline, package]
 

Converts a key entry to a key object.

Definition at line 527 of file DataView.java.

References com::sleepycat::bind::EntryBinding::entryToObject().

Referenced by com::sleepycat::collections::DataCursor::getCurrentKey().

Object com::sleepycat::collections::DataView::makeValue DatabaseEntry  primaryKeyThang,
DatabaseEntry  valueThang
throws DatabaseException [inline, package]
 

Converts a key-value entry pair to a value object.

Definition at line 537 of file DataView.java.

References com::sleepycat::bind::EntityBinding::entryToObject(), and com::sleepycat::bind::EntryBinding::entryToObject().

Referenced by com::sleepycat::collections::DataCursor::getCurrentValue().

KeyRange com::sleepycat::collections::DataView::subRange Object  beginKey,
boolean  beginInclusive,
Object  endKey,
boolean  endInclusive
throws DatabaseException, KeyRangeException [inline, package]
 

Intersects the given range and the current range.

Definition at line 565 of file DataView.java.

References com::sleepycat::collections::KeyRange::subRange(), and subRange().

KeyRange com::sleepycat::collections::DataView::subRange Object  singleKey  )  throws DatabaseException, KeyRangeException [inline, package]
 

Intersects the given key and the current range.

Definition at line 556 of file DataView.java.

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

Referenced by com::sleepycat::collections::DataCursor::DataCursor(), subRange(), and valueSetView().

DataView com::sleepycat::collections::DataView::subView Object  beginKey,
boolean  beginInclusive,
Object  endKey,
boolean  endInclusive,
EntryBinding  keyBinding
throws DatabaseException, KeyRangeException [inline, package]
 

Return a new value-set view for key range, optionally changing the key binding.

Definition at line 204 of file DataView.java.

References keyBinding, and setRange().

Referenced by com::sleepycat::collections::StoredList::subList(), com::sleepycat::collections::StoredSortedMap::subMap(), com::sleepycat::collections::StoredSortedValueSet::subSet(), com::sleepycat::collections::StoredSortedKeySet::subSet(), and com::sleepycat::collections::StoredSortedEntrySet::subSet().

boolean com::sleepycat::collections::DataView::useKey Object  key,
Object  value,
DatabaseEntry  keyThang,
KeyRange  checkRange
throws DatabaseException [inline, package]
 

Populates the key entry and returns whether the key is within range.

Definition at line 443 of file DataView.java.

References isSecondary(), com::sleepycat::bind::EntityBinding::objectToData(), com::sleepycat::bind::EntryBinding::objectToEntry(), and com::sleepycat::bind::EntityBinding::objectToKey().

Referenced by com::sleepycat::collections::DataCursor::getSearchBoth(), com::sleepycat::collections::DataCursor::getSearchKey(), and com::sleepycat::collections::DataCursor::getSearchKeyRange().

Transaction com::sleepycat::collections::DataView::useTransaction  )  [inline, package]
 

Returns the current transaction if the database is transaction, or null if the database is not transactional or there is no current transaction.

Definition at line 342 of file DataView.java.

References com::sleepycat::collections::CurrentTransaction::getTransaction().

Referenced by append().

void com::sleepycat::collections::DataView::useValue Object  value,
DatabaseEntry  valueThang,
DatabaseEntry  checkKeyThang
throws DatabaseException [inline, package]
 

Populates the value entry and throws an exception if the primary key would be changed via an entity binding.

Definition at line 496 of file DataView.java.

References com::sleepycat::bind::EntityBinding::objectToData(), com::sleepycat::bind::EntryBinding::objectToEntry(), and com::sleepycat::bind::EntityBinding::objectToKey().

Referenced by append(), com::sleepycat::collections::DataCursor::find(), com::sleepycat::collections::DataCursor::getSearchBoth(), com::sleepycat::collections::DataCursor::putAfter(), com::sleepycat::collections::DataCursor::putBefore(), and com::sleepycat::collections::DataCursor::putCurrent().

DataView com::sleepycat::collections::DataView::valueSetView Object  singleKey  )  throws DatabaseException, KeyRangeException [inline, package]
 

Return a new value-set view for single key range.

Parameters:
singleKey the single key value.
Returns:
the derived view.
Exceptions:
DatabaseException if a database problem occurs.
KeyRangeException if the specified range is not within the current range.

Definition at line 187 of file DataView.java.

References range, subRange(), and valueSetView().

DataView com::sleepycat::collections::DataView::valueSetView  )  [inline, package]
 

Return a new value-set view derived from this view by setting the key binding to null.

Returns:
the derived view.

Definition at line 164 of file DataView.java.

References keyBinding.

Referenced by com::sleepycat::collections::StoredMap::duplicates(), and valueSetView().


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