|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectsun.text.normalizer.UCharacterIterator
sun.text.normalizer.CharacterIteratorWrapper
public class CharacterIteratorWrapper
This class is a wrapper around CharacterIterator and implements the UCharacterIterator protocol
| Field Summary |
|---|
| Fields inherited from class sun.text.normalizer.UCharacterIterator |
|---|
DONE |
| Constructor Summary | |
|---|---|
CharacterIteratorWrapper(CharacterIterator iter)
|
|
| Method Summary | |
|---|---|
Object |
clone()
Creates a clone of this iterator. |
int |
current()
Returns the code unit at the current index. |
int |
getIndex()
Gets the current index in text. |
int |
getLength()
Returns the length of the text |
int |
getText(char[] fillIn,
int offset)
Fills the buffer with the underlying text storage of the iterator If the buffer capacity is not enough a exception is thrown. |
int |
next()
Returns the UTF16 code unit at index, and increments to the next code unit (post-increment semantics). |
int |
previous()
Decrement to the position of the previous code unit in the text, and return it (pre-decrement semantics). |
void |
setIndex(int index)
Sets the index to the specified index in the text. |
| Methods inherited from class sun.text.normalizer.UCharacterIterator |
|---|
getInstance, getInstance, getInstance, getText, getText, moveIndex, nextCodePoint |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CharacterIteratorWrapper(CharacterIterator iter)
| Method Detail |
|---|
public int current()
UCharacterIterator
current in class UCharacterIteratorUCharacterIterator.current()public int getLength()
UCharacterIterator
getLength in class UCharacterIteratorUCharacterIterator.getLength()public int getIndex()
UCharacterIterator
getIndex in class UCharacterIteratorUCharacterIterator.getIndex()public int next()
UCharacterIterator
next in class UCharacterIteratorUCharacterIterator.next()public int previous()
UCharacterIterator
previous in class UCharacterIteratorUCharacterIterator.previous()public void setIndex(int index)
UCharacterIterator
setIndex in class UCharacterIteratorindex - the index within the text.UCharacterIterator.setIndex(int)
public int getText(char[] fillIn,
int offset)
UCharacterIteratorgetLength().
Usage:
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()];
}
}
getText in class UCharacterIteratorfillIn - an array of chars to fill with the underlying UTF-16 code
units.offset - the position within the array to start putting the data.
UCharacterIterator.getText(char[])public Object clone()
clone in class UCharacterIteratorUCharacterIterator.clone()
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||