Payload - The payload type.public final class ProtectingIterator<Payload> extends AbstractProtectedIterator<Payload>
ProtectingIterator is an AbstractProtectedIterator that can
be wrapped around a given Iterator and guarantees that every call to
AbstractProtectedIterator.remove() throws an
UnsupportedOperationException and doesn't alter the underlying
Iterator.| Constructor and Description |
|---|
ProtectingIterator(Iterator<? extends Payload> iterator)
Creates a new
ProtectingIterator. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasNext() |
Payload |
next() |
removeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEachRemainingpublic ProtectingIterator(Iterator<? extends Payload> iterator) throws IllegalArgumentException
ProtectingIterator.iterator - The Iterator to iterate over.IllegalArgumentException - If the given Iterator is null.public boolean hasNext()
public Payload next() throws NoSuchElementException
NoSuchElementExceptionCopyright © 2015–2017 Markenwerk – Gesellschaft für markenbildende Maßnahmen mbH. All rights reserved.