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

com::sleepycat::collections::StoredList Class Reference

Inheritance diagram for com::sleepycat::collections::StoredList:

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

Public Member Functions

 StoredList (Database database, EntryBinding valueBinding, boolean writeAllowed)
 StoredList (Database database, EntityBinding valueEntityBinding, boolean writeAllowed)
 StoredList (Database database, EntryBinding valueBinding, PrimaryKeyAssigner keyAssigner)
 StoredList (Database database, EntityBinding valueEntityBinding, PrimaryKeyAssigner keyAssigner)
void add (int index, Object value)
boolean add (Object value)
int append (Object value)
boolean addAll (int index, Collection coll)
boolean contains (Object value)
Object get (int index)
int indexOf (Object value)
int lastIndexOf (Object value)
ListIterator listIterator ()
ListIterator listIterator (int index)
Object remove (int index)
boolean remove (Object value)
Object set (int index, Object value)
List subList (int fromIndex, int toIndex)
boolean equals (Object other)

Detailed Description

A List view of a Database.

For all stored lists the keys of the underlying Database must have record number format, and therefore the store or index must be a RECNO, RECNO-RENUMBER, QUEUE, or BTREE-RECNUM database. Only RECNO-RENUMBER allows true list behavior where record numbers are renumbered following the position of an element that is added or removed. For the other access methods (RECNO, QUEUE, and BTREE-RECNUM), stored Lists are most useful as read-only collections where record numbers are not required to be sequential.

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

In addition to the standard List methods, this class provides the following methods for stored lists only. Note that the use of these methods is not compatible with the standard Java collections interface.

Author:
Mark Hayes

Definition at line 57 of file StoredList.java.


Constructor & Destructor Documentation

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

Creates a list 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 82 of file StoredList.java.

Referenced by subList().

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

Creates a list 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 106 of file StoredList.java.

com::sleepycat::collections::StoredList::StoredList Database  database,
EntryBinding  valueBinding,
PrimaryKeyAssigner  keyAssigner
[inline]
 

Creates a list view of a Database with a PrimaryKeyAssigner. Writing is allowed for the created list.

Parameters:
database is the Database underlying the new collection.
valueBinding is the binding used to translate between value buffers and value objects.
keyAssigner is used by the add and append methods to assign primary keys.
Exceptions:
IllegalArgumentException if formats are not consistently defined or a parameter is invalid.
RuntimeExceptionWrapper if a DatabaseException is thrown.

Definition at line 131 of file StoredList.java.

com::sleepycat::collections::StoredList::StoredList Database  database,
EntityBinding  valueEntityBinding,
PrimaryKeyAssigner  keyAssigner
[inline]
 

Creates a list entity view of a Database with a PrimaryKeyAssigner. Writing is allowed for the created list.

Parameters:
database is the Database underlying the new collection.
valueEntityBinding is the binding used to translate between key/value buffers and entity value objects.
keyAssigner is used by the add and append methods to assign primary keys.
Exceptions:
IllegalArgumentException if formats are not consistently defined or a parameter is invalid.
RuntimeExceptionWrapper if a DatabaseException is thrown.

Definition at line 156 of file StoredList.java.


Member Function Documentation

boolean com::sleepycat::collections::StoredList::add Object  value  )  [inline]
 

Appends the specified element to the end of this list (optional operation). This method conforms to the List#add(Object) interface.

Exceptions:
UnsupportedOperationException if the collection is a sublist, or if the collection is indexed, or if the collection is read-only, or if the RECNO-RENUMBER access method was not used.
RuntimeExceptionWrapper if a DatabaseException is thrown.

Definition at line 218 of file StoredList.java.

References com::sleepycat::collections::DataView::append().

void com::sleepycat::collections::StoredList::add int  index,
Object  value
[inline]
 

Inserts the specified element at the specified position in this list (optional operation). This method conforms to the List#add(int, Object) interface.

Exceptions:
UnsupportedOperationException if the collection is a sublist, or if the collection is indexed, or if the collection is read-only, or if the RECNO-RENUMBER access method was not used.
RuntimeExceptionWrapper if a DatabaseException is thrown.

Definition at line 182 of file StoredList.java.

References com::sleepycat::collections::DataView::append(), com::sleepycat::collections::DataCursor::getSearchKey(), and com::sleepycat::collections::DataCursor::putBefore().

boolean com::sleepycat::collections::StoredList::addAll int  index,
Collection  coll
[inline]
 

Inserts all of the elements in the specified collection into this list at the specified position (optional operation). This method conforms to the List#addAll(int, Collection) interface.

Exceptions:
UnsupportedOperationException if the collection is a sublist, or if the collection is indexed, or if the collection is read-only, or if the RECNO-RENUMBER access method was not used.
RuntimeExceptionWrapper if a DatabaseException is thrown.

Definition at line 289 of file StoredList.java.

References com::sleepycat::collections::DataView::append(), com::sleepycat::collections::DataCursor::getSearchKey(), and com::sleepycat::collections::DataCursor::putBefore().

int com::sleepycat::collections::StoredList::append Object  value  )  [inline]
 

Appends a given value returning the newly assigned index. If a com.sleepycat.collections.PrimaryKeyAssigner is associated with Store for this list, it will be used to assigned the returned index. Otherwise the Store must be a QUEUE or RECNO database and the next available record number is assigned as the index. This method does not exist in the standard List interface.

Parameters:
value the value to be appended.
Returns:
the assigned index.
Exceptions:
UnsupportedOperationException if the collection is indexed, or if the collection is read-only, or if the Store has no com.sleepycat.collections.PrimaryKeyAssigner and is not a QUEUE or RECNO database.
RuntimeExceptionWrapper if a DatabaseException is thrown.

Definition at line 251 of file StoredList.java.

References com::sleepycat::collections::DataView::append().

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

Returns true if this list contains the specified element. This method conforms to the List#contains interface.

Exceptions:
RuntimeExceptionWrapper if a DatabaseException is thrown.

Definition at line 332 of file StoredList.java.

boolean com::sleepycat::collections::StoredList::equals Object  other  )  [inline]
 

Compares the specified object with this list for equality. A value comparison is performed by this method and the stored values are compared rather than calling the equals() method of each element. This method conforms to the List#equals interface.

Exceptions:
RuntimeExceptionWrapper if a DatabaseException is thrown.

Reimplemented from com::sleepycat::collections::StoredCollection.

Definition at line 537 of file StoredList.java.

References listIterator().

Object com::sleepycat::collections::StoredList::get int  index  )  [inline]
 

Returns the element at the specified position in this list. This method conforms to the List#get interface.

Exceptions:
RuntimeExceptionWrapper if a DatabaseException is thrown.

Definition at line 344 of file StoredList.java.

int com::sleepycat::collections::StoredList::indexOf Object  value  )  [inline]
 

Returns the index in this list of the first occurrence of the specified element, or -1 if this list does not contain this element. This method conforms to the List#indexOf interface.

Exceptions:
RuntimeExceptionWrapper if a DatabaseException is thrown.

Definition at line 357 of file StoredList.java.

Referenced by lastIndexOf().

int com::sleepycat::collections::StoredList::lastIndexOf Object  value  )  [inline]
 

Returns the index in this list of the last occurrence of the specified element, or -1 if this list does not contain this element. This method conforms to the List#lastIndexOf interface.

Exceptions:
RuntimeExceptionWrapper if a DatabaseException is thrown.

Definition at line 370 of file StoredList.java.

References indexOf().

ListIterator com::sleepycat::collections::StoredList::listIterator int  index  )  [inline]
 

Returns a list iterator of the elements in this list (in proper sequence), starting at the specified position in this list. The iterator will be read-only if the collection is read-only. This method conforms to the List#listIterator(int) interface.

Returns:
a StoredIterator for this collection.
Exceptions:
RuntimeExceptionWrapper if a DatabaseException is thrown.
See also:
isWriteAllowed

Definition at line 427 of file StoredList.java.

References com::sleepycat::collections::StoredIterator::close(), com::sleepycat::collections::StoredContainer::isWriteAllowed(), com::sleepycat::collections::StoredCollection::iterator(), and com::sleepycat::collections::StoredIterator::moveToIndex().

ListIterator com::sleepycat::collections::StoredList::listIterator  )  [inline]
 

Returns a list iterator of the elements in this list (in proper sequence). The iterator will be read-only if the collection is read-only. This method conforms to the List#listIterator() interface.

Returns:
a StoredIterator for this collection.
Exceptions:
RuntimeExceptionWrapper if a DatabaseException is thrown.
See also:
isWriteAllowed

Definition at line 409 of file StoredList.java.

References com::sleepycat::collections::StoredContainer::isWriteAllowed(), and com::sleepycat::collections::StoredCollection::iterator().

Referenced by equals().

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

Removes the first occurrence in this list of the specified element (optional operation). This method conforms to the List#remove(Object) interface.

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

Definition at line 471 of file StoredList.java.

Object com::sleepycat::collections::StoredList::remove int  index  )  [inline]
 

Removes the element at the specified position in this list (optional operation). This method conforms to the List#remove(int) interface.

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

Definition at line 449 of file StoredList.java.

Object com::sleepycat::collections::StoredList::set int  index,
Object  value
[inline]
 

Replaces the element at the specified position in this list with the specified element (optional operation). This method conforms to the List#set interface.

Exceptions:
UnsupportedOperationException if the collection is indexed, or if the collection is read-only.
IllegalArgumentException if an entity value binding is used and the primary key of the value given is different than the existing stored primary key.
RuntimeExceptionWrapper if a DatabaseException is thrown.

Definition at line 491 of file StoredList.java.

List com::sleepycat::collections::StoredList::subList int  fromIndex,
int  toIndex
[inline]
 

Returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive. Note that add() and remove() may not be called for the returned sublist. This method conforms to the List#subList interface.

Exceptions:
RuntimeExceptionWrapper if a DatabaseException is thrown.

Definition at line 509 of file StoredList.java.

References StoredList(), and com::sleepycat::collections::DataView::subView().


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