Payload - The payload type.public final class RemoveHandlerIterator<Payload> extends Object implements Iterator<Payload>
RemoveHandlerIterator is an Iterator that can be wrapped
around a given Iterator and intercepts every call to
remove() and calls a given Handler
for the current value.| Constructor and Description |
|---|
RemoveHandlerIterator(Iterator<? extends Payload> iterator,
Handler<? super Payload> removeHandler)
Creates a new
RemoveHandlerIterator. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasNext() |
Payload |
next() |
void |
remove() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEachRemainingpublic RemoveHandlerIterator(Iterator<? extends Payload> iterator, Handler<? super Payload> removeHandler) throws IllegalArgumentException
RemoveHandlerIterator.iterator - The Iterator to iterate over.removeHandler - The Handler to be used.IllegalArgumentException - If the given Iterator is null of if the
given Handler is null.public Payload next() throws NoSuchElementException
next in interface Iterator<Payload>NoSuchElementExceptionpublic void remove()
throws IllegalStateException
remove in interface Iterator<Payload>IllegalStateExceptionCopyright © 2015–2017 Markenwerk – Gesellschaft für markenbildende Maßnahmen mbH. All rights reserved.