java.lang.Object | ||
↳ | sun.text.normalizer.UCharacterIterator | |
↳ | sun.text.normalizer.ReplaceableUCharacterIterator |
DLF docs must define behavior when Replaceable is mutated underneath the iterator. This and ICUCharacterIterator share some code, maybe they should share an implementation, or the common state and implementation should be moved up into UCharacterIterator. What are first, last, and getBeginIndex doing here?!?!?!
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
sun.text.normalizer.UCharacterIterator
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public constructor
| |||||||||||
Public constructor
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a copy of this iterator, does not clone the underlying
Replaceable object | |||||||||||
Returns the current UTF16 character.
| |||||||||||
Gets the current currentIndex in text.
| |||||||||||
Returns the length of the text
| |||||||||||
Fills the buffer with the underlying text storage of the iterator
If the buffer capacity is not enough a exception is thrown.
| |||||||||||
Returns next UTF16 character and increments the iterator's currentIndex by 1.
| |||||||||||
Returns previous UTF16 character and decrements the iterator's currentIndex by
1.
| |||||||||||
Sets the currentIndex to the specified currentIndex in the text and returns that single UTF16 character at currentIndex. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
sun.text.normalizer.UCharacterIterator
| |||||||||||
From class
java.lang.Object
|
Public constructor
str | text which the iterator will be based on |
---|
Public constructor
buf | buffer of text on which the iterator will be based |
---|
Creates a copy of this iterator, does not clone the underlying
Replaceable
object
Returns the current UTF16 character.
Gets the current currentIndex in text.
Returns the length of the text
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 getLength()
.
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()];
}
}
fillIn | an array of chars to fill with the underlying UTF-16 code units. |
---|---|
offset | the position within the array to start putting the data. |
Returns next UTF16 character and increments the iterator's currentIndex by 1. If the resulting currentIndex is greater or equal to the text length, the currentIndex is reset to the text length and a value of DONECODEPOINT is returned.
Returns previous UTF16 character and decrements the iterator's currentIndex by 1. If the resulting currentIndex is less than 0, the currentIndex is reset to 0 and a value of DONECODEPOINT is returned.
Sets the currentIndex to the specified currentIndex in the text and returns that single UTF16 character at currentIndex. This assumes the text is stored as 16-bit code units.
currentIndex | the currentIndex within the text. |
---|
IllegalArgumentException | is thrown if an invalid currentIndex is supplied. i.e. currentIndex is out of bounds. |
---|