@Override
    protected void handleTransliterate(Replaceable text,
                                       Position pos, boolean incremental) {
        int start = pos.start;
        int limit = pos.limit;

        StringBuilder buf = new StringBuilder(prefix);
        int prefixLen = prefix.length();
        boolean redoPrefix = false;

        while (start < limit) {
            int c = grokSupplementals ? text.char32At(start) : text.charAt(start);
            int charLen = grokSupplementals ? UTF16.getCharCount(c) : 1;

            if ((c & 0xFFFF0000) != 0 && supplementalHandler != null) {
                buf.setLength(0);
                buf.append(supplementalHandler.prefix);
                Utility.appendNumber(buf, c, supplementalHandler.radix,
                                     supplementalHandler.minDigits);
                buf.append(supplementalHandler.suffix);
                redoPrefix = true;
            } else {
                if (redoPrefix) {
                    buf.setLength(0);
                    buf.append(prefix);
                    redoPrefix = false;
                } else {
                    buf.setLength(prefixLen);
                }
                Utility.appendNumber(buf, c, radix, minDigits);
                buf.append(suffix);
            }

            text.replace(start, start + charLen, buf.toString());
            start += buf.length();
            limit += buf.length() - charLen;
        }

        pos.contextLimit += limit - pos.limit;
        pos.limit = limit;
        pos.start = start;
    }
@ Override protected void handleTransliterate ( Replaceable text , Position pos , boolean incremental ) { int start = pos . start ; int limit = pos . limit ; StringBuilder buf = new StringBuilder ( prefix ) ; int prefixLen = prefix . length ( ) ; boolean redoPrefix = false ; while ( start < limit ) { int c = grokSupplementals ? text . char32At ( start ) : text . charAt ( start ) ; int charLen = grokSupplementals ? UTF16 . getCharCount ( c ) : 1 ; if ( ( c & 0xFFFF0000 ) != 0 && supplementalHandler != null ) { buf . setLength ( 0 ) ; buf . append ( supplementalHandler . prefix ) ; Utility . appendNumber ( buf , c , supplementalHandler . radix , supplementalHandler . minDigits ) ; buf . append ( supplementalHandler . suffix ) ; redoPrefix = true ; } else { if ( redoPrefix ) { buf . setLength ( 0 ) ; buf . append ( prefix ) ; redoPrefix = false ; } else { buf . setLength ( prefixLen ) ; } Utility . appendNumber ( buf , c , radix , minDigits ) ; buf . append ( suffix ) ; } text . replace ( start , start + charLen , buf . toString ( ) ) ; start += buf . length ( ) ; limit += buf . length ( ) - charLen ; } pos . contextLimit += limit - pos . limit ; pos . limit = limit ; pos . start = start ; }
Implements {@link Transliterator#handleTransliterate}.