Class SplittingBreakIterator
- java.lang.Object
-
- java.text.BreakIterator
-
- org.apache.lucene.search.uhighlight.SplittingBreakIterator
-
- All Implemented Interfaces:
java.lang.Cloneable
public class SplittingBreakIterator extends java.text.BreakIteratorVirtually slices the text on both sides of every occurrence of the specified character. If the slice is 0-length which happens for adjacent slice characters or when they are at the beginning or end, that character is reported as a boundary. For every slice between the specified characters, it is further processed with a specified BreakIterator. A consequence is that the enclosed BreakIterator will never "see" the splitting character.
Note:setText(CharacterIterator)is unsupported. Use the string version.
-
-
Field Summary
Fields Modifier and Type Field Description private java.text.BreakIteratorbaseIterprivate intcurrentprivate charsliceCharprivate intsliceEndIdxprivate intsliceStartIdxprivate java.lang.Stringtext
-
Constructor Summary
Constructors Constructor Description SplittingBreakIterator(java.text.BreakIterator baseIter, char sliceChar)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcurrent()intfirst()intfollowing(int offset)java.text.CharacterIteratorgetText()intlast()intnext()intnext(int n)intpreceding(int offset)intprevious()voidsetText(java.lang.String newText)voidsetText(java.text.CharacterIterator newText)
-
-
-
Method Detail
-
setText
public void setText(java.text.CharacterIterator newText)
- Specified by:
setTextin classjava.text.BreakIterator
-
setText
public void setText(java.lang.String newText)
- Overrides:
setTextin classjava.text.BreakIterator
-
getText
public java.text.CharacterIterator getText()
- Specified by:
getTextin classjava.text.BreakIterator
-
current
public int current()
- Specified by:
currentin classjava.text.BreakIterator
-
first
public int first()
- Specified by:
firstin classjava.text.BreakIterator
-
last
public int last()
- Specified by:
lastin classjava.text.BreakIterator
-
next
public int next()
- Specified by:
nextin classjava.text.BreakIterator
-
previous
public int previous()
- Specified by:
previousin classjava.text.BreakIterator
-
following
public int following(int offset)
- Specified by:
followingin classjava.text.BreakIterator
-
preceding
public int preceding(int offset)
- Overrides:
precedingin classjava.text.BreakIterator
-
next
public int next(int n)
- Specified by:
nextin classjava.text.BreakIterator
-
-