StoredEntrySet (Sleepycat Software, Inc. - Berkeley DB Java API)
Keywords: com.sleepycat.collections.StoredEntrySet class

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Berkeley DB version 4.4.20
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sleepycat.collections
Class StoredEntrySet

    java.lang.Object
      com.sleepycat.collections.StoredContainer
          com.sleepycat.collections.StoredCollection
              com.sleepycat.collections.StoredEntrySet

All Implemented Interfaces:
  Cloneable, Collection, Set

Direct Known Subclasses:
  StoredSortedEntrySet

public class StoredEntrySet
extends StoredCollection
implements Set

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.lang.Object)` and `StoredCollection.addAll(java.util.Collection)` methods.

The `Map.Entry.setValue(java.lang.Object)` method of the Map.Entry objects that are returned by this class and its iterators behaves just as the `StoredIterator.set(java.lang.Object)` method does.

Note that this class does not conform to the standard Java collections interface in the following ways:

- The `StoredContainer.size()` method always throws `UnsupportedOperationException` because, for performance reasons, databases do not maintain their total record count.
- All iterators must be explicitly closed using `StoredIterator.close()` or `StoredIterator.close(java.util.Iterator)` to release the underlying database cursor resources.

Method Summary
`boolean` | `add(Object mapEntry)` Adds the specified element to this set if it is not already present (optional operation).
`boolean` | `contains(Object mapEntry)` Returns true if this set contains the specified element.
`boolean` | `remove(Object mapEntry)` Removes the specified element from this set if it is present (optional operation).
`String` | `toString()` Converts the collection to a string representation for debugging.

Methods inherited from class com.sleepycat.collections.StoredCollection
`addAll, containsAll, equals, hashCode, iterator, iterator, join, removeAll, retainAll, toArray, toArray, toList`

Methods inherited from class com.sleepycat.collections.StoredContainer
`areDuplicatesAllowed, areDuplicatesOrdered, areKeysRenumbered, clear, getCursorConfig, isDirtyRead, isDirtyReadAllowed, isEmpty, isOrdered, isSecondary, isTransactional, isWriteAllowed, size`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Methods inherited from interface java.util.Set
`addAll, clear, containsAll, equals, hashCode, isEmpty, iterator, removeAll, retainAll, size, toArray, toArray`

Method Detail

### add

    public boolean add(Object mapEntry)

  Adds the specified element to this set if it is not already present (optional operation). This method conforms to the `Set.add(java.lang.Object)` interface.

  Specified by:
    `add` in interface `Set`
  Parameters:
    `mapEntry` - must be a `Map.Entry` instance.
  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 a `Map.Entry` instance.
    `RuntimeExceptionWrapper` - if a `DatabaseException` is thrown.

### remove

    public boolean remove(Object mapEntry)

  Removes the specified element from this set if it is present (optional operation). This method conforms to the `Set.remove(java.lang.Object)` interface.

  Specified by:
    `remove` in interface `Set`
  Parameters:
    `mapEntry` - is a `Map.Entry` instance to be removed.
  Returns:
    true if the key-value pair was removed from the set, or false if the mapEntry is not a `Map.Entry` instance or is not present in the set.
  Throws:
    `UnsupportedOperationException` - if the collection is read-only.
    `RuntimeExceptionWrapper` - if a `DatabaseException` is thrown.

### contains

    public boolean contains(Object mapEntry)

  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 `Set`
  Parameters:
    `mapEntry` - is a `Map.Entry` instance to be checked.
  Returns:
    true if the key-value pair is present in the set, or false if the mapEntry is not a `Map.Entry` instance or is not present in the set.
  Throws:
    `RuntimeExceptionWrapper` - if a `DatabaseException` is thrown.

### toString

    public String toString()

  Description copied from class: `StoredCollection`
  Converts the collection to a string representation for debugging. WARNING: The returned string may be very large.

  Overrides:
    `toString` in class `StoredCollection`
  Returns:
    the string representation.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Berkeley DB version 4.4.20
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright (c) 1996-2005 Sleepycat Software, Inc. - All rights reserved.