| java.lang.Object com.sleepycat.collections.StoredContainer com.sleepycat.collections.StoredCollection com.sleepycat.collections.StoredList
StoredList | public class StoredList extends StoredCollection implements List(Code) | | 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.
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 |
Method Summary | |
public void | add(int index, Object value) Inserts the specified element at the specified position in this list
(optional operation). | public boolean | add(Object value) Appends the specified element to the end of this list (optional
operation). | public boolean | addAll(int index, Collection coll) Inserts all of the elements in the specified collection into this list
at the specified position (optional operation). | public int | append(Object value) 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. | void | checkIterAddAllowed() | public boolean | contains(Object value) Returns true if this list contains the specified element. | public boolean | equals(Object other) Compares the specified object with this list for equality. | public Object | get(int index) Returns the element at the specified position in this list. | int | getIndexOffset() | boolean | hasValues() | public int | hashCode() | public int | indexOf(Object value) Returns the index in this list of the first occurrence of the specified
element, or -1 if this list does not contain this element. | public int | lastIndexOf(Object value) Returns the index in this list of the last occurrence of the specified
element, or -1 if this list does not contain this element. | public ListIterator | listIterator() Returns a list iterator of the elements in this list (in proper
sequence). | public ListIterator | listIterator(int index) Returns a list iterator of the elements in this list (in proper
sequence), starting at the specified position in this list. | Object | makeIteratorData(BaseIterator iterator, DatabaseEntry keyEntry, DatabaseEntry priKeyEntry, DatabaseEntry valueEntry) | public Object | remove(int index) Removes the element at the specified position in this list (optional
operation). | public boolean | remove(Object value) Removes the first occurrence in this list of the specified element
(optional operation). | public Object | set(int index, Object value) Replaces the element at the specified position in this list with the
specified element (optional operation). | final ListIterator | storedOrExternalListIterator(List list) Returns a StoredIterator if the given collection is a StoredCollection,
else returns a regular/external ListIterator. | public List | subList(int fromIndex, int toIndex) Returns a view of the portion of this list between the specified
fromIndex, inclusive, and toIndex, exclusive. |
StoredList | public StoredList(Database database, EntryBinding valueBinding, boolean writeAllowed)(Code) | | Creates a list view of a
Database .
Parameters: database - is the Database underlying the new collection. Parameters: valueBinding - is the binding used to translate between valuebuffers and value objects. Parameters: writeAllowed - is true to create a read-write collection or falseto create a read-only collection. throws: IllegalArgumentException - if formats are not consistentlydefined or a parameter is invalid. throws: RuntimeExceptionWrapper - if a DatabaseException isthrown. |
StoredList | public StoredList(Database database, EntityBinding valueEntityBinding, boolean writeAllowed)(Code) | | Creates a list entity view of a
Database .
Parameters: database - is the Database underlying the new collection. Parameters: valueEntityBinding - is the binding used to translate betweenkey/value buffers and entity value objects. Parameters: writeAllowed - is true to create a read-write collection or falseto create a read-only collection. throws: IllegalArgumentException - if formats are not consistentlydefined or a parameter is invalid. throws: RuntimeExceptionWrapper - if a DatabaseException isthrown. |
add | public void add(int index, Object value)(Code) | | Inserts the specified element at the specified position in this list
(optional operation).
This method conforms to the
List.add(intObject) interface.
throws: UnsupportedOperationException - if the collection is a sublist, orif the collection is indexed, or if the collection is read-only, or ifthe RECNO-RENUMBER access method was not used. throws: RuntimeExceptionWrapper - if a DatabaseException isthrown. |
add | public boolean add(Object value)(Code) | | Appends the specified element to the end of this list (optional
operation).
This method conforms to the
List.add(Object) interface.
throws: UnsupportedOperationException - if the collection is a sublist, orif the collection is indexed, or if the collection is read-only, or ifthe RECNO-RENUMBER access method was not used. throws: RuntimeExceptionWrapper - if a DatabaseException isthrown. |
addAll | public boolean addAll(int index, Collection coll)(Code) | | 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(intCollection) interface.
throws: UnsupportedOperationException - if the collection is a sublist, orif the collection is indexed, or if the collection is read-only, or ifthe RECNO-RENUMBER access method was not used. throws: RuntimeExceptionWrapper - if a DatabaseException isthrown. |
append | public int append(Object value)(Code) | | 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. the assigned index. throws: UnsupportedOperationException - if the collection is indexed, orif the collection is read-only, or if the Store has no com.sleepycat.collections.PrimaryKeyAssigner and is not a QUEUE orRECNO database. throws: RuntimeExceptionWrapper - if a DatabaseException isthrown. |
contains | public boolean contains(Object value)(Code) | | Returns true if this list contains the specified element.
This method conforms to the
List.contains interface.
throws: RuntimeExceptionWrapper - if a DatabaseException isthrown. |
equals | public boolean equals(Object other)(Code) | | 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.
throws: RuntimeExceptionWrapper - if a DatabaseException isthrown. |
get | public Object get(int index)(Code) | | Returns the element at the specified position in this list.
This method conforms to the
List.get interface.
throws: RuntimeExceptionWrapper - if a DatabaseException isthrown. |
getIndexOffset | int getIndexOffset()(Code) | | |
hasValues | boolean hasValues()(Code) | | |
hashCode | public int hashCode()(Code) | | |
indexOf | public int indexOf(Object value)(Code) | | 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.
throws: RuntimeExceptionWrapper - if a DatabaseException isthrown. |
lastIndexOf | public int lastIndexOf(Object value)(Code) | | 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.
throws: RuntimeExceptionWrapper - if a DatabaseException isthrown. |
set | public Object set(int index, Object value)(Code) | | Replaces the element at the specified position in this list with the
specified element (optional operation).
This method conforms to the
List.set interface.
throws: UnsupportedOperationException - if the collection is indexed, orif the collection is read-only. throws: IllegalArgumentException - if an entity value binding is used andthe primary key of the value given is different than the existing storedprimary key. throws: RuntimeExceptionWrapper - if a DatabaseException isthrown. |
storedOrExternalListIterator | final ListIterator storedOrExternalListIterator(List list)(Code) | | Returns a StoredIterator if the given collection is a StoredCollection,
else returns a regular/external ListIterator. The iterator returned
should be closed with the static method StoredIterator.close(Iterator).
|
subList | public List subList(int fromIndex, int toIndex)(Code) | | 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.
throws: RuntimeExceptionWrapper - if a DatabaseException isthrown. |
Fields inherited from com.sleepycat.collections.StoredCollection | final public static int DEFAULT_ITERATOR_BLOCK_SIZE(Code)(Java Doc)
|
|
|