|
BRUtil - Making Java a Kinder, Gentler, Place to be. |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
A uni-directional iterator that moves in the reverse direction.
The ReverseListIterator contains a cursor
that lies between elements and that begins after the last element. Calls to
previous return the element before the implicit cursor.
Current item is defined as the most recent element returned by
previous. If none has been returned or the current item
has become undefined, then methods that require a current item will fail.
The methods remove and set require a current item.
The methods remove and insert make the current
item undefined.
The ListIterator does not support commodification, so any structural
modification of the list during the ListIterator's lifetime will result
in arbitrary behavior from all ListIterator Methods.
| Method Summary | |
boolean |
hasPrevious()
Returns true if an element exists before the cursor (i.e., if previous will return an element). |
void |
insert(java.lang.Object elt)
The given element is inserted immediately after the cursor. |
java.lang.Object |
previous()
Returns the element before the cursor and advances the cursor backwards. |
void |
remove()
Removes the current item from the list. |
java.lang.Object |
set(java.lang.Object elt)
Replaces the current item. |
| Method Detail |
public boolean hasPrevious()
true if an element exists before the cursor (i.e., if previous will return an element).true if an element exists before the cursor.public java.lang.Object previous()
NoSuchElementException - if the cursor is before the first elementpublic void remove()
IllegalStateException - if current item is undefined.public java.lang.Object set(java.lang.Object elt)
elt - the element to replace the current item's element.IllegalStateException - if current item is undefined.public void insert(java.lang.Object elt)
previous is unaffected.
If the list is empty, the new element becomes the sole element in
the list. Current item becomes undefined.elt - the element to be inserted.
|
BRUtil - Making Java a Kinder, Gentler, Place to be. |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||