Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
com.ibm.icu.text.BreakIterator
com.ibm.icu.text.RuleBasedBreakIterator
com.ibm.icu.text.RuleBasedBreakIterator_New
public class RuleBasedBreakIterator_New
extends RuleBasedBreakIterator
Field Summary | |
static boolean |
|
Fields inherited from class com.ibm.icu.text.RuleBasedBreakIterator | |
WORD_IDEO , WORD_IDEO_LIMIT , WORD_KANA , WORD_KANA_LIMIT , WORD_LETTER , WORD_LETTER_LIMIT , WORD_NONE , WORD_NONE_LIMIT , WORD_NUMBER , WORD_NUMBER_LIMIT |
Fields inherited from class com.ibm.icu.text.BreakIterator | |
DONE , KIND_CHARACTER , KIND_LINE , KIND_SENTENCE , KIND_TITLE , KIND_WORD |
Method Summary | |
protected static void |
|
Object |
|
int |
|
void |
|
boolean |
|
int |
|
int |
|
static RuleBasedBreakIterator |
|
int |
|
int |
|
CharacterIterator |
|
int |
|
boolean |
|
int |
|
int |
|
int |
|
int |
|
int |
|
void |
|
String |
|
Methods inherited from class com.ibm.icu.text.RuleBasedBreakIterator | |
clone , current , equals , first , following , getInstanceFromCompiledRules , getRuleStatus , getRuleStatusVec , getText , hashCode , isBoundary , last , next , next , preceding , previous , setText , toString |
Methods inherited from class com.ibm.icu.text.BreakIterator | |
clone , current , first , following , getAvailableLocales , getAvailableULocales , getCharacterInstance , getCharacterInstance , getCharacterInstance , getLineInstance , getLineInstance , getLineInstance , getLocale , getSentenceInstance , getSentenceInstance , getSentenceInstance , getText , getTitleInstance , getTitleInstance , getTitleInstance , getWordInstance , getWordInstance , getWordInstance , isBoundary , last , next , next , preceding , previous , registerInstance , registerInstance , setText , setText , unregister |
protected static final void checkOffset(int offset, CharacterIterator text)
Throw IllegalArgumentException unless begin <= offset <32end.
public Object clone()
Clones this iterator.
- Overrides:
- clone in interface RuleBasedBreakIterator
- Returns:
- A newly-constructed RuleBasedBreakIterator with the same behavior as this one.
public int current()
Returns the current iteration position.
- Overrides:
- current in interface RuleBasedBreakIterator
- Returns:
- The current iteration position.
public void dump()
Dump the contents of the state table and character classes for this break iterator. For debugging only.
public boolean equals(Object that)
Returns true if both BreakIterators are of the same class, have the same rules, and iterate over the same text.
- Overrides:
- equals in interface RuleBasedBreakIterator
public int first()
Sets the current iteration position to the beginning of the text. (i.e., the CharacterIterator's starting offset).
- Overrides:
- first in interface RuleBasedBreakIterator
- Returns:
- The offset of the beginning of the text.
public int following(int offset)
Sets the iterator to refer to the first boundary position following the specified position.
- Overrides:
- following in interface RuleBasedBreakIterator
- Parameters:
offset
- The position from which to begin searching for a break position.
- Returns:
- The position of the first break after the current position.
public static RuleBasedBreakIterator getInstanceFromCompiledRules(InputStream is) throws IOException
Create a break iterator from a precompiled set of rules.
- Overrides:
- getInstanceFromCompiledRules in interface RuleBasedBreakIterator
public int getRuleStatus()
Return the status tag from the break rule that determined the most recently returned break position. The values appear in the rule source within brackets, {123}, for example. For rules that do not specify a status, a default value of 0 is returned. If more than one rule applies, the numerically largest of the possible status values is returned. Of the standard types of ICU break iterators, only the word break iterator provides status values. The values are defined in class RuleBasedBreakIterator, and allow distinguishing between words that contain alphabetic letters, "words" that appear to be numbers, punctuation and spaces, words containing ideographic characters, and more. CallgetRuleStatus
after obtaining a boundary position fromnext()
,
previous()
, or any other break iterator functions that returns a boundary position.
- Overrides:
- getRuleStatus in interface RuleBasedBreakIterator
- Returns:
- the status from the break rule that determined the most recently returned break position.
public int getRuleStatusVec(int[] fillInArray)
Get the status (tag) values from the break rule(s) that determined the most recently returned break position. The values appear in the rule source within brackets, {123}, for example. The default status value for rules that do not explicitly provide one is zero. The status values used by the standard ICU break rules are defined as public constants in class RuleBasedBreakIterator. If the size of the output array is insufficient to hold the data, the output will be truncated to the available length. No exception will be thrown.
- Overrides:
- getRuleStatusVec in interface RuleBasedBreakIterator
- Parameters:
fillInArray
- an array to be filled in with the status values.
- Returns:
- The number of rule status values from rules that determined the most recent boundary returned by the break iterator. In the event that the array is too small, the return value is the total number of status values that were available, not the reduced number that were actually returned.
public CharacterIterator getText()
Return a CharacterIterator over the text being analyzed. This version of this method returns the actual CharacterIterator we're using internally. Changing the state of this iterator can have undefined consequences. If you need to change it, clone it first.
- Overrides:
- getText in interface RuleBasedBreakIterator
- Returns:
- An iterator over the text being analyzed.
public int hashCode()
Compute a hashcode for this BreakIterator
- Overrides:
- hashCode in interface RuleBasedBreakIterator
- Returns:
- A hash code
public boolean isBoundary(int offset)
Returns true if the specfied position is a boundary position. As a side effect, leaves the iterator pointing to the first boundary position at or after "offset".
- Overrides:
- isBoundary in interface RuleBasedBreakIterator
- Parameters:
offset
- the offset to check.
- Returns:
- True if "offset" is a boundary position.
public int last()
Sets the current iteration position to the end of the text. (i.e., the CharacterIterator's ending offset).
- Overrides:
- last in interface RuleBasedBreakIterator
- Returns:
- The text's past-the-end offset.
public int next()
Advances the iterator to the next boundary position.
- Overrides:
- next in interface RuleBasedBreakIterator
- Returns:
- The position of the first boundary after this one.
public int next(int n)
Advances the iterator either forward or backward the specified number of steps. Negative values move backward, and positive values move forward. This is equivalent to repeatedly calling next() or previous().
- Overrides:
- next in interface RuleBasedBreakIterator
- Parameters:
n
- The number of steps to move. The sign indicates the direction (negative is backwards, and positive is forwards).
- Returns:
- The character offset of the boundary position n boundaries away from the current one.
public int preceding(int offset)
Sets the iterator to refer to the last boundary position before the specified position.
- Overrides:
- preceding in interface RuleBasedBreakIterator
- Parameters:
offset
- The position to begin searching for a break from.
- Returns:
- The position of the last boundary before the starting position.
public int previous()
Moves the iterator backwards, to the last boundary preceding this one.
- Overrides:
- previous in interface RuleBasedBreakIterator
- Returns:
- The position of the last boundary position preceding this one.
public void setText(CharacterIterator newText)
Set the iterator to analyze a new piece of text. This function resets the current iteration position to the beginning of the text.
- Overrides:
- setText in interface RuleBasedBreakIterator
- Parameters:
newText
- An iterator over the text to analyze.
public String toString()
Returns the description (rules) used to create this iterator. (In ICU4C, the same function is RuleBasedBreakIterator::getRules())
- Overrides:
- toString in interface RuleBasedBreakIterator