Class RuleBasedBreakIterator.BreakCache

    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BreakCache

        BreakCache()
    • 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)