| Modifier and Type | Class and Description |
|---|---|
| public static class |
| Modifier and Type | Field and Description |
|---|---|
| private CharsTrie | |
| private BreakIterator | |
| private CharsTrie | |
| private UCharacterIterator |
| Access | Constructor and Description |
|---|---|
| public | SimpleFilteredSentenceBreakIterator(BreakIterator
break iterator to adopt adoptBreakIterator, CharsTrie forward & partial char trie to adopt forwardsPartialTrie, CharsTrie backward trie to adopt backwardsTrie)
|
| Modifier and Type | Method and Description |
|---|---|
| private final boolean | |
| public Object | |
| public int | current()
Implements abstract com. |
| public boolean | equals(Object
the reference object with which to compare. obj)Overrides java. |
| public int | first()
Implements abstract com. |
| public int | following(int
The character position to start searching from. offset)Implements abstract com. |
| public CharacterIterator | getText()
Implements abstract com. |
| public int | |
| private final int | Returns: new break position or BreakIterator.DONEinitial position from delegate n)Given that the delegate has already given its "initial" answer, find the NEXT actual (non-suppressed) break. |
| private final int | Returns: new break position or BreakIterator.DONEinitial position from delegate n)Given that the delegate has already given its "initial" answer, find the PREV actual (non-suppressed) break. |
| public boolean | isBoundary(int
the offset to check. offset)Overrides com. |
| public int | last()
Implements abstract com. |
| public int | next()
Implements abstract com. |
| public int | next(int
The number of boundaries to advance over (if positive, moves
forward; if negative, moves backwards). n)Implements abstract com. |
| public int | preceding(int
The character position to start searching from. offset)Overrides com. |
| public int | previous()
Implements abstract com. |
| private final void | |
| public void | setText(CharacterIterator
A CharacterIterator referring to the text
to analyze with this BreakIterator (the iterator's current
position is ignored, but its other state is significant). newText)Implements abstract com. |
| backwardsTrie | back to summary |
|---|---|
| private CharsTrie backwardsTrie | |
| delegate | back to summary |
|---|---|
| private BreakIterator delegate | |
| forwardsPartialTrie | back to summary |
|---|---|
| private CharsTrie forwardsPartialTrie | |
| text | back to summary |
|---|---|
| private UCharacterIterator text | |
| SimpleFilteredSentenceBreakIterator | back to summary |
|---|---|
public SimpleFilteredSentenceBreakIterator(BreakIterator adoptBreakIterator, CharsTrie forwardsPartialTrie, CharsTrie backwardsTrie)
| |
| breakExceptionAt | back to summary |
|---|---|
| private final boolean breakExceptionAt(int n) Is there an exception at this point?
| |
| clone | back to summary |
|---|---|
| public Object clone() Overrides com. Doc from com. Clone method. Creates another BreakIterator with the same behavior and current state as this one. | |
| current | back to summary |
|---|---|
| public int current() Implements abstract com. Doc from com. Return the iterator's current position.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| first | back to summary |
|---|---|
| public int first() Implements abstract com. Doc from com. Set the iterator to the first boundary position. This is always the beginning index of the text this iterator iterates over. For example, if the iterator iterates over a whole string, this function will always return 0.
| |
| following | back to summary |
|---|---|
| public int following(int offset) Implements abstract com. Doc from com. Sets the iterator's current iteration position to be the first boundary position following the specified position. (Whether the specified position is itself a boundary position or not doesn't matter-- this function always moves the iteration position to the first boundary after the specified position.) If the specified position is the past-the-end position, returns DONE.
| |
| getText | back to summary |
|---|---|
| public CharacterIterator getText() Implements abstract com. Doc from com. Returns a CharacterIterator over the text being analyzed. Caution The state of the returned CharacterIterator must not be modified in any way while the BreakIterator is still in use. Doing so will lead to undefined behavior of the BreakIterator. Clone the returned CharacterIterator first and work with that. The returned CharacterIterator is a reference to the actual iterator being used by the BreakIterator. No guarantees are made about the current position of this iterator when it is returned; it may differ from the BreakIterators current position. If you need to move that position to examine the text, clone this function's return value first.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| internalNext | back to summary |
|---|---|
| private final int internalNext(int n) Given that the delegate has already given its "initial" answer, find the NEXT actual (non-suppressed) break.
| |
| internalPrev | back to summary |
|---|---|
| private final int internalPrev(int n) Given that the delegate has already given its "initial" answer, find the PREV actual (non-suppressed) break.
| |
| isBoundary | back to summary |
|---|---|
| public boolean isBoundary(int offset) Overrides com. Doc from com. Return true if the specified position is a boundary position. If the function returns true, the current iteration position is set to the specified position; if the function returns false, the current iteration position is set as though following() had been called.
| |
| last | back to summary |
|---|---|
| public int last() Implements abstract com. Doc from com. Set the iterator to the last boundary position. This is always the "past-the-end" index of the text this iterator iterates over. For example, if the iterator iterates over a whole string (call it "text"), this function will always return text.length().
| |
| next | back to summary |
|---|---|
| public int next() Implements abstract com. Doc from com. Advances the iterator forward one boundary. The current iteration position is updated to point to the next boundary position after the current position, and this is also the value that is returned. If the current position is equal to the value returned by last(), or to DONE, this function returns DONE and sets the current position to DONE.
| |
| next | back to summary |
|---|---|
| public int next(int n) Implements abstract com. Doc from com. Move the iterator by the specified number of steps in the text. A positive number moves the iterator forward; a negative number moves the iterator backwards. If this causes the iterator to move off either end of the text, this function returns DONE; otherwise, this function returns the position of the appropriate boundary. Calling this function is equivalent to calling next() or previous() n times.
| |
| preceding | back to summary |
|---|---|
| public int preceding(int offset) Overrides com. Doc from com. Sets the iterator's current iteration position to be the last boundary position preceding the specified position. (Whether the specified position is itself a boundary position or not doesn't matter-- this function always moves the iteration position to the last boundary before the specified position.) If the specified position is the starting position, returns DONE.
| |
| previous | back to summary |
|---|---|
| public int previous() Implements abstract com. Doc from com. Move the iterator backward one boundary. The current iteration position is updated to point to the last boundary position before the current position, and this is also the value that is returned. If the current position is equal to the value returned by first(), or to DONE, this function returns DONE and sets the current position to DONE.
| |
| resetState | back to summary |
|---|---|
| private final void resetState() Reset the filter from the delegate. | |
| setText | back to summary |
|---|---|
| public void setText(CharacterIterator newText) Implements abstract com. Doc from com. Sets the iterator to analyze a new piece of text. This function resets the current iteration position to the beginning of the text. (The old iterator is dropped.) Caution The supplied CharacterIterator is used directly by the BreakIterator, and must not be altered in any way by code outside of the BreakIterator. Doing so will lead to undefined behavior of the BreakIterator.
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final int | |
| private HashSet | filterSet
filter set to store all exceptions |
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv static final int |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | suppressBreakAfter(CharSequence
the string to suppress, such as "Mr." str)Implements abstract com. |
| public boolean | unsuppressBreakAfter(CharSequence
the str the string to unsuppress, such as "Mr." str)Implements abstract com. |
| public BreakIterator | wrapIteratorWithFilter(BreakIterator
the break iterator to wrap adoptBreakIterator)Implements abstract com. |
| AddToForward | back to summary |
|---|---|
| pack-priv static final int AddToForward | |
| filterSet | back to summary |
|---|---|
| private HashSet<CharSequence> filterSet filter set to store all exceptions | |
| MATCH | back to summary |
|---|---|
| pack-priv static final int MATCH | |
| PARTIAL | back to summary |
|---|---|
| pack-priv static final int PARTIAL | |
| SuppressInReverse | back to summary |
|---|---|
| pack-priv static final int SuppressInReverse | |
| Builder | back to summary |
|---|---|
| public Builder(Locale loc) | |
| Builder | back to summary |
|---|---|
| public Builder(ULocale loc) Create SimpleFilteredBreakIteratorBuilder using given locale
| |
| Builder | back to summary |
|---|---|
| public Builder() Create SimpleFilteredBreakIteratorBuilder with no exception | |
| suppressBreakAfter | back to summary |
|---|---|
| public boolean suppressBreakAfter(CharSequence str) Implements abstract com. Doc from com. Suppress a certain string from being the end of a segment. For example, suppressing "Mr.", then segments ending in "Mr." will not be returned by the iterator.
| |
| unsuppressBreakAfter | back to summary |
|---|---|
| public boolean unsuppressBreakAfter(CharSequence str) Implements abstract com. Doc from com. Stop suppressing a certain string from being the end of the segment. This function does not create any new segment boundaries, but only serves to un-do the effect of earlier calls to suppressBreakAfter, or to un-do the effect of locale data which may be suppressing certain strings.
| |
| wrapIteratorWithFilter | back to summary |
|---|---|
| public BreakIterator wrapIteratorWithFilter(BreakIterator adoptBreakIterator) Implements abstract com. Doc from com. Wrap (adopt) an existing break iterator in a new filtered instance. Note that the wrappedBreakIterator is adopted by the new BreakIterator and should no longer be used by the caller. The FilteredBreakIteratorBuilder may be reused.
| |