|
|
|||||||||
| 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.ReplaceableUCharacterIterator
public class 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?!?!?!
| Field Summary |
|---|
| Fields inherited from class sun.text.normalizer.UCharacterIterator |
|---|
DONE |
| Constructor Summary | |
|---|---|
ReplaceableUCharacterIterator(String str)
Public constructor |
|
ReplaceableUCharacterIterator(StringBuffer buf)
Public constructor |
|
| Method Summary | |
|---|---|
Object |
clone()
Creates a copy of this iterator, does not clone the underlying Replaceableobject |
int |
current()
Returns the current UTF16 character. |
int |
getIndex()
Gets the current currentIndex 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 next UTF16 character and increments the iterator's currentIndex by 1. |
int |
previous()
Returns previous UTF16 character and decrements the iterator's currentIndex by 1. |
void |
setIndex(int currentIndex)
Sets the currentIndex to the specified currentIndex in the text and returns that single UTF16 character at currentIndex. |
| 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 ReplaceableUCharacterIterator(String str)
str - text which the iterator will be based onpublic ReplaceableUCharacterIterator(StringBuffer buf)
buf - buffer of text on which the iterator will be based| Method Detail |
|---|
public Object clone()
Replaceableobject
clone in class UCharacterIteratorpublic int current()
current in class UCharacterIteratorpublic int getLength()
getLength in class UCharacterIteratorpublic int getIndex()
getIndex in class UCharacterIteratorpublic int next()
next in class UCharacterIteratorpublic int previous()
previous in class UCharacterIteratorpublic void setIndex(int currentIndex)
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.
setIndex in class UCharacterIteratorcurrentIndex - the currentIndex within the text.
IllegalArgumentException - is thrown if an invalid currentIndex is
supplied. i.e. currentIndex is out of bounds.
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.
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||