Build 1.0_r1(from source)

java.text
Class RuleBasedBreakIterator

java.lang.Object
  extended by java.text.BreakIterator
      extended by java.text.RuleBasedBreakIterator
All Implemented Interfaces:
Cloneable

 class RuleBasedBreakIterator
extends BreakIterator


Field Summary
 
Fields inherited from class java.text.BreakIterator
DONE, wrapped
 
Constructor Summary
RuleBasedBreakIterator(com.ibm.icu4jni.text.BreakIterator iterator)
           
 
Method Summary
 Object clone()
          Create copy of this iterator, all status including current position is kept.
 int current()
          Return this iterator's current position.
 boolean equals(Object o)
          Compares the argument to the receiver, and returns true if they represent the same object using a class specific comparison.
 int first()
          Set this iterator's current position to the first boundary, and return this position.
 int following(int offset)
          Set the position of the first boundary following the given offset, and return this position.
 CharacterIterator getText()
          Return a CharacterIterator which represents the text being analyzed.
 int hashCode()
          Returns an integer hash code for the receiver.
 boolean isBoundary(int offset)
          Return true if the given offset is a boundary position.
 int last()
          Set this iterator's current position to the last boundary, and return this position.
 int next()
          Set this iterator's current position to the next boundary after current position, and return this position.
 int next(int n)
          Set this iterator's current position to the next boundary after the given position, and return this position.
 int preceding(int offset)
          Return the position of last boundary precede the given offset, and set current position to returned value, or DONE if the given offset specifies the starting position.
 int previous()
          Set this iterator's current position to the previous boundary before current position, and return this position.
 void setText(CharacterIterator newText)
          Set new text to be analyzed by given CharacterIterator.
 String toString()
          Returns a string containing a concise, human-readable description of the receiver.
 
Methods inherited from class java.text.BreakIterator
getAvailableLocales, getCharacterInstance, getCharacterInstance, getInt, getLineInstance, getLineInstance, getLong, getSentenceInstance, getSentenceInstance, getShort, getWordInstance, getWordInstance, setText
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RuleBasedBreakIterator

RuleBasedBreakIterator(com.ibm.icu4jni.text.BreakIterator iterator)
Method Detail

current

public int current()
Description copied from class: BreakIterator
Return this iterator's current position.

Specified by:
current in class BreakIterator
Returns:
this iterator's current position

first

public int first()
Description copied from class: BreakIterator
Set this iterator's current position to the first boundary, and return this position.

Specified by:
first in class BreakIterator
Returns:
the position of first boundary

following

public int following(int offset)
Description copied from class: BreakIterator
Set the position of the first boundary following the given offset, and return this position. If there is no boundary after the given offset, return DONE.

IllegalArgumentException will be thrown if given offset is invalid.

Specified by:
following in class BreakIterator
Parameters:
offset - the given position to be searched for
Returns:
the position of the first boundary following the given offset

getText

public CharacterIterator getText()
Description copied from class: BreakIterator
Return a CharacterIterator which represents the text being analyzed. Please note that the returned value is probably the internal iterator used by this object, so that if the invoker want to modify the status of the returned iterator, a clone operation at first is recommended.

Specified by:
getText in class BreakIterator
Returns:
a CharacterIterator which represents the text being analyzed.

last

public int last()
Description copied from class: BreakIterator
Set this iterator's current position to the last boundary, and return this position.

Specified by:
last in class BreakIterator
Returns:
the position of last boundary

next

public int next()
Description copied from class: BreakIterator
Set this iterator's current position to the next boundary after current position, and return this position. Return DONE if no boundary found after current position.

Specified by:
next in class BreakIterator
Returns:
the position of last boundary

next

public int next(int n)
Description copied from class: BreakIterator
Set this iterator's current position to the next boundary after the given position, and return this position. Return DONE if no boundary found after the given position.

Specified by:
next in class BreakIterator
Parameters:
n - the given position.
Returns:
the position of last boundary

previous

public int previous()
Description copied from class: BreakIterator
Set this iterator's current position to the previous boundary before current position, and return this position. Return DONE if no boundary found before current position.

Specified by:
previous in class BreakIterator
Returns:
the position of last boundary

setText

public void setText(CharacterIterator newText)
Description copied from class: BreakIterator
Set new text to be analyzed by given CharacterIterator. The position will be reset to the beginning of the new text, and other status of this iterator will be kept.

Specified by:
setText in class BreakIterator
Parameters:
newText - the given CharacterIterator refer to the text to be analyzed

isBoundary

public boolean isBoundary(int offset)
Description copied from class: BreakIterator
Return true if the given offset is a boundary position. If this method returns true, the current iteration position is set to the given position; if the function returns false, the current iteration position is set as though following() had been called.

Overrides:
isBoundary in class BreakIterator
Parameters:
offset - the given offset to check
Returns:
true if the given offset is a boundary position

preceding

public int preceding(int offset)
Description copied from class: BreakIterator
Return the position of last boundary precede the given offset, and set current position to returned value, or DONE if the given offset specifies the starting position.

IllegalArgumentException will be thrown if given offset is invalid.

Overrides:
preceding in class BreakIterator
Parameters:
offset - the given start position to be searched for
Returns:
the position of last boundary precede the given offset

equals

public boolean equals(Object o)
Description copied from class: Object
Compares the argument to the receiver, and returns true if they represent the same object using a class specific comparison. The implementation in Object returns true only if the argument is the exact same object as the receiver (==).

Overrides:
equals in class Object
Parameters:
o - Object the object to compare with this object.
Returns:
boolean true if the object is the same as this object false if it is different from this object.
See Also:
Object.hashCode()

toString

public String toString()
Description copied from class: Object
Returns a string containing a concise, human-readable description of the receiver.

Overrides:
toString in class Object
Returns:
String a printable representation for the receiver.

hashCode

public int hashCode()
Description copied from class: Object
Returns an integer hash code for the receiver. Any two objects which answer true when passed to .equals must answer the same value for this method.

Overrides:
hashCode in class Object
Returns:
int the receiver's hash.
See Also:
Object.equals(java.lang.Object)

clone

public Object clone()
Description copied from class: BreakIterator
Create copy of this iterator, all status including current position is kept.

Overrides:
clone in class BreakIterator
Returns:
copy of this iterator

Build 1.0_r1(from source)

Please submit a feedback, bug or feature