public final class UnmodifiableIterator<E> extends Object implements 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<E> |
unmodifiableIterator(Iterator<? extends E> iterator)
Decorates the specified iterator such that it cannot be modified.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining
public static <E> Iterator<E> unmodifiableIterator(Iterator<? extends E> iterator)
If the iterator is already unmodifiable it is returned directly.
E
- the element typeiterator
- the iterator to decorateNullPointerException
- if the iterator is nullCopyright © 2001–2018 The Apache Software Foundation. All rights reserved.