Main Page | Class Hierarchy | Data Structures | Directories | File List | Data Fields | Related Pages

com::sleepycat::collections::StoredKeySet Class Reference

Inheritance diagram for com::sleepycat::collections::StoredKeySet:

com::sleepycat::collections::StoredCollection com::sleepycat::collections::StoredContainer com::sleepycat::collections::StoredSortedKeySet

Public Member Functions

 StoredKeySet (Database database, EntryBinding keyBinding, boolean writeAllowed)
boolean add (Object key)
boolean remove (Object key)
boolean contains (Object key)

Detailed Description

The Set returned by Map.keySet() and which can also be constructed directly if a Map is not needed. Since this collection is a set it only contains one element for each key, even when duplicates are allowed. Key set iterators are therefore particularly useful for enumerating the unique keys of a store or index that allows duplicates.

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

Author:
Mark Hayes

Definition at line 40 of file StoredKeySet.java.


Constructor & Destructor Documentation

com::sleepycat::collections::StoredKeySet::StoredKeySet Database  database,
EntryBinding  keyBinding,
boolean  writeAllowed
[inline]
 

Creates a key set view of a Database.

Parameters:
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.
Exceptions:
IllegalArgumentException if formats are not consistently defined or a parameter is invalid.
RuntimeExceptionWrapper if a DatabaseException is thrown.

Definition at line 59 of file StoredKeySet.java.


Member Function Documentation

boolean com::sleepycat::collections::StoredKeySet::add Object  key  )  [inline]
 

Adds the specified key to this set if it is not already present (optional operation). When a key is added the value in the underlying data store will be empty. This method conforms to the Set#add interface.

Exceptions:
UnsupportedOperationException if the collection is indexed, or if the collection is read-only.
RuntimeExceptionWrapper if a DatabaseException is thrown.

Definition at line 84 of file StoredKeySet.java.

References com::sleepycat::collections::DataCursor::putNoOverwrite().

boolean com::sleepycat::collections::StoredKeySet::contains Object  key  )  [inline]
 

Returns true if this set contains the specified key. This method conforms to the Set#contains interface.

Exceptions:
RuntimeExceptionWrapper if a DatabaseException is thrown.

Definition at line 124 of file StoredKeySet.java.

boolean com::sleepycat::collections::StoredKeySet::remove Object  key  )  [inline]
 

Removes the specified key from this set if it is present (optional operation). If duplicates are allowed, this method removes all duplicates for the given key. This method conforms to the Set#remove interface.

Exceptions:
UnsupportedOperationException if the collection is read-only.
RuntimeExceptionWrapper if a DatabaseException is thrown.

Definition at line 112 of file StoredKeySet.java.


The documentation for this class was generated from the following file:
Generated on Sun Dec 25 12:15:01 2005 for Berkeley DB 4.4.16 by  doxygen 1.4.2