|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.text.BreakIterator
java.text.SimpleTextBoundary
SimpleTextBoundary is an implementation of the BreakIterator protocol. SimpleTextBoundary uses a state machine to compute breaks. There are currently several subclasses of SimpleTextBoundary that compute breaks for sentences, words, lines, and characters. They are accessable through static functions of SimpleTextBoundary.
BreakIterator| Nested Class Summary |
| Nested classes inherited from class java.text.BreakIterator |
|
| Field Summary | |
private TextBoundaryData |
data
|
private static char |
END_OF_STRING
|
private int |
pos
|
private CharacterIterator |
text
|
| Fields inherited from class java.text.BreakIterator |
DONE |
| Constructor Summary | |
protected |
SimpleTextBoundary(TextBoundaryData data)
Create a SimpleTextBoundary using the specified tables. |
| Method Summary | |
Object |
clone()
Overrides Cloneable |
int |
current()
Return the boundary last returned by previous or next |
boolean |
equals(Object obj)
Compares the equality of two SimpleTextBoundary objects. |
int |
first()
Return the first boundary. |
int |
following(int offset)
Return the first boundary after the specified offset |
CharacterIterator |
getText()
Get the text being scanned by the enumeration |
int |
hashCode()
Compute a hashcode for this enumeration |
boolean |
isBoundary(int offset)
Return true if the specified position is a boundary position. |
int |
last()
Return the last boundary. |
protected int |
mappedChar(char c)
|
int |
next()
Return the next text boundary |
int |
next(int increment)
Return the nth boundary from the current boundary |
private int |
nextPosition(int offset)
|
int |
preceding(int offset)
Return the last boundary preceding the specified offset |
int |
previous()
Return the boundary preceding the last boundary |
private int |
previousSafePosition(int offset)
|
void |
setText(CharacterIterator newText)
Set a new text to scan. |
void |
setText(String newText)
Set a new text string for enumeration. |
| Methods inherited from class java.text.BreakIterator |
getAvailableLocales, getCharacterInstance, getCharacterInstance, getLineInstance, getLineInstance, getSentenceInstance, getSentenceInstance, getWordInstance, getWordInstance |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private transient int pos
private transient CharacterIterator text
private TextBoundaryData data
private static final char END_OF_STRING
| Constructor Detail |
protected SimpleTextBoundary(TextBoundaryData data)
data - data used for boundary determination| Method Detail |
public boolean equals(Object obj)
equals in class Objectobj - the SimpleTextBoundary object to be compared with.
Object.hashCode(),
Hashtablepublic int hashCode()
hashCode in class ObjectObject.equals(java.lang.Object),
Hashtablepublic Object clone()
clone in class BreakIteratorpublic CharacterIterator getText()
getText in class BreakIteratorpublic void setText(String newText)
setText in class BreakIteratornewText - new text to scan.public void setText(CharacterIterator newText)
setText in class BreakIteratornewText - new text to scan.public int first()
first in class BreakIteratorpublic int last()
last in class BreakIteratorpublic int next(int increment)
next in class BreakIteratorincrement - which boundary to return. A value of 0
does nothing. Negative values move to previous boundaries
and positive values move to later boundaries.
public int previous()
previous in class BreakIteratorpublic int next()
next in class BreakIteratorpublic boolean isBoundary(int offset)
isBoundary in class BreakIteratoroffset - the offset to check.
public int following(int offset)
following in class BreakIteratoroffset - the offset to start
public int preceding(int offset)
preceding in class BreakIteratoroffset - the offset to start
public int current()
current in class BreakIteratorprivate int previousSafePosition(int offset)
private int nextPosition(int offset)
protected int mappedChar(char c)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||