Package org.apache.commons.lang3
Class CharRange.CharacterIterator
- java.lang.Object
-
- org.apache.commons.lang3.CharRange.CharacterIterator
-
- All Implemented Interfaces:
java.util.Iterator<java.lang.Character>
- Enclosing class:
- CharRange
private static class CharRange.CharacterIterator extends java.lang.Object implements java.util.Iterator<java.lang.Character>
CharacterIterator
.#NotThreadSafe#
-
-
Constructor Summary
Constructors Modifier Constructor Description private
CharacterIterator(CharRange r)
Constructs a new iterator for the character range.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasNext()
Has the iterator not reached the end character yet?java.lang.Character
next()
Returns the next character in the iterationprivate void
prepareNext()
Prepares the next character in the range.void
remove()
Always throws UnsupportedOperationException.
-
-
-
Field Detail
-
current
private char current
The current character
-
range
private final CharRange range
-
hasNext
private boolean hasNext
-
-
Constructor Detail
-
CharacterIterator
private CharacterIterator(CharRange r)
Constructs a new iterator for the character range.- Parameters:
r
- The character range
-
-
Method Detail
-
prepareNext
private void prepareNext()
Prepares the next character in the range.
-
hasNext
public boolean hasNext()
Has the iterator not reached the end character yet?- Specified by:
hasNext
in interfacejava.util.Iterator<java.lang.Character>
- Returns:
true
if the iterator has yet to reach the character date
-
next
public java.lang.Character next()
Returns the next character in the iteration- Specified by:
next
in interfacejava.util.Iterator<java.lang.Character>
- Returns:
Character
for the next character
-
remove
public void remove()
Always throws UnsupportedOperationException.- Specified by:
remove
in interfacejava.util.Iterator<java.lang.Character>
- Throws:
java.lang.UnsupportedOperationException
- Always thrown.- See Also:
Iterator.remove()
-
-