public final class UnmodifiableListIterator<E> extends java.lang.Object implements java.util.ListIterator<E>, Unmodifiable
Attempts to modify it will result in an UnsupportedOperationException.
| Modifier and Type | Field and Description |
|---|---|
private java.util.ListIterator<? extends E> |
iterator
The iterator being decorated
|
| Modifier | Constructor and Description |
|---|---|
private |
UnmodifiableListIterator(java.util.ListIterator<? extends E> iterator)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(E obj) |
boolean |
hasNext() |
boolean |
hasPrevious() |
E |
next() |
int |
nextIndex() |
E |
previous() |
int |
previousIndex() |
void |
remove() |
void |
set(E obj) |
static <E> java.util.ListIterator<E> |
umodifiableListIterator(java.util.ListIterator<? extends E> iterator)
Decorates the specified iterator such that it cannot be modified.
|
private final java.util.ListIterator<? extends E> iterator
private UnmodifiableListIterator(java.util.ListIterator<? extends E> iterator)
iterator - the iterator to decoratepublic static <E> java.util.ListIterator<E> umodifiableListIterator(java.util.ListIterator<? extends E> iterator)
E - the element typeiterator - the iterator to decoratejava.lang.IllegalArgumentException - if the iterator is nullpublic boolean hasNext()
public E next()
public int nextIndex()
nextIndex in interface java.util.ListIterator<E>public boolean hasPrevious()
hasPrevious in interface java.util.ListIterator<E>public int previousIndex()
previousIndex in interface java.util.ListIterator<E>public void remove()