FileDocCategorySizeDatePackage
CharacterIterator.javaAPI DocAndroid 1.5 API3918Wed May 06 22:41:06 BST 2009java.text

CharacterIterator

public interface CharacterIterator implements Cloneable
An interface for the bidirectional iteration over a group of characters. The iteration starts at the begin index in the group of characters and continues to one index before the end index.
since
Android 1.0

Fields Summary
public static final char
DONE
A constant which indicates that there is no character at the current index.
Constructors Summary
Methods Summary
public java.lang.Objectclone()
Returns a new {@code CharacterIterator} with the same properties.

return
a shallow copy of this character iterator.
see
java.lang.Cloneable
since
Android 1.0

public charcurrent()
Returns the character at the current index.

return
the current character, or {@code DONE} if the current index is past the beginning or end of the sequence.
since
Android 1.0

public charfirst()
Sets the current position to the begin index and returns the character at the new position.

return
the character at the begin index.
since
Android 1.0

public intgetBeginIndex()
Returns the begin index.

return
the index of the first character of the iteration.
since
Android 1.0

public intgetEndIndex()
Returns the end index.

return
the index one past the last character of the iteration.
since
Android 1.0

public intgetIndex()
Returns the current index.

return
the current index.
since
Android 1.0

public charlast()
Sets the current position to the end index - 1 and returns the character at the new position.

return
the character before the end index.
since
Android 1.0

public charnext()
Increments the current index and returns the character at the new index.

return
the character at the next index, or {@code DONE} if the next index would be past the end.
since
Android 1.0

public charprevious()
Decrements the current index and returns the character at the new index.

return
the character at the previous index, or {@code DONE} if the previous index would be past the beginning.
since
Android 1.0

public charsetIndex(int location)
Sets the current index to a new position and returns the character at the new index.

param
location the new index that this character iterator is set to.
return
the character at the new index, or {@code DONE} if the index is past the end.
exception
IllegalArgumentException if {@code location} is less than the begin index or greater than the end index.
since
Android 1.0