| |
|
| java.lang.Object com.sleepycat.collections.StoredContainer com.sleepycat.collections.StoredCollection
All known Subclasses: com.sleepycat.collections.StoredEntrySet, com.sleepycat.collections.StoredValueSet, com.sleepycat.collections.StoredKeySet, com.sleepycat.collections.StoredList,
StoredCollection | abstract public class StoredCollection extends StoredContainer implements Collection(Code) | | A abstract base class for all stored collections. This class, and its
base class
StoredContainer , provide implementations of most methods
in the
Collection interface. Other methods, such as
StoredCollection.add and
StoredCollection.remove , are provided by concrete classes that extend this
class.
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.
author: Mark Hayes |
addAll | public boolean addAll(Collection coll)(Code) | | Adds all of the elements in the specified collection to this collection
(optional operation).
This method calls the
StoredCollection.add(Object) method of the concrete
collection class, which may or may not be supported.
This method conforms to the
Collection.addAll interface.
throws: UnsupportedOperationException - if the collection is read-only, orif the collection is indexed, or if the add method is not supported bythe concrete collection. throws: RuntimeExceptionWrapper - if a DatabaseException isthrown. |
containsAll | public boolean containsAll(Collection coll)(Code) | | Returns true if this collection contains all of the elements in the
specified collection.
This method conforms to the
Collection.containsAll interface.
throws: RuntimeExceptionWrapper - if a DatabaseException isthrown. |
equals | public boolean equals(Object other)(Code) | | Compares the specified object with this collection for equality.
A value comparison is performed by this method and the stored values
are compared rather than calling the equals() method of each element.
This method conforms to the
Collection.equals interface.
throws: RuntimeExceptionWrapper - if a DatabaseException isthrown. |
getFirstOrLast | final Object getFirstOrLast(boolean doGetFirst)(Code) | | |
getIndexOffset | int getIndexOffset()(Code) | | |
hasValues | abstract boolean hasValues()(Code) | | |
hashCode | public int hashCode()(Code) | | |
iterateDuplicates | boolean iterateDuplicates()(Code) | | |
iterator | public Iterator iterator()(Code) | | Returns an iterator over the elements in this collection.
The iterator will be read-only if the collection is read-only.
This method conforms to the
Collection.iterator interface.
The iterator returned by this method does not keep a database cursor
open and therefore it does not need to be closed. It reads blocks of
records as needed, opening and closing a cursor to read each block of
records. The number of records per block is 10 by default and can be
changed with
StoredCollection.setIteratorBlockSize .
Because this iterator does not keep a cursor open, if it is used
without transactions, the iterator does not have cursor
stability characteristics. In other words, the record at the
current iterator position can be changed or deleted by another thread.
To prevent this from happening, call this method within a transaction or
use the
StoredCollection.storedIterator() method instead.
a standard Iterator for this collection. See Also: StoredCollection.isWriteAllowed |
join | public StoredIterator join(StoredContainer[] indices, Object[] indexKeys, JoinConfig joinConfig)(Code) | | Returns an iterator representing an equality join of the indices and
index key values specified.
This method does not exist in the standard
Collection interface.
Warning: The iterator returned must be explicitly
closed using
StoredIterator.close or
StoredIterator.close(java.util.Iterator) to release the underlying
database cursor resources.
The returned iterator supports only the two methods: hasNext() and
next(). All other methods will throw UnsupportedOperationException.
Parameters: indices - is an array of indices with elements corresponding tothose in the indexKeys array. Parameters: indexKeys - is an array of index key values identifying theelements to be selected. Parameters: joinConfig - is the join configuration, or null to use thedefault configuration. an iterator over the elements in this collection that matchall specified index key values. throws: IllegalArgumentException - if this collection is indexed or if agiven index does not have the same store as this collection. throws: RuntimeExceptionWrapper - if a DatabaseException isthrown. |
storedIterator | public StoredIterator storedIterator()(Code) | | Returns an iterator over the elements in this collection.
The iterator will be read-only if the collection is read-only.
This method does not exist in the standard
Collection interface.
If
Iterater.set or
Iterator.remove will be called
and the underlying Database is transactional, then a transaction must be
active when calling this method and must remain active while using the
iterator.
Warning: The iterator returned must be explicitly
closed using
StoredIterator.close or
StoredIterator.close(java.util.Iterator) to release the underlying
database cursor resources.
a StoredIterator for this collection. See Also: StoredCollection.isWriteAllowed |
storedIterator | public StoredIterator storedIterator(boolean writeAllowed)(Code) | | Returns a read or read-write iterator over the elements in this
collection.
This method does not exist in the standard
Collection interface.
If
Iterater.set or
Iterator.remove will be called
and the underlying Database is transactional, then a transaction must be
active when calling this method and must remain active while using the
iterator.
Warning: The iterator returned must be explicitly
closed using
StoredIterator.close or
StoredIterator.close(java.util.Iterator) to release the underlying
database cursor resources.
Parameters: writeAllowed - is true to open a read-write iterator or false toopen a read-only iterator. If the collection is read-only the iteratorwill always be read-only. a StoredIterator for this collection. throws: IllegalStateException - if writeAllowed is true but the collectionis read-only. throws: RuntimeExceptionWrapper - if a DatabaseException isthrown. See Also: StoredCollection.isWriteAllowed |
toString | public String toString()(Code) | | Converts the collection to a string representation for debugging.
WARNING: The returned string may be very large.
the string representation. throws: RuntimeExceptionWrapper - if a DatabaseException isthrown. |
|
|
|