private void shapeToArabicDigitsWithContext(char[] dest,
                                                int start,
                                                int length,
                                                char digitBase,
                                                boolean lastStrongWasAL) {
        UBiDiProps bdp=UBiDiProps.INSTANCE;
        digitBase -= '0'; // move common adjustment out of loop

        for(int i = start + length; --i >= start;) {
            char ch = dest[i];
            switch (bdp.getClass(ch)) {
            case UCharacterDirection.LEFT_TO_RIGHT:
            case UCharacterDirection.RIGHT_TO_LEFT:
                lastStrongWasAL = false;
                break;
            case UCharacterDirection.RIGHT_TO_LEFT_ARABIC:
                lastStrongWasAL = true;
                break;
            case UCharacterDirection.EUROPEAN_NUMBER:
                if (lastStrongWasAL && ch <= '\u0039') {
                    dest[i] = (char)(ch + digitBase);
                }
                break;
            default:
                break;
            }
        }
    }
private void shapeToArabicDigitsWithContext ( char [ ] dest , int start , int length , char digitBase , boolean lastStrongWasAL ) { UBiDiProps bdp = UBiDiProps . INSTANCE ; digitBase -= '0' ; for ( int i = start + length ; -- i >= start ; ) { char ch = dest [ i ] ; switch ( bdp . getClass ( ch ) ) { case UCharacterDirection . LEFT_TO_RIGHT : case UCharacterDirection . RIGHT_TO_LEFT : lastStrongWasAL = false ; break ; case UCharacterDirection . RIGHT_TO_LEFT_ARABIC : lastStrongWasAL = true ; break ; case UCharacterDirection . EUROPEAN_NUMBER : if ( lastStrongWasAL && ch <= '9' ) { dest [ i ] = ( char ) ( ch + digitBase ) ; } break ; default : break ; } } }
/*
This function shapes European digits to Arabic-Indic digits
in-place, writing over the input characters.  Data is in visual
order.