Attempts to modify it will result in an UnsupportedOperationException.
| Modifier and Type | Field and Description |
|---|---|
| private final ListIterator | iterator
The iterator being decorated |
| Access | Constructor and Description |
|---|---|
| private | UnmodifiableListIterator(final ListIterator<? extends E>
the iterator to decorate iterator)Constructor. |
| Modifier and Type | Method and Description |
|---|---|
| public void | add(final E
the element to insert obj)Implements java. |
| public boolean | hasNext()
Implements java. true if this list iterator has more elements when
traversing the list in the forward direction.
|
| public boolean | hasPrevious()
Implements java. true if this list iterator has more elements when
traversing the list in the reverse direction.
|
| public E | next()
Implements java. |
| public int | nextIndex()
Implements java. next.
|
| public E | previous()
Implements java. |
| public int | previousIndex()
Implements java. previous.
|
| public void | remove()
Implements java. next or previous (optional operation).
|
| public void | set(final E
the element with which to replace the last element returned by
obj)next or previousImplements java. next or
previous with the specified element (optional operation).
|
| public static < the element type E> ListIterator | Returns: a new unmodifiable list iteratorthe iterator to decorate iterator)Decorates the specified iterator such that it cannot be modified. |
| iterator | back to summary |
|---|---|
| private final ListIterator<? extends E> iterator The iterator being decorated | |
| UnmodifiableListIterator | back to summary |
|---|---|
| private UnmodifiableListIterator(final ListIterator<? extends E> iterator) Constructor.
| |
| add | back to summary |
|---|---|
| public void add(final E obj) Implements java. Doc from java. Inserts the specified element into the list (optional operation).
The element is inserted immediately before the element that
would be returned by
| |
| hasNext | back to summary |
|---|---|
| public boolean hasNext() Implements java. Doc from java. Returns
| |
| hasPrevious | back to summary |
|---|---|
| public boolean hasPrevious() Implements java. Doc from java. Returns
| |
| next | back to summary |
|---|---|
| public E next() Implements java. Doc from java. Returns the next element in the list and advances the cursor position.
This method may be called repeatedly to iterate through the list,
or intermixed with calls to
| |
| nextIndex | back to summary |
|---|---|
| public int nextIndex() Implements java. Doc from java. Returns the index of the element that would be returned by a
subsequent call to
| |
| previous | back to summary |
|---|---|
| public E previous() Implements java. Doc from java. Returns the previous element in the list and moves the cursor
position backwards. This method may be called repeatedly to
iterate through the list backwards, or intermixed with calls to
| |
| previousIndex | back to summary |
|---|---|
| public int previousIndex() Implements java. Doc from java. Returns the index of the element that would be returned by a
subsequent call to
| |
| remove | back to summary |
|---|---|
| public void remove() Implements java. Doc from java. Removes from the list the last element that was returned by
| |
| set | back to summary |
|---|---|
| public void set(final E obj) Implements java. Doc from java. Replaces the last element returned by
| |
| umodifiableListIterator | back to summary |
|---|---|
| public static <E> ListIterator Decorates the specified iterator such that it cannot be modified.
| |