Package com.ibm.icu.text
Class RuleBasedBreakIterator.BreakCache
java.lang.Object
com.ibm.icu.text.RuleBasedBreakIterator.BreakCache
- Enclosing class:
RuleBasedBreakIterator
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final int
(package private) int[]
(package private) int
(package private) int
(package private) DictionaryBreakEngine.DequeI
(package private) int
(package private) short[]
(package private) int
(package private) static final boolean
(package private) static final boolean
-
Constructor Summary
ConstructorsConstructorDescriptioncopy constructor, used from RuleBasedBreakIterator.clone(). -
Method Summary
Modifier and TypeMethodDescription(package private) void
addFollowing
(int position, int ruleStatusIdx, boolean update) Add the boundary following the current position.(package private) boolean
addPreceding
(int position, int ruleStatusIdx, boolean update) Add the boundary preceding the current position.(package private) int
current()
Update the state of the public BreakIterator (fBI) to reflect the current state of the break iterator cache (this).(package private) void
(package private) void
following
(int startPos) private final int
modChunkSize
(int index) (package private) void
next()
(package private) boolean
Add boundary(s) to the cache following the current last boundary.(package private) boolean
populateNear
(int position) Add boundaries to the cache near the specified position.(package private) boolean
Add one or more boundaries to the cache preceding the first currently cached boundary.(package private) void
preceding
(int startPos) (package private) void
previous()
(package private) void
reset()
(package private) void
reset
(int pos, int ruleStatus) (package private) boolean
seek
(int pos) Set the cache position to the specified position, or, if the position falls between to cached boundaries, to the preceding boundary.
-
Field Details
-
RetainCachePosition
static final boolean RetainCachePosition- See Also:
-
UpdateCachePosition
static final boolean UpdateCachePosition- See Also:
-
CACHE_SIZE
static final int CACHE_SIZE- See Also:
-
fStartBufIdx
int fStartBufIdx -
fEndBufIdx
int fEndBufIdx -
fTextIdx
int fTextIdx -
fBufIdx
int fBufIdx -
fBoundaries
int[] fBoundaries -
fStatuses
short[] fStatuses -
fSideBuffer
DictionaryBreakEngine.DequeI fSideBuffer
-
-
Constructor Details
-
BreakCache
BreakCache() -
BreakCache
BreakCache(RuleBasedBreakIterator.BreakCache src) copy constructor, used from RuleBasedBreakIterator.clone().- Parameters:
src
-
-
-
Method Details
-
reset
void reset(int pos, int ruleStatus) -
reset
void reset() -
next
void next() -
previous
void previous() -
following
void following(int startPos) -
preceding
void preceding(int startPos) -
current
int current()Update the state of the public BreakIterator (fBI) to reflect the current state of the break iterator cache (this). -
populateNear
boolean populateNear(int position) Add boundaries to the cache near the specified position. The given position need not be a boundary itself. The input position must be within the range of the text, and on a code point boundary. If the requested position is a break boundary, leave the iteration position on it. If the requested position is not a boundary, leave the iteration position on the preceding boundary and include both the the preceding and following boundaries in the cache. Additional boundaries, either preceding or following, may be added to the cache as a side effect. Return false if the operation failed. -
populateFollowing
boolean populateFollowing()Add boundary(s) to the cache following the current last boundary. Return false if at the end of the text, and no more boundaries can be added. Leave iteration position at the first newly added boundary, or unchanged if no boundary was added. -
populatePreceding
boolean populatePreceding()Add one or more boundaries to the cache preceding the first currently cached boundary. Leave the iteration position on the first added boundary. Return false if no boundaries could be added (if at the start of the text.) -
addFollowing
void addFollowing(int position, int ruleStatusIdx, boolean update) Add the boundary following the current position. The current position can be left as it was, or changed to the newly added boundary, as specified by the update parameter. -
addPreceding
boolean addPreceding(int position, int ruleStatusIdx, boolean update) Add the boundary preceding the current position. The current position can be left as it was, or changed to the newly added boundary, as specified by the update parameter. -
seek
boolean seek(int pos) Set the cache position to the specified position, or, if the position falls between to cached boundaries, to the preceding boundary. Fails if the requested position is outside of the range of boundaries currently held by the cache. The startPosition must be on a code point boundary. Return true if successful, false if the specified position is after the last cached boundary or before the first. -
dumpCache
void dumpCache() -
modChunkSize
private final int modChunkSize(int index)
-