public static class LongIterators.EmptyIterator extends java.lang.Object implements LongListIterator, 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 java.lang.Long> action)
Deprecated.
|
void |
forEachRemaining(java.util.function.LongConsumer action) |
boolean |
hasNext() |
boolean |
hasPrevious()
Returns whether there is a previous element.
|
int |
nextIndex() |
long |
nextLong()
Returns the next element as a primitive type.
|
int |
previousIndex() |
long |
previousLong()
Returns the previous element as a primitive type.
|
int |
skip(int n)
Skips the given number of elements.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
add, add, next, previous, remove, set, set
forEachRemaining
public boolean hasNext()
hasNext
in interface java.util.Iterator<java.lang.Long>
hasNext
in interface java.util.ListIterator<java.lang.Long>
public boolean hasPrevious()
BidirectionalIterator
hasPrevious
in interface BidirectionalIterator<java.lang.Long>
hasPrevious
in interface java.util.ListIterator<java.lang.Long>
ListIterator.hasPrevious()
public long nextLong()
LongIterator
nextLong
in interface LongIterator
nextLong
in interface java.util.PrimitiveIterator.OfLong
Iterator.next()
public long previousLong()
LongBidirectionalIterator
previousLong
in interface LongBidirectionalIterator
ListIterator.previous()
public int nextIndex()
nextIndex
in interface java.util.ListIterator<java.lang.Long>
public int previousIndex()
previousIndex
in interface java.util.ListIterator<java.lang.Long>
public int skip(int n)
LongBidirectionalIterator
The effect of this call is exactly the same as that of calling LongIterator.next()
for n
times (possibly stopping if Iterator.hasNext()
becomes false).
skip
in interface LongBidirectionalIterator
skip
in interface LongIterator
skip
in interface ObjectBidirectionalIterator<java.lang.Long>
skip
in interface ObjectIterator<java.lang.Long>
n
- the number of elements to skip.Iterator.next()
public int back(int n)
LongBidirectionalIterator
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).
back
in interface LongBidirectionalIterator
back
in interface ObjectBidirectionalIterator<java.lang.Long>
n
- the number of elements to skip back.LongBidirectionalIterator.previous()
public void forEachRemaining(java.util.function.LongConsumer action)
forEachRemaining
in interface java.util.PrimitiveIterator<java.lang.Long,java.util.function.LongConsumer>
forEachRemaining
in interface java.util.PrimitiveIterator.OfLong
@Deprecated public void forEachRemaining(java.util.function.Consumer<? super java.lang.Long> action)
LongIterator
forEachRemaining
in interface LongIterator
forEachRemaining
in interface java.util.Iterator<java.lang.Long>
forEachRemaining
in interface java.util.PrimitiveIterator.OfLong
public java.lang.Object clone()
clone
in class java.lang.Object