Package com.ibm.icu.text
Class RuleBasedBreakIterator.BreakCache
- java.lang.Object
-
- com.ibm.icu.text.RuleBasedBreakIterator.BreakCache
-
- Enclosing class:
- RuleBasedBreakIterator
class RuleBasedBreakIterator.BreakCache extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static int
CACHE_SIZE
(package private) int[]
fBoundaries
(package private) int
fBufIdx
(package private) int
fEndBufIdx
(package private) DictionaryBreakEngine.DequeI
fSideBuffer
(package private) int
fStartBufIdx
(package private) short[]
fStatuses
(package private) int
fTextIdx
(package private) static boolean
RetainCachePosition
(package private) static boolean
UpdateCachePosition
-
Constructor Summary
Constructors Constructor Description BreakCache()
BreakCache(RuleBasedBreakIterator.BreakCache src)
copy constructor, used from RuleBasedBreakIterator.clone().
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (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
dumpCache()
(package private) void
following(int startPos)
private int
modChunkSize(int index)
(package private) void
next()
(package private) boolean
populateFollowing()
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
populatePreceding()
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 Detail
-
RetainCachePosition
static final boolean RetainCachePosition
- See Also:
- Constant Field Values
-
UpdateCachePosition
static final boolean UpdateCachePosition
- See Also:
- Constant Field Values
-
CACHE_SIZE
static final int CACHE_SIZE
- See Also:
- Constant Field Values
-
fStartBufIdx
int fStartBufIdx
-
fEndBufIdx
int fEndBufIdx
-
fTextIdx
int fTextIdx
-
fBufIdx
int fBufIdx
-
fBoundaries
int[] fBoundaries
-
fStatuses
short[] fStatuses
-
fSideBuffer
DictionaryBreakEngine.DequeI fSideBuffer
-
-
Constructor Detail
-
BreakCache
BreakCache()
-
BreakCache
BreakCache(RuleBasedBreakIterator.BreakCache src)
copy constructor, used from RuleBasedBreakIterator.clone().- Parameters:
src
-
-
-
Method Detail
-
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)
-
-