com.sleepycat.collections
public abstract class StoredContainer extends Object implements Cloneable
In addition, this class provides the following methods for stored collections only. Note that the use of these methods is not compatible with the standard Java collections interface.
Method Summary | |
---|---|
boolean | areDuplicatesAllowed()
Returns whether duplicate keys are allowed in this container.
|
boolean | areDuplicatesOrdered()
Returns whether duplicate keys are allowed and sorted by element value.
|
boolean | areKeysRenumbered()
Returns whether keys are renumbered when insertions and deletions occur.
|
void | clear()
Removes all mappings or elements from this map or collection (optional
operation).
|
CursorConfig | getCursorConfig()
Returns the cursor configuration that is used for all operations
performed via this container.
|
boolean | isDirtyRead() |
boolean | isDirtyReadAllowed()
Returns whether read-uncommitted is allowed for this container.
|
boolean | isEmpty()
Returns true if this map or collection contains no mappings or elements.
|
boolean | isOrdered()
Returns whether keys are ordered in this container.
|
boolean | isSecondary()
Returns whether this container is a view on a secondary database rather
than directly on a primary database.
|
boolean | isTransactional()
Returns whether the databases underlying this container are
transactional.
|
boolean | isWriteAllowed()
Returns true if this is a read-write container or false if this is a
read-only container.
|
abstract int | size()
Returns the number of records in the collection or map.
|
Note that the JE product only supports BTREE databases.
Returns: whether duplicates are allowed.
Note that the JE product only supports BTREE databases, and duplicates are always sorted.
Returns: whether duplicates are ordered.
Note that the JE product does not support RECNO databases, and therefore keys are never renumbered.
Returns: whether keys are renumbered.
Throws: UnsupportedOperationException if the container is read-only. RuntimeExceptionWrapper if a DatabaseException is thrown.
CursorConfig.getReadUncommitted
returns
true, data will be read that is modified but not committed.
This method does not exist in the standard java.util.Map or
java.util.Collection interfaces.
Returns: the cursor configuration, or null if no configuration has been specified.
Deprecated: This method has been replaced by StoredContainer.
CursorConfig.isReadUncommitted
may be called to determine
whether dirty-read is enabled.
Deprecated: This method is deprecated with no replacement in this class.
In the DB product, DatabaseConfig.getReadUncommitted
may be
called.
Returns: whether read-uncommitted is allowed.
Returns: whether the container is empty.
Throws: RuntimeExceptionWrapper if a DatabaseException is thrown.
Note that the JE product only support BTREE databases, and therefore keys are always ordered.
Returns: whether keys are ordered.
Returns: whether the view is for a secondary database.
Returns: whether the database is transactional.
Returns: whether write is allowed.
Note that if other threads are adding or removing records while this method is executing, the size returned may be incorrect. This method does not lock the database.
Also note that, for a large database, this method may be expensive. All non-duplicate records in the database are enumerated by this method, bringing them into memory if they are not already cached.
Throws: RuntimeExceptionWrapper if a DatabaseException is thrown.