@Override public int preceding(int offset){
  CharacterIterator text=getText();
  checkOffset(offset,text);
  if (cachedBreakPositions == null || offset <= cachedBreakPositions[0] || offset > cachedBreakPositions[cachedBreakPositions.length - 1]) {
    cachedBreakPositions=null;
    return super.preceding(offset);
  }
 else {
    positionInCache=0;
    while (positionInCache < cachedBreakPositions.length && offset > cachedBreakPositions[positionInCache]) {
      ++positionInCache;
    }
    --positionInCache;
    text.setIndex(cachedBreakPositions[positionInCache]);
    return text.getIndex();
  }
}

@ Override public int preceding ( int offset ) { CharacterIterator text = getText ( ) ; checkOffset ( offset , text ) ; if ( cachedBreakPositions == null || offset <= cachedBreakPositions [ 0 ] || offset > cachedBreakPositions [ cachedBreakPositions . length - 1 ] ) { cachedBreakPositions = null ; return super . preceding ( offset ) ; } else { positionInCache = 0 ; while ( positionInCache < cachedBreakPositions . length && offset > cachedBreakPositions [ positionInCache ] ) { ++ positionInCache ; } -- positionInCache ; text . setIndex ( cachedBreakPositions [ positionInCache ] ) ; return text . getIndex ( ) ; } }
sets the current iteration position to the last boundary position before the specified position .
