public class StoredKeySet<K> extends StoredCollection<K> implements java.util.Set<K>
DEFAULT_ITERATOR_BLOCK_SIZE
view
Constructor and Description |
---|
StoredKeySet(Database database,
EntryBinding<K> keyBinding,
boolean writeAllowed)
Creates a key set view of a
Database . |
StoredKeySet(DataView keySetView) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(K key)
Adds the specified key to this set if it is not already present
(optional operation).
|
boolean |
contains(java.lang.Object key)
Returns true if this set contains the specified key.
|
(package private) boolean |
hasValues() |
(package private) boolean |
iterateDuplicates() |
(package private) K |
makeIteratorData(BaseIterator iterator,
DatabaseEntry keyEntry,
DatabaseEntry priKeyEntry,
DatabaseEntry valueEntry) |
boolean |
remove(java.lang.Object key)
Removes the specified key from this set if it is present (optional
operation).
|
add, addAll, blockIterator, checkIterAddAllowed, containsAll, equals, getFirstOrLast, getIndexOffset, getIteratorBlockSize, hashCode, iterator, iterator, join, makeIteratorData, removeAll, retainAll, setIteratorBlockSize, size, storedIterator, storedIterator, toArray, toArray, toList, toString
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
public StoredKeySet(Database database, EntryBinding<K> keyBinding, boolean writeAllowed)
Database
.database
- is the Database underlying the new collection.keyBinding
- is the binding used to translate between key buffers
and key objects.writeAllowed
- is true to create a read-write collection or false
to create a read-only collection.java.lang.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).StoredKeySet(DataView keySetView)
public boolean add(K key)
Set.add(E)
interface.
WARNING: When a key is added the value in the underlying data store will be empty, i.e., the byte array will be zero length. Such a record cannot be accessed using the Map interface unless the value binding supports zero length byte arrays.
add
in interface java.util.Collection<K>
add
in interface java.util.Set<K>
OperationFailureException
- if one of the Write
Operation Failures occurs.EnvironmentFailureException
- if an unexpected, internal or
environment-wide failure occurs.
java.lang.UnsupportedOperationException
- if the collection is indexed, or
if the collection is read-only.RuntimeExceptionWrapper
- if a checked exception is thrown,
including a DatabaseException
on BDB (C Edition).public boolean remove(java.lang.Object key)
Set.remove(java.lang.Object)
interface.
remove
in interface java.util.Collection<K>
remove
in interface java.util.Set<K>
OperationFailureException
- if one of the Write
Operation Failures occurs.EnvironmentFailureException
- if an unexpected, internal or
environment-wide failure occurs.
java.lang.UnsupportedOperationException
- if the collection is read-only.RuntimeExceptionWrapper
- if a checked exception is thrown,
including a DatabaseException
on BDB (C Edition).public boolean contains(java.lang.Object key)
Set.contains(java.lang.Object)
interface.
contains
in interface java.util.Collection<K>
contains
in interface java.util.Set<K>
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).boolean hasValues()
hasValues
in class StoredCollection<K>
K makeIteratorData(BaseIterator iterator, DatabaseEntry keyEntry, DatabaseEntry priKeyEntry, DatabaseEntry valueEntry)
makeIteratorData
in class StoredCollection<K>
boolean iterateDuplicates()
iterateDuplicates
in class StoredCollection<K>
Copyright (c) 2004-2012 Oracle. All rights reserved.