public abstract class StoredContainer
extends java.lang.Object
implements java.lang.Cloneable
Collection
and the Map
interfaces, namely
clear()
, isEmpty()
and size()
.
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.
Constructor and Description |
---|
StoredContainer(DataView view) |
Modifier and Type | Method and Description |
---|---|
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 |
areKeyRangesAllowed()
Returns whether key ranges are allowed in this container.
|
boolean |
areKeysRenumbered()
Returns whether keys are renumbered when insertions and deletions occur.
|
(package private) boolean |
beginAutoCommit() |
void |
clear()
Removes all mappings or elements from this map or collection (optional
operation).
|
(package private) void |
closeCursor(DataCursor cursor) |
(package private) void |
commitAutoCommit(boolean doAutoCommit) |
(package private) StoredContainer |
configuredClone(CursorConfig config)
Clones a container with a specified cursor configuration.
|
(package private) boolean |
containsKey(java.lang.Object key) |
(package private) boolean |
containsValue(java.lang.Object value) |
(package private) static java.lang.RuntimeException |
convertException(java.lang.Exception e) |
CursorConfig |
getCursorConfig()
Returns the cursor configuration that is used for all operations
performed via this container.
|
(package private) java.lang.Object |
getValue(java.lang.Object key) |
(package private) java.lang.RuntimeException |
handleException(java.lang.Exception e,
boolean doAutoCommit) |
(package private) void |
initAfterClone()
Override this method to initialize view-dependent fields.
|
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.
|
(package private) java.lang.Object |
putKeyValue(java.lang.Object key,
java.lang.Object value) |
(package private) boolean |
removeKey(java.lang.Object key,
java.lang.Object[] oldVal) |
(package private) boolean |
removeValue(java.lang.Object value) |
abstract int |
size()
Returns a non-transactional count of the records in the collection or
map.
|
(package private) java.util.Iterator |
storedOrExternalIterator(java.util.Collection coll)
Returns a StoredIterator if the given collection is a StoredCollection,
else returns a regular/external Iterator.
|
DataView view
StoredContainer(DataView view)
public final boolean isWriteAllowed()
Map
or
Collection
interfaces.public final CursorConfig getCursorConfig()
CursorConfig.getReadUncommitted
returns
true, data will be read that is modified but not committed.
This method does not exist in the standard Map
or
Collection
interfaces.public final boolean isTransactional()
Map
or
Collection
interfaces.final StoredContainer configuredClone(CursorConfig config)
void initAfterClone()
public final boolean areDuplicatesAllowed()
Map
or
Collection
interfaces.
Note that the JE product only supports BTREE databases.
public final boolean areDuplicatesOrdered()
Map
or
Collection
interfaces.
Note that the JE product only supports BTREE databases, and duplicates are always sorted.
public final boolean areKeysRenumbered()
Map
or
Collection
interfaces.
Note that the JE product does not support RECNO databases, and therefore keys are never renumbered.
public final boolean isOrdered()
Map
or
Collection
interfaces.
Note that the JE product only support BTREE databases, and therefore keys are always ordered.
public final boolean areKeyRangesAllowed()
Map
or
Collection
interfaces.
Note that the JE product only supports BTREE databases, and therefore key ranges are always allowed.
public final boolean isSecondary()
Map
or
Collection
interfaces.public abstract int size()
Collection.size()
and
Map.size()
interfaces.
This operation is faster than obtaining a count by scanning the collection manually, and will not perturb the current contents of the cache. However, the count is not guaranteed to be accurate if there are concurrent updates.
OperationFailureException
- if one of the Read Operation
Failures occurs.EnvironmentFailureException
- if an unexpected, internal or
environment-wide failure occurs.
RuntimeExceptionWrapper
- if a checked exception is thrown,
including a DatabaseException
on BDB (C edition).public boolean isEmpty()
Collection.isEmpty()
and
Map.isEmpty()
interfaces.OperationFailureException
- if one of the Read Operation
Failures occurs.EnvironmentFailureException
- if an unexpected, internal or
environment-wide failure occurs.
RuntimeExceptionWrapper
- if a checked exception is thrown,
including a DatabaseException
on BDB (C edition).public void clear()
Collection.clear()
and
Map.clear()
interfaces.
OperationFailureException
- if one of the Write
Operation Failures occurs.EnvironmentFailureException
- if an unexpected, internal or
environment-wide failure occurs.
java.lang.UnsupportedOperationException
- if the container is read-only.RuntimeExceptionWrapper
- if a checked exception is thrown,
including a DatabaseException
on BDB (C edition).java.lang.Object getValue(java.lang.Object key)
java.lang.Object putKeyValue(java.lang.Object key, java.lang.Object value)
final boolean removeKey(java.lang.Object key, java.lang.Object[] oldVal)
boolean containsKey(java.lang.Object key)
final boolean removeValue(java.lang.Object value)
boolean containsValue(java.lang.Object value)
final java.util.Iterator storedOrExternalIterator(java.util.Collection coll)
final void closeCursor(DataCursor cursor)
final boolean beginAutoCommit()
final void commitAutoCommit(boolean doAutoCommit) throws DatabaseException
DatabaseException
final java.lang.RuntimeException handleException(java.lang.Exception e, boolean doAutoCommit)
static java.lang.RuntimeException convertException(java.lang.Exception e)
Copyright (c) 2004-2012 Oracle. All rights reserved.