public static class ObjectIterators.EmptyIterator<K> extends java.lang.Object implements ObjectListIterator<K>, java.io.Serializable, java.lang.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.
|
java.lang.Object |
clone() |
void |
forEachRemaining(java.util.function.Consumer<? super K> action) |
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)
Skips the given number of elements.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
add, remove, set
public boolean hasNext()
public boolean hasPrevious()
BidirectionalIterator
hasPrevious
in interface BidirectionalIterator<K>
hasPrevious
in interface java.util.ListIterator<K>
ListIterator.hasPrevious()
public K next()
public K previous()
BidirectionalIterator
previous
in interface BidirectionalIterator<K>
previous
in interface java.util.ListIterator<K>
ListIterator.previous()
public int nextIndex()
nextIndex
in interface java.util.ListIterator<K>
public int previousIndex()
previousIndex
in interface java.util.ListIterator<K>
public int skip(int n)
ObjectBidirectionalIterator
The effect of this call is exactly the same as that of calling Iterator.next()
for n
times (possibly stopping if Iterator.hasNext()
becomes false).
skip
in interface ObjectBidirectionalIterator<K>
skip
in interface ObjectIterator<K>
n
- the number of elements to skip.Iterator.next()
public int back(int n)
ObjectBidirectionalIterator
The effect of this call is exactly the same as that of
calling BidirectionalIterator.previous()
for n
times (possibly stopping
if BidirectionalIterator.hasPrevious()
becomes false).
back
in interface ObjectBidirectionalIterator<K>
n
- the number of elements to skip back.BidirectionalIterator.previous()
public void forEachRemaining(java.util.function.Consumer<? super K> action)
forEachRemaining
in interface java.util.Iterator<K>
public java.lang.Object clone()
clone
in class java.lang.Object