| Modifier and Type | Field and Description |
|---|---|
| private CharacterIterator |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Object | |
| public int | current()
Implements abstract com. |
| public CharacterIterator | getCharacterIterator()
Overrides com. java.text.CharacterIterator object for the underlying text of this iterator.
|
| public int | getIndex()
Implements abstract com. |
| public int | getLength()
Implements abstract com. |
| public int | getText(char[]
an array of chars to fill with the underlying UTF-16 code units. fillIn, int the position within the array to start putting the data. offset)Implements abstract com. |
| public int | moveIndex(int
the number of code units to move the current index. delta)
Moves the current position by the number of code units specified, either forward or backward depending on the
sign of delta (positive or negative respectively).
|
| public int | next()
Implements abstract com. Implements com. |
| public int | previous()
Implements abstract com. |
| public void | setIndex(int
the index within the text. index)Implements abstract com. |
| public void | setToLimit()
Sets the current index to the limit.
|
| iterator | back to summary |
|---|---|
| private CharacterIterator iterator | |
| CharacterIteratorWrapper | back to summary |
|---|---|
| public CharacterIteratorWrapper(CharacterIterator iter) | |
| clone | back to summary |
|---|---|
| public Object clone() Overrides com. Creates a clone of this iterator. Clones the underlying character iterator.
| |
| current | back to summary |
|---|---|
| public int current() Implements abstract com. Doc from com. Returns the code unit at the current index. If index is out of range, returns DONE. Index is not changed.
| |
| getCharacterIterator | back to summary |
|---|---|
| public CharacterIterator getCharacterIterator() Overrides com. Doc from com. Returns a
| |
| getIndex | back to summary |
|---|---|
| public int getIndex() Implements abstract com. Doc from com. Gets the current index in text.
| |
| getLength | back to summary |
|---|---|
| public int getLength() Implements abstract com. Doc from com. Returns the length of the text
| |
| getText | back to summary |
|---|---|
| public int getText(char[] fillIn, int offset) Implements abstract com. Doc from com. Fills the buffer with the underlying text storage of the iterator If the buffer capacity is not enough a
exception is thrown. The capacity of the fill in buffer should at least be equal to length of text in the
iterator obtained by calling
UChacterIterator iter = new UCharacterIterator.getInstance(text);
char[] buf = new char[iter.getLength()];
iter.getText(buf);
OR
char[] buf= new char[1];
int len = 0;
for(;;){
try{
len = iter.getText(buf);
break;
}catch(IndexOutOfBoundsException e){
buf = new char[iter.getLength()];
}
}
| |
| moveIndex | back to summary |
|---|---|
| public int moveIndex(int delta) Overrides com. Doc from com. Moves the current position by the number of code units specified, either forward or backward depending on the sign of delta (positive or negative respectively). If the resulting index would be less than zero, the index is set to zero, and if the resulting index would be greater than limit, the index is set to limit.
| |
| next | back to summary |
|---|---|
| public int next() Implements abstract com. Implements com. Doc from com. Returns the UTF16 code unit at index, and increments to the next code unit (post-increment semantics). If index is out of range, DONE is returned, and the iterator is reset to the limit of the text.
| |
| previous | back to summary |
|---|---|
| public int previous() Implements abstract com. Doc from com. Decrement to the position of the previous code unit in the text, and return it (pre-decrement semantics). If the resulting index is less than 0, the index is reset to 0 and DONE is returned.
| |
| setIndex | back to summary |
|---|---|
| public void setIndex(int index) Implements abstract com. Doc from com. Sets the index to the specified index in the text.
| |
| setToLimit | back to summary |
|---|---|
| public void setToLimit() Overrides com. Doc from com. Sets the current index to the limit.
| |