|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sleepycat.collections.StoredContainer
A abstract base class for all stored collections and maps. This class
provides implementations of methods that are common to the Collection
and the Map
interfaces, namely
clear()
, isEmpty()
and size()
.
Note that this class does not conform to the standard Java collections interface in the following ways:
size()
method always throws
UnsupportedOperationException
because, for performance reasons,
databases do not maintain their total record count.StoredIterator.close()
or StoredIterator.close(java.util.Iterator)
to release the underlying database cursor resources.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.
isWriteAllowed()
isSecondary()
isOrdered()
areDuplicatesAllowed()
areDuplicatesOrdered()
areKeysRenumbered()
isDirtyReadAllowed()
isDirtyRead()
isTransactional()
Field Summary | |
(package private) DataView |
view
|
Constructor Summary | |
(package private) |
StoredContainer(DataView view)
|
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. |
(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) boolean |
containsKey(Object key)
|
(package private) boolean |
containsValue(Object value)
|
(package private) static RuntimeException |
convertException(Exception e)
|
(package private) StoredContainer |
dirtyReadClone()
Clones and enables dirty-read in the clone. |
(package private) Object |
get(Object key)
|
(package private) RuntimeException |
handleException(Exception e,
boolean doAutoCommit)
|
boolean |
isDirtyRead()
Returns whether dirty-read is enabled for this container. |
boolean |
isDirtyReadAllowed()
Returns whether dirty-read 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. |
(package private) Object |
put(Object key,
Object value)
|
(package private) boolean |
removeKey(Object key,
Object[] oldVal)
|
(package private) boolean |
removeValue(Object value)
|
int |
size()
Always throws UnsupportedOperationException. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
DataView view
Constructor Detail |
StoredContainer(DataView view)
Method Detail |
public final boolean isWriteAllowed()
Map
or
Collection
interfaces.
public final boolean isDirtyReadAllowed()
StoredCollections
methods.
This method does not exist in the standard Map
or
Collection
interfaces.
public final boolean isDirtyRead()
isDirtyReadAllowed()
returns
false.
This method does not exist in the standard Map
or
Collection
interfaces.
public final boolean isTransactional()
Map
or
Collection
interfaces.
final StoredContainer dirtyReadClone()
public final boolean areDuplicatesAllowed()
Map
or
Collection
interfaces.
public final boolean areDuplicatesOrdered()
Map
or
Collection
interfaces.
public final boolean areKeysRenumbered()
Map
or
Collection
interfaces.
public final boolean isOrdered()
Map
or
Collection
interfaces.
public final boolean isSecondary()
Map
or
Collection
interfaces.
public int size()
Collection.size()
and
Map.size()
interfaces.
UnsupportedOperationException
- unconditionally.public boolean isEmpty()
Collection.isEmpty()
and
Map.isEmpty()
interfaces.
RuntimeExceptionWrapper
- if a DatabaseException
is thrown.public void clear()
Collection.clear()
and
Map.clear()
interfaces.
UnsupportedOperationException
- if the container is read-only.
RuntimeExceptionWrapper
- if a DatabaseException
is thrown.Object get(Object key)
Object put(Object key, Object value)
final boolean removeKey(Object key, Object[] oldVal)
boolean containsKey(Object key)
final boolean removeValue(Object value)
boolean containsValue(Object value)
final void closeCursor(DataCursor cursor)
final boolean beginAutoCommit()
final void commitAutoCommit(boolean doAutoCommit) throws DatabaseException
DatabaseException
final RuntimeException handleException(Exception e, boolean doAutoCommit)
static RuntimeException convertException(Exception e)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |