@Override
    public int last() {
        fCachedBreakPositions = null;
        fDictionaryCharCount = 0;
        fPositionInCache = 0;

        if (fText == null) {
            fLastRuleStatusIndex  = 0;
            fLastStatusIndexValid = true;
            return BreakIterator.DONE;
        }

        // t.last() returns the offset of the last character,
        // rather than the past-the-end offset
        // so a loop like for(p=it.last(); p!=DONE; p=it.previous()) ...
        // will work correctly.
        fLastStatusIndexValid = false;
        int pos = fText.getEndIndex();
        fText.setIndex(pos);
        return pos;
    }
@ Override public int last ( ) { fCachedBreakPositions = null ; fDictionaryCharCount = 0 ; fPositionInCache = 0 ; if ( fText == null ) { fLastRuleStatusIndex = 0 ; fLastStatusIndexValid = true ; return BreakIterator . DONE ; } fLastStatusIndexValid = false ; int pos = fText . getEndIndex ( ) ; fText . setIndex ( pos ) ; return pos ; }
Sets the current iteration position to the end of the text.
(i.e., the CharacterIterator's ending offset).
@return The text's past-the-end offset.