Class RuleBasedBreakIterator.DictionaryCache

java.lang.Object
com.ibm.icu.text.RuleBasedBreakIterator.DictionaryCache
Enclosing class:
RuleBasedBreakIterator

class RuleBasedBreakIterator.DictionaryCache extends 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 Details

    • fBreaks

    • fPositionInCache

      int fPositionInCache
    • fStart

      int fStart
    • fLimit

      int fLimit
    • fFirstRuleStatusIndex

      int fFirstRuleStatusIndex
    • fOtherRuleStatusIndex

      int fOtherRuleStatusIndex
    • fBoundary

      int fBoundary
    • fStatusIndex

      int fStatusIndex
  • Constructor Details

    • DictionaryCache

      DictionaryCache()
    • DictionaryCache

      copy constructor. Used by RuleBasedBreakIterator.clone().
      Parameters:
      src - the source object to be copied.
  • Method Details

    • 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 text
      endPos - The end position of a range of text
      firstRuleStatus - The rule status index that applies to the break at startPos
      otherRuleStatus - The rule status index that applies to boundaries other than startPos