Class SplittingBreakIterator
- java.lang.Object
-
- java.text.BreakIterator
-
- org.apache.lucene.search.uhighlight.SplittingBreakIterator
-
- All Implemented Interfaces:
Cloneable
public class SplittingBreakIterator extends BreakIterator
Virtually 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.- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
-
Field Summary
-
Fields inherited from class java.text.BreakIterator
DONE
-
-
Constructor Summary
Constructors Constructor Description SplittingBreakIterator(BreakIterator baseIter, char sliceChar)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcurrent()intfirst()intfollowing(int offset)CharacterIteratorgetText()intlast()intnext()intnext(int n)intpreceding(int offset)intprevious()voidsetText(String newText)voidsetText(CharacterIterator newText)-
Methods inherited from class java.text.BreakIterator
clone, getAvailableLocales, getCharacterInstance, getCharacterInstance, getLineInstance, getLineInstance, getSentenceInstance, getSentenceInstance, getWordInstance, getWordInstance, isBoundary
-
-
-
-
Constructor Detail
-
SplittingBreakIterator
public SplittingBreakIterator(BreakIterator baseIter, char sliceChar)
-
-
Method Detail
-
setText
public void setText(CharacterIterator newText)
- Specified by:
setTextin classBreakIterator
-
setText
public void setText(String newText)
- Overrides:
setTextin classBreakIterator
-
getText
public CharacterIterator getText()
- Specified by:
getTextin classBreakIterator
-
current
public int current()
- Specified by:
currentin classBreakIterator
-
first
public int first()
- Specified by:
firstin classBreakIterator
-
last
public int last()
- Specified by:
lastin classBreakIterator
-
next
public int next()
- Specified by:
nextin classBreakIterator
-
previous
public int previous()
- Specified by:
previousin classBreakIterator
-
following
public int following(int offset)
- Specified by:
followingin classBreakIterator
-
preceding
public int preceding(int offset)
- Overrides:
precedingin classBreakIterator
-
next
public int next(int n)
- Specified by:
nextin classBreakIterator
-
-