|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.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 determinationMethod Detail |
public boolean equals(Object obj)
equals
in class Object
obj
- the SimpleTextBoundary object to be compared with.
Object.hashCode()
,
Hashtable
public int hashCode()
hashCode
in class Object
Object.equals(java.lang.Object)
,
Hashtable
public Object clone()
clone
in class BreakIterator
public CharacterIterator getText()
getText
in class BreakIterator
public void setText(String newText)
setText
in class BreakIterator
newText
- new text to scan.public void setText(CharacterIterator newText)
setText
in class BreakIterator
newText
- new text to scan.public int first()
first
in class BreakIterator
public int last()
last
in class BreakIterator
public int next(int increment)
next
in class BreakIterator
increment
- 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 BreakIterator
public int next()
next
in class BreakIterator
public boolean isBoundary(int offset)
isBoundary
in class BreakIterator
offset
- the offset to check.
public int following(int offset)
following
in class BreakIterator
offset
- the offset to start
public int preceding(int offset)
preceding
in class BreakIterator
offset
- the offset to start
public int current()
current
in class BreakIterator
private 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 |