public static class IntIterators.EmptyIterator extends AbstractIntListIterator implements Serializable, Cloneable
This class may be useful to implement your own in case you subclass a type-specific iterator.
| Modifier and Type | Method and Description |
|---|---|
int |
back(int n)
Moves back for the given number of elements.
|
Object |
clone() |
boolean |
hasNext() |
boolean |
hasPrevious()
Returns whether there is a previous element.
|
int |
nextIndex() |
int |
nextInt()
Returns the next element as a primitive type.
|
int |
previousIndex() |
int |
previousInt()
This implementation delegates to
AbstractIntBidirectionalIterator.previous(). |
int |
skip(int n)
Skips the given number of elements.
|
add, add, set, setpreviousnext, removeequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitnext, previous, removepreviousforEachRemainingpublic boolean hasNext()
public boolean hasPrevious()
BidirectionalIteratorhasPrevious in interface BidirectionalIterator<Integer>hasPrevious in interface ListIterator<Integer>ListIterator.hasPrevious()public int nextInt()
AbstractIntIteratorThis implementation delegates to the corresponding generic method.
nextInt in interface IntIteratornextInt in class AbstractIntIteratorIterator.next()public int previousInt()
AbstractIntBidirectionalIterator
This implementation delegates to AbstractIntBidirectionalIterator.previous().
previousInt in interface IntBidirectionalIteratorpreviousInt in class AbstractIntBidirectionalIteratorListIterator.previous()public int nextIndex()
nextIndex in interface ListIterator<Integer>public int previousIndex()
previousIndex in interface ListIterator<Integer>public int skip(int n)
AbstractIntIterator
The effect of this call is exactly the same as that of calling
IntIterator.next() for n times (possibly stopping if
Iterator.hasNext() becomes false).
This implementaion iterates the type-specific version of AbstractIntIterator.next()
for at most n times, stopping if Iterator.hasNext() becomes
false.
skip in interface IntIteratorskip in interface ObjectIterator<Integer>skip in class AbstractIntIteratorn - the number of elements to skip.Iterator.next()public int back(int n)
AbstractIntBidirectionalIterator
The effect of this call is exactly the same as that of calling
IntBidirectionalIterator.previous() for n times (possibly stopping if
BidirectionalIterator.hasPrevious() becomes false).
This implemntation iterates the type-specific version of
AbstractIntBidirectionalIterator.previous() for at most n times, stopping if
BidirectionalIterator.hasPrevious() becomes false.
back in interface IntBidirectionalIteratorback in interface ObjectBidirectionalIterator<Integer>back in class AbstractIntBidirectionalIteratorn - the number of elements to skip backwards.AbstractIntBidirectionalIterator.previous()