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

com::sleepycat::collections::StoredValueSet Class Reference

Inheritance diagram for com::sleepycat::collections::StoredValueSet:

com::sleepycat::collections::StoredCollection com::sleepycat::collections::StoredContainer com::sleepycat::collections::StoredSortedValueSet

Public Member Functions

 StoredValueSet (Database database, EntryBinding valueBinding, boolean writeAllowed)
 StoredValueSet (Database database, EntityBinding valueEntityBinding, boolean writeAllowed)
boolean add (Object entity)
boolean contains (Object value)
boolean remove (Object value)
int size ()

Detailed Description

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.

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

Author:
Mark Hayes

Definition at line 39 of file StoredValueSet.java.


Constructor & Destructor Documentation

com::sleepycat::collections::StoredValueSet::StoredValueSet Database  database,
EntryBinding  valueBinding,
boolean  writeAllowed
[inline]
 

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

Definition at line 64 of file StoredValueSet.java.

com::sleepycat::collections::StoredValueSet::StoredValueSet Database  database,
EntityBinding  valueEntityBinding,
boolean  writeAllowed
[inline]
 

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

Definition at line 89 of file StoredValueSet.java.


Member Function Documentation

boolean com::sleepycat::collections::StoredValueSet::add Object  entity  )  [inline]
 

Adds the specified entity to this set if it is not already present (optional operation). This method conforms to the Set#add interface.

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.
Exceptions:
UnsupportedOperationException if the collection is read-only, if the collection is indexed, or if an entity binding is not used.
RuntimeExceptionWrapper if a DatabaseException is thrown.

Definition at line 124 of file StoredValueSet.java.

References com::sleepycat::collections::DataView::dupsAllowed, com::sleepycat::collections::DataView::entityBinding, com::sleepycat::collections::DataView::isSecondary(), com::sleepycat::collections::DataCursor::putNoDupData(), and com::sleepycat::collections::DataCursor::useRangeKey().

boolean com::sleepycat::collections::StoredValueSet::contains Object  value  )  [inline]
 

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

Parameters:
value the value to check.
Returns:
whether the set contains the given value.

Definition at line 165 of file StoredValueSet.java.

boolean com::sleepycat::collections::StoredValueSet::remove Object  value  )  [inline]
 

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 interface.

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

Definition at line 183 of file StoredValueSet.java.

int com::sleepycat::collections::StoredValueSet::size  )  [inline]
 

Always throws UnsupportedOperationException. The size of a database cannot be obtained reliably or inexpensively. This method therefore violates the java.util.Collection#size and java.util.Map#size interfaces.

Returns:
always throws an exception.
Exceptions:
UnsupportedOperationException unconditionally.

Reimplemented from com::sleepycat::collections::StoredContainer.

Definition at line 189 of file StoredValueSet.java.

References com::sleepycat::collections::DataCursor::count(), and com::sleepycat::collections::DataCursor::getFirst().


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