Interface CharIterator
-
- All Known Subinterfaces:
CharBidirectionalIterator
,CharListIterator
- All Known Implementing Classes:
AbstractCharBidirectionalIterator
,AbstractCharIterator
,AbstractCharListIterator
,CharIterators.EmptyIterator
,CharIterators.UnmodifiableBidirectionalIterator
,CharIterators.UnmodifiableIterator
,CharIterators.UnmodifiableListIterator
public interface CharIterator extends Iterator<Character>
A type-specificIterator
; provides an additional method to avoid (un)boxing, and the possibility to skip elements.- See Also:
Iterator
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description char
nextChar()
Returns the next element as a primitive type.int
skip(int n)
Skips the given number of elements.-
Methods inherited from interface java.util.Iterator
forEachRemaining, hasNext, next, remove
-
-
-
-
Method Detail
-
nextChar
char nextChar()
Returns the next element as a primitive type.- Returns:
- the next element in the iteration.
- See Also:
Iterator.next()
-
skip
int skip(int n)
Skips the given number of elements.The effect of this call is exactly the same as that of calling
Iterator.next()
forn
times (possibly stopping ifIterator.hasNext()
becomes false).- Parameters:
n
- the number of elements to skip.- Returns:
- the number of elements actually skipped.
- See Also:
Iterator.next()
-
-