public final class UnmodifiableIterator extends Object implements Iterator, Unmodifiable
Modifier and Type | Method and Description |
---|---|
static Iterator |
decorate(Iterator iterator)
Decorates the specified iterator such that it cannot be modified.
|
boolean |
hasNext() |
Object |
next() |
void |
remove() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining
public static Iterator decorate(Iterator iterator)
If the iterator is already unmodifiable it is returned directly.
iterator
- the iterator to decorateIllegalArgumentException
- if the iterator is nullCopyright © 2001–2020 The Apache Software Foundation. All rights reserved.