| Modifier and Type | Field and Description |
|---|---|
| private final int | |
| private int | |
| private final int | |
| private final char[] |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Object | Returns: copy of this iteratorOverrides com. Replaceableobject
|
| public int | current()
Implements abstract com. |
| 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 | 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. |
| limit | back to summary |
|---|---|
| private final int limit | |
| pos | back to summary |
|---|---|
| private int pos | |
| start | back to summary |
|---|---|
| private final int start | |
| text | back to summary |
|---|---|
| private final char[] text | |
| UCharArrayIterator | back to summary |
|---|---|
| public UCharArrayIterator(char[] text, int start, int limit) | |
| clone | back to summary |
|---|---|
| public Object clone() Overrides com. Creates a copy of this iterator, does not clone the underlying
| |
| 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.
| |
| 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()];
}
}
| |
| 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.
| |