Package com.sleepycat.collections
Class StoredEntrySet<K,V>
java.lang.Object
com.sleepycat.collections.StoredContainer
com.sleepycat.collections.StoredCollection<Map.Entry<K,V>>
com.sleepycat.collections.StoredEntrySet<K,V>
- All Implemented Interfaces:
Cloneable,Iterable<Map.Entry<K,,V>> Collection<Map.Entry<K,,V>> Set<Map.Entry<K,V>>
- Direct Known Subclasses:
StoredSortedEntrySet
public class StoredEntrySet<K,V>
extends StoredCollection<Map.Entry<K,V>>
implements Set<Map.Entry<K,V>>
The Set returned by Map.entrySet(). This class may not be instantiated
directly. Contrary to what is stated by
Map.entrySet() this class
does support the add(java.util.Map.Entry<K, V>) and StoredCollection.addAll(java.util.Collection<? extends E>) methods.
The Map.Entry.setValue(V) method of the Map.Entry objects
that are returned by this class and its iterators behaves just as the StoredIterator.set(E) method does.
-
Field Summary
Fields inherited from class com.sleepycat.collections.StoredCollection
DEFAULT_ITERATOR_BLOCK_SIZE -
Method Summary
Modifier and TypeMethodDescriptionbooleanAdds the specified element to this set if it is not already present (optional operation).booleanReturns true if this set contains the specified element.booleanRemoves the specified element from this set if it is present (optional operation).toString()Converts the collection to a string representation for debugging.Methods inherited from class com.sleepycat.collections.StoredCollection
addAll, containsAll, equals, getIteratorBlockSize, hashCode, iterator, iterator, join, removeAll, retainAll, setIteratorBlockSize, size, storedIterator, storedIterator, toArray, toArray, toListMethods inherited from class com.sleepycat.collections.StoredContainer
areDuplicatesAllowed, areDuplicatesOrdered, areKeyRangesAllowed, areKeysRenumbered, clear, getCursorConfig, isEmpty, isOrdered, isSecondary, isTransactional, isWriteAllowedMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Method Details
-
add
Adds the specified element to this set if it is not already present (optional operation). This method conforms to theSet.add(E)interface.- Specified by:
addin interfaceCollection<K>- Specified by:
addin interfaceSet<K>- Parameters:
mapEntry- must be aMap.Entryinstance.- Returns:
- true if the key-value pair was added to the set (and was not previously present).
- Throws:
UnsupportedOperationException- if the collection is read-only.ClassCastException- if the mapEntry is not aMap.Entryinstance.RuntimeExceptionWrapper- if a checked exception is thrown, including aDatabaseExceptionon BDB (C edition).
-
remove
Removes the specified element from this set if it is present (optional operation). This method conforms to theSet.remove(java.lang.Object)interface.- Specified by:
removein interfaceCollection<K>- Specified by:
removein interfaceSet<K>- Parameters:
mapEntry- is aMap.Entryinstance to be removed.- Returns:
- true if the key-value pair was removed from the set, or false if
the mapEntry is not a
Map.Entryinstance or is not present in the set. - Throws:
UnsupportedOperationException- if the collection is read-only.RuntimeExceptionWrapper- if a checked exception is thrown, including aDatabaseExceptionon BDB (C edition).
-
contains
Returns true if this set contains the specified element. This method conforms to theSet.contains(java.lang.Object)interface.- Specified by:
containsin interfaceCollection<K>- Specified by:
containsin interfaceSet<K>- Parameters:
mapEntry- is aMap.Entryinstance to be checked.- Returns:
- true if the key-value pair is present in the set, or false if
the mapEntry is not a
Map.Entryinstance or is not present in the set. - Throws:
RuntimeExceptionWrapper- if a checked exception is thrown, including aDatabaseExceptionon BDB (C edition).
-
toString
Description copied from class:StoredCollectionConverts the collection to a string representation for debugging. WARNING: The returned string may be very large.- Overrides:
toStringin classStoredCollection<Map.Entry<K,V>> - Returns:
- the string representation.
-