| java.lang.Object java.text.StringCharacterIterator
StringCharacterIterator | final public class StringCharacterIterator implements CharacterIterator(Code) | | StringCharacterIterator is an implementation of CharacterIterator for
Strings.
|
Constructor Summary | |
public | StringCharacterIterator(String value) Constructs a new StringCharacterIterator on the specified String. | public | StringCharacterIterator(String value, int location) Constructs a new StringCharacterIterator on the specified String with the
current index set to the specified value. | public | StringCharacterIterator(String value, int start, int end, int location) Constructs a new StringCharacterIterator on the specified String with the
begin, end and current index set to the specified values. |
Method Summary | |
public Object | clone() Answers a new StringCharacterIterator with the same source String, begin,
end, and current index as this StringCharacterIterator. | public char | current() Answers the character at the current index in the source String. | public boolean | equals(Object object) Compares the specified object to this StringCharacterIterator and answer
if they are equal. | public char | first() Sets the current position to the begin index and answers the character at
the begin index. | public int | getBeginIndex() Answers the begin index in the source String. | public int | getEndIndex() Answers the end index in the source String. | public int | getIndex() Answers the current index in the source String. | public int | hashCode() Answers an integer hash code for the receiver. | public char | last() Sets the current position to the end index - 1 and answers the character
at the current position. | public char | next() Increments the current index and returns the character at the new index. | public char | previous() Decrements the current index and returns the character at the new index. | public char | setIndex(int location) Sets the current index in the source String. | public void | setText(String value) Sets the source String to iterate. |
startendoffset | int startendoffset(Code) | | |
StringCharacterIterator | public StringCharacterIterator(String value)(Code) | | Constructs a new StringCharacterIterator on the specified String. The
begin and current indexes are set to the beginning of the String, the end
index is set to the length of the String.
Parameters: value - the new source String to iterate |
StringCharacterIterator | public StringCharacterIterator(String value, int location)(Code) | | Constructs a new StringCharacterIterator on the specified String with the
current index set to the specified value. The begin index is set to the
beginning of the String, the end index is set to the length of the String.
Parameters: value - the new source String to iterate Parameters: location - the current index exception: IllegalArgumentException - when the current index is less than zero or greater thanthe length of the String |
StringCharacterIterator | public StringCharacterIterator(String value, int start, int end, int location)(Code) | | Constructs a new StringCharacterIterator on the specified String with the
begin, end and current index set to the specified values.
Parameters: value - the new source String to iterate Parameters: start - the index of the first character to iterate Parameters: end - the index one past the last character to iterate Parameters: location - the current index exception: IllegalArgumentException - when the begin index is less than zero, the end index isgreater than the String length, the begin index is greaterthan the end index, the current index is less than thebegin index or greater than the end index |
clone | public Object clone()(Code) | | Answers a new StringCharacterIterator with the same source String, begin,
end, and current index as this StringCharacterIterator.
a shallow copy of this StringCharacterIterator See Also: java.lang.Cloneable |
current | public char current()(Code) | | Answers the character at the current index in the source String.
the current character, or DONE if the current index is past theend |
equals | public boolean equals(Object object)(Code) | | Compares the specified object to this StringCharacterIterator and answer
if they are equal. The object must be a StringCharacterIterator iterating
over the same sequence of characters with the same index.
Parameters: object - the object to compare with this object true if the specified object is equal to thisStringCharacterIterator, false otherwise See Also: StringCharacterIterator.hashCode |
first | public char first()(Code) | | Sets the current position to the begin index and answers the character at
the begin index.
the character at the begin index |
getBeginIndex | public int getBeginIndex()(Code) | | Answers the begin index in the source String.
the index of the first character to iterate |
getEndIndex | public int getEndIndex()(Code) | | Answers the end index in the source String.
the index one past the last character to iterate |
getIndex | public int getIndex()(Code) | | Answers the current index in the source String.
the current index |
hashCode | public int hashCode()(Code) | | Answers an integer hash code for the receiver. Objects which are equal
answer the same value for this method.
the receiver's hash See Also: StringCharacterIterator.equals |
last | public char last()(Code) | | Sets the current position to the end index - 1 and answers the character
at the current position.
the character before the end index |
next | public char next()(Code) | | Increments the current index and returns the character at the new index.
the character at the next index, or DONE if the next index ispast the end |
previous | public char previous()(Code) | | Decrements the current index and returns the character at the new index.
the character at the previous index, or DONE if the previousindex is past the beginning |
setIndex | public char setIndex(int location)(Code) | | Sets the current index in the source String.
the character at the new index, or DONE if the index is past theend exception: IllegalArgumentException - when the new index is less than the begin index or greaterthan the end index |
setText | public void setText(String value)(Code) | | Sets the source String to iterate. The begin and end positions are set to
the start and end of this String.
Parameters: value - the new source String |
|
|