Public Member Functions | |
final boolean | isReadModifyWrite () |
void | setReadModifyWrite (boolean lockForWrite) |
boolean | hasNext () |
boolean | hasPrevious () |
Object | next () |
Object | previous () |
int | nextIndex () |
int | previousIndex () |
void | set (Object value) |
void | remove () |
void | add (Object value) |
int | count () |
void | close () |
final StoredCollection | getCollection () |
Static Public Member Functions | |
static void | close (Iterator i) |
Protected Member Functions | |
Object | clone () |
While in general this class conforms to the Iterator interface, it is important to note that all iterators for stored collections must be explicitly closed with close(). The static method close(java.util.Iterator) allows calling close for all iterators without harm to iterators that are not from stored collections, and also avoids casting. If a stored iterator is not closed, unpredictable behavior including process death may result.
This class implements the Iterator interface for all stored iterators. It also implements ListIterator because some list iterator methods apply to all stored iterators, for example, previous and hasPrevious. Other list iterator methods are always supported for lists, but for other types of collections are only supported under certain conditions. See nextIndex, previousIndex, add and set for details.
In addition, this class provides the following methods for stored collection iterators only. Note that the use of these methods is not compatible with the standard Java collections interface.
Definition at line 51 of file StoredIterator.java.
|
Inserts the specified element into the list or inserts a duplicate into other types of collections (optional operation). This method conforms to the ListIterator#add interface when the collection is a list and the RECNO-RENUMBER access method is used. Otherwise, this method may only be called when duplicates are allowed. If duplicates are unsorted, the new value will be inserted in the same manner as list elements. If duplicates are sorted, the new value will be inserted in sort order. Note that for the JE product, RECNO-RENUMBER databases are not supported, and therefore this method may only be used to add duplicates.
Definition at line 425 of file StoredIterator.java. References close(), hasNext(), next(), com::sleepycat::collections::DataCursor::putAfter(), com::sleepycat::collections::DataCursor::putBefore(), and com::sleepycat::collections::DataCursor::putNoDupData(). |
|
Clones this iterator preserving its current position.
Definition at line 110 of file StoredIterator.java. References com::sleepycat::collections::DataCursor::cloneCursor(), and cursor. |
|
Closes this iterator. This method does not exist in the standard Iterator or ListIterator interfaces.
After being closed, only the hasNext and hasPrevious methods may be called and these will return false. close() may also be called again and will do nothing. If other methods are called a
Definition at line 540 of file StoredIterator.java. Referenced by add(). |
|
Closes the given iterator using close() if it is a StoredIterator. If the given iterator is not a StoredIterator, this method does nothing.
Definition at line 62 of file StoredIterator.java. Referenced by com::sleepycat::collections::StoredList::listIterator(). |
|
Returns the number of elements having the same key value as the key value of the element last returned by next() or previous(). If no duplicates are allowed, 1 is always returned.
Definition at line 515 of file StoredIterator.java. References com::sleepycat::collections::DataCursor::count(). |
|
Returns the collection associated with this iterator. This method does not exist in the standard Iterator or ListIterator interfaces.
Definition at line 555 of file StoredIterator.java. |
|
Returns true if this iterator has more elements when traversing in the forward direction. False is returned if the iterator has been closed. This method conforms to the Iterator#hasNext interface.
Definition at line 158 of file StoredIterator.java. Referenced by add(), and nextIndex(). |
|
Returns true if this iterator has more elements when traversing in the reverse direction. It returns false if the iterator has been closed. This method conforms to the ListIterator#hasPrevious interface.
Definition at line 188 of file StoredIterator.java. Referenced by previousIndex(). |
|
Returns whether write-locks will be obtained when reading with this cursor. Obtaining write-locks can prevent deadlocks when reading and then modifying data.
Definition at line 129 of file StoredIterator.java. |
|
Returns the next element in the iteration. This method conforms to the Iterator#next interface.
Definition at line 217 of file StoredIterator.java. Referenced by add(). |
|
Returns the index of the element that would be returned by a subsequent call to next. This method conforms to the ListIterator#nextIndex interface except that it returns Integer.MAX_VALUE for stored lists when positioned at the end of the list, rather than returning the list size as specified by the ListIterator interface. This is because the database size is not available.
Definition at line 291 of file StoredIterator.java. References com::sleepycat::collections::DataCursor::getCurrentRecordNumber(), and hasNext(). |
|
Returns the next element in the iteration. This method conforms to the ListIterator#previous interface.
Definition at line 250 of file StoredIterator.java. |
|
Returns the index of the element that would be returned by a subsequent call to previous. This method conforms to the ListIterator#previousIndex interface.
Definition at line 320 of file StoredIterator.java. References com::sleepycat::collections::DataCursor::getCurrentRecordNumber(), and hasPrevious(). |
|
Removes the last element that was returned by next or previous (optional operation). This method conforms to the ListIterator#remove interface except that when the collection is a list and the RECNO-RENUMBER access method is not used, list indices will not be renumbered. Note that for the JE product, RECNO-RENUMBER databases are not supported, and therefore list indices are never renumbered by this method.
Definition at line 383 of file StoredIterator.java. References com::sleepycat::collections::DataCursor::delete(). |
|
Replaces the last element returned by next or previous with the specified element (optional operation). This method conforms to the ListIterator#set interface.
Definition at line 354 of file StoredIterator.java. References com::sleepycat::collections::DataCursor::putCurrent(). Referenced by com::sleepycat::collections::StoredMapEntry::setValue(). |
|
Changes whether write-locks will be obtained when reading with this cursor. Obtaining write-locks can prevent deadlocks when reading and then modifying data.
Definition at line 142 of file StoredIterator.java. |