Package com.ibm.icu.text
Class RuleBasedBreakIterator.DictionaryCache
- java.lang.Object
-
- com.ibm.icu.text.RuleBasedBreakIterator.DictionaryCache
-
- Enclosing class:
- RuleBasedBreakIterator
class RuleBasedBreakIterator.DictionaryCache extends java.lang.Object
DictionaryCache stores the boundaries obtained from a run of dictionary characters. Dictionary boundaries are moved first to this cache, then from here to the main BreakCache, where they may inter-leave with non-dictionary boundaries. The public BreakIterator API always fetches directly from the main BreakCache, not from here. In common situations, the number of boundaries in a single dictionary run should be quite small, it will be terminated by punctuation, spaces, or any other non-dictionary characters. The main BreakCache may end up with boundaries from multiple dictionary based runs. The boundaries are stored in a simple ArrayList (vector), with the assumption that they will be accessed sequentially.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) int
fBoundary
(package private) DictionaryBreakEngine.DequeI
fBreaks
(package private) int
fFirstRuleStatusIndex
(package private) int
fLimit
(package private) int
fOtherRuleStatusIndex
(package private) int
fPositionInCache
(package private) int
fStart
(package private) int
fStatusIndex
-
Constructor Summary
Constructors Constructor Description DictionaryCache()
DictionaryCache(RuleBasedBreakIterator.DictionaryCache src)
copy constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) boolean
following(int fromPos)
(package private) void
populateDictionary(int startPos, int endPos, int firstRuleStatus, int otherRuleStatus)
Populate the cache with the dictionary based boundaries within a region of text.(package private) boolean
preceding(int fromPos)
(package private) void
reset()
-
-
-
Field Detail
-
fBreaks
DictionaryBreakEngine.DequeI fBreaks
-
fPositionInCache
int fPositionInCache
-
fStart
int fStart
-
fLimit
int fLimit
-
fFirstRuleStatusIndex
int fFirstRuleStatusIndex
-
fOtherRuleStatusIndex
int fOtherRuleStatusIndex
-
fBoundary
int fBoundary
-
fStatusIndex
int fStatusIndex
-
-
Constructor Detail
-
DictionaryCache
DictionaryCache()
-
DictionaryCache
DictionaryCache(RuleBasedBreakIterator.DictionaryCache src)
copy constructor. Used by RuleBasedBreakIterator.clone().- Parameters:
src
- the source object to be copied.
-
-
Method Detail
-
reset
void reset()
-
following
boolean following(int fromPos)
-
preceding
boolean preceding(int fromPos)
-
populateDictionary
void populateDictionary(int startPos, int endPos, int firstRuleStatus, int otherRuleStatus)
Populate the cache with the dictionary based boundaries within a region of text.- Parameters:
startPos
- The start position of a range of textendPos
- The end position of a range of textfirstRuleStatus
- The rule status index that applies to the break at startPosotherRuleStatus
- The rule status index that applies to boundaries other than startPos
-
-