public class LengthGoalBreakIterator
extends java.text.BreakIterator
BreakIterator to skip past breaks that would result in passages that are too
short. It's still possible to get a short passage but only at the very end of the input text.
Important: This is not a general purpose BreakIterator; it's only designed to work in a way
compatible with the UnifiedHighlighter. Some assumptions are checked with Java assertions.
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
clone() |
static LengthGoalBreakIterator |
createClosestToLength(java.text.BreakIterator baseIter,
int targetLength)
Breaks will be on average
targetLength apart; the closest break to this target (before or after)
is chosen. |
static LengthGoalBreakIterator |
createMinLength(java.text.BreakIterator baseIter,
int minLength)
Breaks will be at least
minLength apart (to the extent possible). |
int |
current() |
int |
first() |
int |
following(int followingIdx) |
java.text.CharacterIterator |
getText() |
boolean |
isBoundary(int offset) |
int |
last() |
int |
next() |
int |
next(int n) |
int |
preceding(int offset) |
int |
previous() |
void |
setText(java.text.CharacterIterator newText) |
void |
setText(java.lang.String newText) |
java.lang.String |
toString() |
public static LengthGoalBreakIterator createMinLength(java.text.BreakIterator baseIter, int minLength)
minLength apart (to the extent possible).public static LengthGoalBreakIterator createClosestToLength(java.text.BreakIterator baseIter, int targetLength)
targetLength apart; the closest break to this target (before or after)
is chosen.public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.Object clone()
clone in class java.text.BreakIteratorpublic java.text.CharacterIterator getText()
getText in class java.text.BreakIteratorpublic void setText(java.lang.String newText)
setText in class java.text.BreakIteratorpublic void setText(java.text.CharacterIterator newText)
setText in class java.text.BreakIteratorpublic int current()
current in class java.text.BreakIteratorpublic int first()
first in class java.text.BreakIteratorpublic int last()
last in class java.text.BreakIteratorpublic int next(int n)
next in class java.text.BreakIteratorpublic int next()
next in class java.text.BreakIteratorpublic int previous()
previous in class java.text.BreakIteratorpublic int following(int followingIdx)
following in class java.text.BreakIteratorpublic int preceding(int offset)
preceding in class java.text.BreakIteratorpublic boolean isBoundary(int offset)
isBoundary in class java.text.BreakIteratorCopyright © 2000–2025 The Apache Software Foundation. All rights reserved.