Payload - The payload type.public abstract class AbstractIndexedIterator<Payload> extends AbstractProtectedBidirectionalIterator<Payload>
AbstractIndexedIterator is an abstract base implementation for
ProtectedBidirectionalIterator implementations that holds the current
index and implements the index-related methods.| Modifier | Constructor and Description |
|---|---|
protected |
AbstractIndexedIterator(int startIndex,
int maxIndex)
Creates a new
AbstractIndexedIterator. |
| Modifier and Type | Method and Description |
|---|---|
protected abstract Payload |
get(int index)
Returns the payload value at the given index.
|
boolean |
hasNext() |
boolean |
hasPrevious()
Returns whether this
BidirectionalIterator has a previous
element. |
Payload |
next() |
Payload |
previous()
Returns the previous element.
|
removeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitremoveforEachRemainingprotected AbstractIndexedIterator(int startIndex,
int maxIndex)
throws IllegalArgumentException
AbstractIndexedIterator.startIndex - The start index to be used.maxIndex - The maximum index.IllegalArgumentException - If the given start index is negative or if the given maximum
index is smaller than the start index.public final boolean hasNext()
public final Payload next() throws NoSuchElementException
NoSuchElementExceptionpublic final boolean hasPrevious()
BidirectionalIteratorBidirectionalIterator has a previous
element.BidirectionalIterator has a previous
element.public final Payload previous() throws NoSuchElementException
BidirectionalIteratorNoSuchElementException - If this BidirectionalIterator has no previous
element.protected abstract Payload get(int index)
index - The index to be used, which is guaranteed to be non-negative
and smaller then the maximum index.Copyright © 2015–2017 Markenwerk – Gesellschaft für markenbildende Maßnahmen mbH. All rights reserved.