Payload - The payload type.public final class InfixedIterator<Payload> extends Object implements Iterator<Payload>
InfixedIterator is an Iterator that can be wrapped around
a given Iterator and yields some given infix values between every
value yielded by the given Iterator.
Calling AbstractProtectedIterator.remove() calls Iterator.remove()
removed on the wrapped Iterator, if, and only iff, the last call to
AbstractIndexedIterator.next() didn't return an infix value.
| Constructor and Description |
|---|
InfixedIterator(Iterator<? extends Payload> iterator,
Payload... infixes)
Creates a new
InfixedIterator. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasNext() |
Payload |
next() |
void |
remove() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEachRemainingpublic InfixedIterator(Iterator<? extends Payload> iterator, Payload... infixes) throws IllegalArgumentException
InfixedIterator.iterator - The Iterator to iterate over.infixes - The infixes to be yielded.IllegalArgumentException - If the given Iterator is null.public Payload next() throws NoSuchElementException
next in interface Iterator<Payload>NoSuchElementExceptionpublic void remove()
throws IllegalStateException,
UnsupportedOperationException
remove in interface Iterator<Payload>IllegalStateExceptionUnsupportedOperationExceptionCopyright © 2015–2017 Markenwerk – Gesellschaft für markenbildende Maßnahmen mbH. All rights reserved.