public abstract class AbstractLongBidirectionalIterator extends AbstractLongIterator implements LongBidirectionalIterator
To create a type-specific bidirectional iterator, besides what is needed for an iterator you need both a method returning the previous element as primitive type and a method returning the previous element as an object. However, if you inherit from this class you need just one (anyone).
This class implements also a trivial version of back(int) that uses
type-specific methods.
| Modifier and Type | Method and Description |
|---|---|
int |
back(int n)
Moves back for the given number of elements.
|
Long |
previous()
Deprecated.
Please use the corresponding type-specific method instead.
|
long |
previousLong()
This implementation delegates to
previous(). |
next, nextLong, remove, skipequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitnext, nextLong, skipskiphasPreviousforEachRemaining, hasNext, removepublic long previousLong()
This implementation delegates to previous().
previousLong in interface LongBidirectionalIteratorListIterator.previous()@Deprecated public Long previous()
This implementation delegates to the corresponding type-specific method.
previous in interface BidirectionalIterator<Long>previous in interface LongBidirectionalIteratorListIterator.previous()public int back(int n)
The effect of this call is exactly the same as that of calling
LongBidirectionalIterator.previous() for n times (possibly stopping if
BidirectionalIterator.hasPrevious() becomes false).
This implemntation iterates the type-specific version of
previous() for at most n times, stopping if
BidirectionalIterator.hasPrevious() becomes false.
back in interface LongBidirectionalIteratorback in interface ObjectBidirectionalIterator<Long>n - the number of elements to skip backwards.previous()