com.sleepycat.collections
Class StoredValueSet<E>
java.lang.Object
com.sleepycat.collections.StoredContainer
com.sleepycat.collections.StoredCollection<E>
com.sleepycat.collections.StoredValueSet<E>
- All Implemented Interfaces:
- Cloneable, Iterable<E>, Collection<E>, Set<E>
- Direct Known Subclasses:
- StoredSortedValueSet
public class StoredValueSet<E>
- extends StoredCollection<E>
- implements Set<E>
The Set returned by Map.values() and Map.duplicates(), and which can also be
constructed directly if a Map is not needed.
Although this collection is a set it may contain duplicate values. Only if
an entity value binding is used are all elements guaranteed to be unique.
- Author:
- Mark Hayes
Methods inherited from class com.sleepycat.collections.StoredCollection |
add, addAll, blockIterator, checkIterAddAllowed, containsAll, equals, getFirstOrLast, getIndexOffset, getIteratorBlockSize, hashCode, iterateDuplicates, iterator, iterator, join, makeIteratorData, removeAll, retainAll, setIteratorBlockSize, size, storedIterator, storedIterator, toArray, toArray, toList, toString |
Methods inherited from class com.sleepycat.collections.StoredContainer |
areDuplicatesAllowed, areDuplicatesOrdered, areKeyRangesAllowed, areKeysRenumbered, beginAutoCommit, clear, closeCursor, commitAutoCommit, configuredClone, containsKey, containsValue, convertException, getCursorConfig, getValue, handleException, initAfterClone, isEmpty, isOrdered, isSecondary, isTransactional, isWriteAllowed, putKeyValue, removeKey, removeValue, storedOrExternalIterator |
Methods inherited from interface java.util.Set |
addAll, clear, containsAll, equals, hashCode, isEmpty, iterator, removeAll, retainAll, size, toArray, toArray |
StoredValueSet
public StoredValueSet(Database database,
EntryBinding<E> valueBinding,
boolean writeAllowed)
- Creates a value set view of a
Database
.
- Parameters:
database
- is the Database underlying the new collection.valueBinding
- is the binding used to translate between value
buffers and value objects.writeAllowed
- is true to create a read-write collection or false
to create a read-only collection.
- Throws:
IllegalArgumentException
- if formats are not consistently
defined or a parameter is invalid.
RuntimeExceptionWrapper
- if a checked exception is thrown,
including a DatabaseException
on BDB (C Edition).
StoredValueSet
public StoredValueSet(Database database,
EntityBinding<E> valueEntityBinding,
boolean writeAllowed)
- Creates a value set entity view of a
Database
.
- Parameters:
database
- is the Database underlying the new collection.valueEntityBinding
- is the binding used to translate between
key/value buffers and entity value objects.writeAllowed
- is true to create a read-write collection or false
to create a read-only collection.
- Throws:
IllegalArgumentException
- if formats are not consistently
defined or a parameter is invalid.
RuntimeExceptionWrapper
- if a checked exception is thrown,
including a DatabaseException
on BDB (C Edition).
StoredValueSet
StoredValueSet(DataView valueSetView)
add
public boolean add(E entity)
- Adds the specified entity to this set if it is not already present
(optional operation).
This method conforms to the
Set.add(E)
interface.
- Specified by:
add
in interface Collection<E>
- Specified by:
add
in interface Set<E>
- Parameters:
entity
- is the entity to be added.
- Returns:
- true if the entity was added, that is the key-value pair
represented by the entity was not previously present in the collection.
- Throws:
OperationFailureException
- if one of the Write
Operation Failures occurs.
EnvironmentFailureException
- if an unexpected, internal or
environment-wide failure occurs.
UnsupportedOperationException
- if the collection is read-only,
if the collection is indexed, or if an entity binding is not used.
RuntimeExceptionWrapper
- if a checked exception is thrown,
including a DatabaseException
on BDB (C Edition).
contains
public boolean contains(Object value)
- Returns true if this set contains the specified element.
This method conforms to the
Set.contains(java.lang.Object)
interface.
- Specified by:
contains
in interface Collection<E>
- Specified by:
contains
in interface Set<E>
- Parameters:
value
- the value to check.
- Returns:
- whether the set contains the given value.
- Throws:
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).
remove
public boolean remove(Object value)
- Removes the specified value from this set if it is present (optional
operation).
If an entity binding is used, the key-value pair represented by the
given entity is removed. If an entity binding is used, the first
occurrence of a key-value pair with the given value is removed.
This method conforms to the
Set.remove(java.lang.Object)
interface.
- Specified by:
remove
in interface Collection<E>
- Specified by:
remove
in interface Set<E>
- Throws:
OperationFailureException
- if one of the Write
Operation Failures occurs.
EnvironmentFailureException
- if an unexpected, internal or
environment-wide failure occurs.
UnsupportedOperationException
- if the collection is read-only.
RuntimeExceptionWrapper
- if a checked exception is thrown,
including a DatabaseException
on BDB (C Edition).
makeIteratorData
E makeIteratorData(BaseIterator iterator,
DatabaseEntry keyEntry,
DatabaseEntry priKeyEntry,
DatabaseEntry valueEntry)
- Specified by:
makeIteratorData
in class StoredCollection<E>
hasValues
boolean hasValues()
- Specified by:
hasValues
in class StoredCollection<E>
Copyright (c) 2004-2010 Oracle. All rights reserved.