Payload - The payload type.public final class IndexedIterator<Payload> extends Object implements Iterator<Entry<Integer,Payload>>
IndexedIterator is an Iterator that can be wrapped around
a given Iterator and every value yielded by the given
Iterator as an Entry whose key is the index of the yielded
element.| Constructor and Description |
|---|
IndexedIterator(Iterator<? extends Payload> iterator)
Creates a new
IndexedIterator from the given Iterator. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasNext() |
Entry<Integer,Payload> |
next() |
void |
remove() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEachRemainingpublic IndexedIterator(Iterator<? extends Payload> iterator) throws IllegalArgumentException
IndexedIterator from the given Iterator.iterator - The Iterator, around which the new
NullFreeIterator will be wrapped.IllegalArgumentException - If the given Iterator is null.public boolean hasNext()
public Entry<Integer,Payload> next() throws NoSuchElementException
public void remove()
throws IllegalStateException
Copyright © 2015–2016 Markenwerk – Gesellschaft für markenbildende Maßnahmen mbH. All rights reserved.