public final class UnmodifiableIterator<E> extends Objectimplements Iterator <E>, Unmodifiable
Attempts to modify it will result in an UnsupportedOperationException.
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasNext()
|
E |
next()
|
void |
remove()
|
static <E> Iterator |
unmodifiableIterator(Iterator
Decorates the specified iterator such that it cannot be modified.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEachRemainingpublic static <E> Iterator<E> unmodifiableIterator(Iterator <? extends E> iterator)
If the iterator is already unmodifiable it is returned directly.
E - the element type
iterator - the iterator to decorate
NullPointerException - if the iterator is null
public boolean hasNext()
public E next()
public void remove()