code: @Override
      public int preceding(int offset) {
          CharacterIterator text = getText();
  
          // if we have no cached break positions, or "offset" is outside the
          // range covered by the cache, we can just call the inherited routine
          // (which will eventually call other routines in this class that may
          // refresh the cache)
          if (fCachedBreakPositions == null || offset <= fCachedBreakPositions[0] ||
                  offset > fCachedBreakPositions[fCachedBreakPositions.length - 1]) {
              fCachedBreakPositions = null;
              return rulesPreceding(offset);
          }
  
          // on the other hand, if "offset" is within the range covered by the cache,
          // then all we have to do is search the cache for the last break position
          // before "offset"
          else {
              fPositionInCache = 0;
              while (fPositionInCache < fCachedBreakPositions.length
                     && offset > fCachedBreakPositions[fPositionInCache])
                  ++fPositionInCache;
              --fPositionInCache;
              text.setIndex(fCachedBreakPositions[fPositionInCache]);
              return text.getIndex();
          }
      }
docs: Sets the iterator to refer to the last boundary position before the
  specified position.
  @param offset The position to begin searching for a break from.
  @return The position of the last boundary before the starting position.