Payload - The payload type.public final class SuffixedIterator<Payload> extends Object implements Iterator<Payload>
SuffixedIterator is an Iterator that can be wrapped around
a given Iterator and yields some given suffix values after yielding
all values yielded by the given Iterator.
Calling IntegerArrayIterator.remove() calls Iterator.remove()
removed on the wrapped Iterator, if, and only iff, the last call to
IntegerArrayIterator.next() didn't return a suffix value.
| Constructor and Description |
|---|
SuffixedIterator(Iterator<? extends Payload> iterator,
Payload... suffixes)
Creates a new
SuffixedIterator from the given Iterator
and the given suffix values. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasNext() |
Payload |
next() |
void |
remove() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEachRemainingpublic SuffixedIterator(Iterator<? extends Payload> iterator, Payload... suffixes) throws IllegalArgumentException
SuffixedIterator from the given Iterator
and the given suffix values.iterator - The Iterator, around which the new
NullFreeIterator will be wrapped.suffixes - The suffixes 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
remove in interface Iterator<Payload>IllegalStateExceptionCopyright © 2015–2016 Markenwerk – Gesellschaft für markenbildende Maßnahmen mbH. All rights reserved.