|
Berkeley DB version 4.2.52 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sleepycat.bdb.collection.StoredContainer | +--com.sleepycat.bdb.collection.StoredCollection
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 Collection.add(java.lang.Object)
and Collection.remove(java.lang.Object)
, 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.
iterator(boolean)
join(StoredContainer[], Object[])
join(StoredContainer[], Object[], boolean)
toList()
Method Summary | |
boolean |
addAll(Collection coll)
Adds all of the elements in the specified collection to this collection (optional operation). |
boolean |
containsAll(Collection coll)
Returns true if this collection contains all of the elements in the specified collection. |
boolean |
equals(Object other)
Compares the specified object with this collection for equality. |
Iterator |
iterator()
Returns an iterator over the elements in this collection. |
StoredIterator |
iterator(boolean writeAllowed)
Returns a read or read-write iterator over the elements in this collection. |
StoredIterator |
join(StoredContainer[] indices,
Object[] indexKeys)
Returns an iterator representing an equality join of the indices and index key values specified. |
StoredIterator |
join(StoredContainer[] indices,
Object[] indexKeys,
boolean presorted)
Returns an iterator representing an equality join of the indices and index key values specified. |
boolean |
removeAll(Collection coll)
Removes all this collection's elements that are also contained in the specified collection (optional operation). |
boolean |
retainAll(Collection coll)
Retains only the elements in this collection that are contained in the specified collection (optional operation). |
Object[] |
toArray()
Returns an array of all the elements in this collection. |
Object[] |
toArray(Object[] a)
Returns an array of all the elements in this collection whose runtime type is that of the specified array. |
List |
toList()
Returns a copy of this collection as an ArrayList. |
String |
toString()
Converts the collection to a string representation for debugging. |
Methods inherited from class com.sleepycat.bdb.collection.StoredContainer |
areDuplicatesAllowed, areDuplicatesOrdered, areKeysRenumbered, clear, isAutoCommit, isDirtyReadAllowed, isDirtyReadEnabled, isEmpty, isIndexed, isOrdered, isTransactional, isWriteAllowed, size |
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Collection |
add, clear, contains, hashCode, isEmpty, remove, size |
Method Detail |
public Iterator iterator()
Collection.iterator()
interface.
iterator
in interface Collection
StoredIterator
for this collection.
RuntimeExceptionWrapper
- if a DbException
is thrown.StoredContainer.isWriteAllowed()
public StoredIterator iterator(boolean writeAllowed)
Collection
interface.
writeAllowed
- is true to open a read-write iterator or false to
open a read-only iterator. If the collection is read-only the iterator
will always be read-only.
StoredIterator
for this collection.
IllegalStateException
- if writeAllowed is true but the collection
is read-only.
RuntimeExceptionWrapper
- if a DbException
is thrown.StoredContainer.isWriteAllowed()
public Object[] toArray()
Collection.toArray()
interface.
toArray
in interface Collection
RuntimeExceptionWrapper
- if a DbException
is thrown.public Object[] toArray(Object[] a)
Collection.toArray(Object[])
interface.
toArray
in interface Collection
RuntimeExceptionWrapper
- if a DbException
is thrown.public boolean containsAll(Collection coll)
Collection.containsAll(java.util.Collection)
interface.
containsAll
in interface Collection
RuntimeExceptionWrapper
- if a DbException
is thrown.public boolean addAll(Collection coll)
Collection.add(Object)
method of the concrete
collection class, which may or may not be supported.
This method conforms to the Collection.addAll(java.util.Collection)
interface.
addAll
in interface Collection
UnsupportedOperationException
- if the collection is read-only, or
if the collection is indexed, or if the add method is not supported by
the concrete collection.
RuntimeExceptionWrapper
- if a DbException
is thrown.public boolean removeAll(Collection coll)
Collection.removeAll(java.util.Collection)
interface.
removeAll
in interface Collection
UnsupportedOperationException
- if the collection is read-only.
RuntimeExceptionWrapper
- if a DbException
is thrown.public boolean retainAll(Collection coll)
Collection.removeAll(java.util.Collection)
interface.
retainAll
in interface Collection
UnsupportedOperationException
- if the collection is read-only.
RuntimeExceptionWrapper
- if a DbException
is thrown.public boolean equals(Object other)
Collection.equals(java.lang.Object)
interface.
equals
in interface Collection
equals
in class Object
RuntimeExceptionWrapper
- if a DbException
is thrown.public List toList()
toArray()
but returns a collection instead of an array.
ArrayList
containing a copy of all elements in this
collection.
RuntimeExceptionWrapper
- if a DbException
is thrown.public String toString()
toString
in class Object
RuntimeExceptionWrapper
- if a DbException
is thrown.public StoredIterator join(StoredContainer[] indices, Object[] indexKeys)
Collection
interface.
The returned iterator supports only the two methods: hasNext() and next(). All other methods will throw UnsupportedOperationException.
indices
- is an array of indices with elements corresponding to
those in the indexKeys array.indexKeys
- is an array of index key values identifying the
elements to be selected.
IllegalArgumentException
- if this collection is indexed or if a
given index does not have the same store as this collection.
RuntimeExceptionWrapper
- if a DbException
is thrown.public StoredIterator join(StoredContainer[] indices, Object[] indexKeys, boolean presorted)
Collection
interface.
The returned iterator supports only the two methods: hasNext() and next(). All other methods will throw UnsupportedOperationException.
indices
- is an array of indices with elements corresponding to
those in the indexKeys array.indexKeys
- is an array of index key values identifying the
elements to be selected.presorted
- is true if the index order should not be changed, or
false to use the default sorting by least number of references.
IllegalArgumentException
- if this collection is indexed or if a
given index does not have the same store as this collection.
RuntimeExceptionWrapper
- if a DbException
is thrown.
|
Berkeley DB version 4.2.52 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |