public static class ObjectIterators.EmptyIterator<K> extends AbstractObjectListIterator<K> 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)
This method just iterates the type-specific version of
BidirectionalIterator.previous() for
at most n times, stopping if BidirectionalIterator.hasPrevious() becomes false. |
Object |
clone() |
boolean |
hasNext() |
boolean |
hasPrevious()
Returns whether there is a previous element.
|
K |
next() |
int |
nextIndex() |
K |
previous()
Returns the previous element from the collection.
|
int |
previousIndex() |
int |
skip(int n)
This method just iterates the type-specific version of
Iterator.next() for at most
n times, stopping if Iterator.hasNext() becomes false. |
add, setremoveequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitremovepublic boolean hasNext()
public boolean hasPrevious()
BidirectionalIteratorhasPrevious in interface BidirectionalIterator<K>hasPrevious in interface ListIterator<K>ListIterator.hasPrevious()public K next()
public K previous()
BidirectionalIteratorprevious in interface BidirectionalIterator<K>previous in interface ListIterator<K>ListIterator.previous()public int nextIndex()
nextIndex in interface ListIterator<K>public int previousIndex()
previousIndex in interface ListIterator<K>public int skip(int n)
AbstractObjectIteratorIterator.next() for at most
n times, stopping if Iterator.hasNext() becomes false.skip in interface ObjectIterator<K>skip in class AbstractObjectIterator<K>n - the number of elements to skip.Iterator.next()public int back(int n)
AbstractObjectBidirectionalIteratorBidirectionalIterator.previous() for
at most n times, stopping if BidirectionalIterator.hasPrevious() becomes false.back in interface ObjectBidirectionalIterator<K>back in class AbstractObjectBidirectionalIterator<K>n - the number of elements to skip back.Iterator.next()