public static class CharIterators.EmptyIterator extends java.lang.Object implements CharListIterator, 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(CharConsumer action)
Performs the given action for each remaining element until all elements
have been processed or the action throws an exception.
|
void |
forEachRemaining(java.util.function.Consumer<? super java.lang.Character> action)
Deprecated.
|
boolean |
hasNext() |
boolean |
hasPrevious()
Returns whether there is a previous element.
|
char |
nextChar()
Returns the next element as a primitive type.
|
int |
nextIndex() |
char |
previousChar()
Returns the previous element as a primitive type.
|
int |
previousIndex() |
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.Character>
hasNext
in interface java.util.ListIterator<java.lang.Character>
public boolean hasPrevious()
BidirectionalIterator
hasPrevious
in interface BidirectionalIterator<java.lang.Character>
hasPrevious
in interface java.util.ListIterator<java.lang.Character>
ListIterator.hasPrevious()
public char nextChar()
CharIterator
nextChar
in interface CharIterator
Iterator.next()
public char previousChar()
CharBidirectionalIterator
previousChar
in interface CharBidirectionalIterator
ListIterator.previous()
public int nextIndex()
nextIndex
in interface java.util.ListIterator<java.lang.Character>
public int previousIndex()
previousIndex
in interface java.util.ListIterator<java.lang.Character>
public int skip(int n)
CharBidirectionalIterator
The effect of this call is exactly the same as that of calling CharIterator.next()
for n
times (possibly stopping if Iterator.hasNext()
becomes false).
skip
in interface CharBidirectionalIterator
skip
in interface CharIterator
skip
in interface ObjectBidirectionalIterator<java.lang.Character>
skip
in interface ObjectIterator<java.lang.Character>
n
- the number of elements to skip.Iterator.next()
public int back(int n)
CharBidirectionalIterator
The effect of this call is exactly the same as that of
calling CharBidirectionalIterator.previous()
for n
times (possibly stopping
if BidirectionalIterator.hasPrevious()
becomes false).
back
in interface CharBidirectionalIterator
back
in interface ObjectBidirectionalIterator<java.lang.Character>
n
- the number of elements to skip back.CharBidirectionalIterator.previous()
public void forEachRemaining(CharConsumer action)
CharIterator
forEachRemaining
in interface CharIterator
forEachRemaining
in interface java.util.PrimitiveIterator<java.lang.Character,CharConsumer>
action
- the action to be performed for each element.Iterator.forEachRemaining(java.util.function.Consumer)
@Deprecated public void forEachRemaining(java.util.function.Consumer<? super java.lang.Character> action)
CharIterator
forEachRemaining
in interface CharIterator
forEachRemaining
in interface java.util.Iterator<java.lang.Character>
public java.lang.Object clone()
clone
in class java.lang.Object