All Packages Class Hierarchy This Package Previous Next Index
Class jp.kyasu.graphics.TextCharacterIterator
java.lang.Object
|
+----jp.kyasu.graphics.TextCharacterIterator
- public class TextCharacterIterator
- extends Object
- implements CharacterIterator
The TextCharacterIterator
implements the
CharacterIterater
protocol for an array of characters.
- Version:
- 10 Jun 1998
- Author:
- Kazuki YASUMATSU
-
TextCharacterIterator(char[])
- Construct an iterator over the specified array of characters,
with an initial index of 0.
-
TextCharacterIterator(char[], int)
- Construct an iterator over the specified array of characters,
with the specified initial index.
-
TextCharacterIterator(char[], int, int, int)
- Construct an iterator over the specified range of the specified array
of characters, with the index set at the specified position.
-
TextCharacterIterator(Text)
- Construct an iterator over the specified text object,
with an initial index of 0.
-
TextCharacterIterator(Text, int)
- Construct an iterator over the specified text object,
with the specified initial index.
-
TextCharacterIterator(Text, int, int, int)
- Construct an iterator over the specified range of the specified text
object, with the index set at the specified position.
-
clone()
- Returns a clone of this object.
-
current()
- Returns the character at the current position
(as returned by getIndex()).
-
equals(Object)
- Compares two objects for equality.
-
first()
- Set the position to getBeginIndex() and return the character at that
position.
-
getBeginIndex()
- Return the start index of the array of characters.
-
getEndIndex()
- Return the end index of the array of characters.
-
getIndex()
- Return the current index.
-
getText()
- Returns the text to be iterated over.
-
hashCode()
- Returns a hashcode for this object.
-
last()
- Set the position to getEndIndex() and return the character at that
position.
-
next()
- Increment the iterator's index by one and return the character
at the new index.
-
previous()
- Decrement the iterator's index by one and return the character
at the new index.
-
setIndex(int)
- Set the position to specified position in the array of characters
and return that character.
TextCharacterIterator
public TextCharacterIterator(Text text)
- Construct an iterator over the specified text object,
with an initial index of 0.
- Parameters:
- text - the text object to be iterated over.
TextCharacterIterator
public TextCharacterIterator(Text text,
int pos)
- Construct an iterator over the specified text object,
with the specified initial index.
- Parameters:
- text - the text object to be iterated over.
- pos - initial iterator position.
TextCharacterIterator
public TextCharacterIterator(Text text,
int begin,
int end,
int pos)
- Construct an iterator over the specified range of the specified text
object, with the index set at the specified position.
- Parameters:
- text - the text object to be iterated over.
- begin - index of the first character.
- end - index of the character following the last character.
- pos - initial iterator position.
TextCharacterIterator
public TextCharacterIterator(char array[])
- Construct an iterator over the specified array of characters,
with an initial index of 0.
- Parameters:
- array - the array of characters to be iterated over.
TextCharacterIterator
public TextCharacterIterator(char array[],
int pos)
- Construct an iterator over the specified array of characters,
with the specified initial index.
- Parameters:
- array - the array of characters to be iterated over.
- pos - initial iterator position.
TextCharacterIterator
public TextCharacterIterator(char array[],
int begin,
int end,
int pos)
- Construct an iterator over the specified range of the specified array
of characters, with the index set at the specified position.
- Parameters:
- array - the array of characters to be iterated over.
- begin - index of the first character.
- end - index of the character following the last character.
- pos - initial iterator position.
getText
public final Text getText()
- Returns the text to be iterated over.
- Returns:
- the text to be iterated over.
first
public final char first()
- Set the position to getBeginIndex() and return the character at that
position.
- Returns:
- the character at the position to getBeginIndex().
last
public final char last()
- Set the position to getEndIndex() and return the character at that
position.
- Returns:
- the character at the position to getEndIndex().
setIndex
public final char setIndex(int p)
- Set the position to specified position in the array of characters
and return that character.
- Parameters:
- p - the position.
- Returns:
- the character at the position.
current
public final char current()
- Returns the character at the current position
(as returned by getIndex()).
- Returns:
- the character at the current position or DONE if the current
position is off the end of the array of characters.
next
public final char next()
- Increment the iterator's index by one and return the character
at the new index. If the resulting index is greater or equal
to getEndIndex(), the current index is reset to getEndIndex() and
a value of DONE is returned.
- Returns:
- the character at the new position or DONE if the current
position is off the end of the array of characters.
previous
public final char previous()
- Decrement the iterator's index by one and return the character
at the new index. If the resulting index is less than
getBeginIndex(), the current index is reset to getBeginIndex()
and a value of DONE is returned.
- Returns:
- the character at the new position or DONE if the current
position is off the end of the array of characters.
getBeginIndex
public final int getBeginIndex()
- Return the start index of the array of characters.
- Returns:
- the index at which the array of characters begins.
getEndIndex
public final int getEndIndex()
- Return the end index of the array of characters. This index is
the index of the first character following the end of the
array of characters.
- Returns:
- the index at which the array of characters end.
getIndex
public final int getIndex()
- Return the current index.
- Returns:
- the current index.
hashCode
public int hashCode()
- Returns a hashcode for this object.
- Overrides:
- hashCode in class Object
equals
public boolean equals(Object anObject)
- Compares two objects for equality.
- Overrides:
- equals in class Object
clone
public Object clone()
- Returns a clone of this object.
- Returns:
- a clone of this object.
- Overrides:
- clone in class Object
All Packages Class Hierarchy This Package Previous Next Index