public interface CharacterIterator extends Cloneable
Modifier and Type | Field and Description |
---|---|
static char |
DONE
A constant which indicates that there is no character at the current
index.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Returns a new
CharacterIterator with the same properties. |
char |
current()
Returns the character at the current index.
|
char |
first()
Sets the current position to the begin index and returns the character at
the new position.
|
int |
getBeginIndex()
Returns the begin index.
|
int |
getEndIndex()
Returns the end index.
|
int |
getIndex()
Returns the current index.
|
char |
last()
Sets the current position to the end index - 1 and returns the character
at the new position.
|
char |
next()
Increments the current index and returns the character at the new index.
|
char |
previous()
Decrements the current index and returns the character at the new index.
|
char |
setIndex(int location)
Sets the current index to a new position and returns the character at the
new index.
|
static final char DONE
Object clone()
CharacterIterator
with the same properties.Cloneable
char current()
DONE
if the current index is
past the beginning or end of the sequence.char first()
int getBeginIndex()
int getEndIndex()
int getIndex()
char last()
char next()
DONE
if the next
index would be past the end.char previous()
DONE
if the
previous index would be past the beginning.char setIndex(int location)
location
- the new index that this character iterator is set to.DONE
if the index is
past the end.IllegalArgumentException
- if location
is less than the begin index or greater than
the end index.