< prev index next >

src/java.base/share/classes/sun/text/bidi/BidiBase.java

Print this page

        

*** 1162,1174 **** } static final int DirPropFlagMultiRuns = DirPropFlag((byte)31); /* to avoid some conditional statements, use tiny constant arrays */ ! static final int DirPropFlagLR[] = { DirPropFlag(L), DirPropFlag(R) }; ! static final int DirPropFlagE[] = { DirPropFlag(LRE), DirPropFlag(RLE) }; ! static final int DirPropFlagO[] = { DirPropFlag(LRO), DirPropFlag(RLO) }; static final int DirPropFlagLR(byte level) { return DirPropFlagLR[level & 1]; } static final int DirPropFlagE(byte level) { return DirPropFlagE[level & 1]; } static final int DirPropFlagO(byte level) { return DirPropFlagO[level & 1]; } static final byte DirFromStrong(byte strong) { return strong == L ? L : R; } --- 1162,1174 ---- } static final int DirPropFlagMultiRuns = DirPropFlag((byte)31); /* to avoid some conditional statements, use tiny constant arrays */ ! static final int[] DirPropFlagLR = { DirPropFlag(L), DirPropFlag(R) }; ! static final int[] DirPropFlagE = { DirPropFlag(LRE), DirPropFlag(RLE) }; ! static final int[] DirPropFlagO = { DirPropFlag(LRO), DirPropFlag(RLO) }; static final int DirPropFlagLR(byte level) { return DirPropFlagLR[level & 1]; } static final int DirPropFlagE(byte level) { return DirPropFlagE[level & 1]; } static final int DirPropFlagO(byte level) { return DirPropFlagO[level & 1]; } static final byte DirFromStrong(byte strong) { return strong == L ? L : R; }
*** 2430,2440 **** } private static short GetActionProps(short cell) { return (short)(cell >> 5); } ! private static final short groupProp[] = /* dirProp regrouped */ { /* L R EN ES ET AN CS B S WS ON LRE LRO AL RLE RLO PDF NSM BN FSI LRI RLI PDI ENL ENR */ 0, 1, 2, 7, 8, 3, 9, 6, 5, 4, 4, 10, 10, 12, 10, 10, 10, 11, 10, 4, 4, 4, 4, 13, 14 }; private static final short _L = 0; --- 2430,2440 ---- } private static short GetActionProps(short cell) { return (short)(cell >> 5); } ! private static final short[] groupProp = /* dirProp regrouped */ { /* L R EN ES ET AN CS B S WS ON LRE LRO AL RLE RLO PDF NSM BN FSI LRI RLI PDI ENL ENR */ 0, 1, 2, 7, 8, 3, 9, 6, 5, 4, 4, 10, 10, 12, 10, 10, 10, 11, 10, 4, 4, 4, 4, 13, 14 }; private static final short _L = 0;
*** 2477,2487 **** /* the digits must be processed as one sequence, and the CS */ /* must be processed as an ON sequence, all this before starting */ /* assembling chars for the opening L sequence. */ /* */ /* */ ! private static final short impTabProps[][] = { /* L, R, EN, AN, ON, S, B, ES, ET, CS, BN, NSM, AL, ENL, ENR, Res */ /* 0 Init */ { 1, 2, 4, 5, 7, 15, 17, 7, 9, 7, 0, 7, 3, 18, 21, _ON }, /* 1 L */ { 1, 32+2, 32+4, 32+5, 32+7, 32+15, 32+17, 32+7, 32+9, 32+7, 1, 1, 32+3, 32+18, 32+21, _L }, /* 2 R */ { 32+1, 2, 32+4, 32+5, 32+7, 32+15, 32+17, 32+7, 32+9, 32+7, 2, 2, 32+3, 32+18, 32+21, _R }, --- 2477,2487 ---- /* the digits must be processed as one sequence, and the CS */ /* must be processed as an ON sequence, all this before starting */ /* assembling chars for the opening L sequence. */ /* */ /* */ ! private static final short[][] impTabProps = { /* L, R, EN, AN, ON, S, B, ES, ET, CS, BN, NSM, AL, ENL, ENR, Res */ /* 0 Init */ { 1, 2, 4, 5, 7, 15, 17, 7, 9, 7, 0, 7, 3, 18, 21, _ON }, /* 1 L */ { 1, 32+2, 32+4, 32+5, 32+7, 32+15, 32+17, 32+7, 32+9, 32+7, 1, 1, 32+3, 32+18, 32+21, _L }, /* 2 R */ { 32+1, 2, 32+4, 32+5, 32+7, 32+15, 32+17, 32+7, 32+9, 32+7, 2, 2, 32+3, 32+18, 32+21, _R },
*** 2576,2586 **** /* assigned basic run level+1, and so will the R sequence. */ /* 4) S is generally handled like ON, since its level will be fixed */ /* to paragraph level in adjustWSLevels(). */ /* */ ! private static final byte impTabL_DEFAULT[][] = /* Even paragraph level */ /* In this table, conditional sequences receive the lower possible level until proven otherwise. */ { /* L, R, EN, AN, ON, S, B, Res */ --- 2576,2586 ---- /* assigned basic run level+1, and so will the R sequence. */ /* 4) S is generally handled like ON, since its level will be fixed */ /* to paragraph level in adjustWSLevels(). */ /* */ ! private static final byte[][] impTabL_DEFAULT = /* Even paragraph level */ /* In this table, conditional sequences receive the lower possible level until proven otherwise. */ { /* L, R, EN, AN, ON, S, B, Res */
*** 2590,2600 **** /* 3 : R+EN/AN */ { 0, 1, 3, 3, 0x14, 0x14, 0, 2 }, /* 4 : R+ON */ { 0, 0x21, 0x33, 0x33, 4, 4, 0, 0 }, /* 5 : AN+ON */ { 0, 0x21, 0, 0x32, 5, 5, 0, 0 } }; ! private static final byte impTabR_DEFAULT[][] = /* Odd paragraph level */ /* In this table, conditional sequences receive the lower possible level until proven otherwise. */ { /* L, R, EN, AN, ON, S, B, Res */ --- 2590,2600 ---- /* 3 : R+EN/AN */ { 0, 1, 3, 3, 0x14, 0x14, 0, 2 }, /* 4 : R+ON */ { 0, 0x21, 0x33, 0x33, 4, 4, 0, 0 }, /* 5 : AN+ON */ { 0, 0x21, 0, 0x32, 5, 5, 0, 0 } }; ! private static final byte[][] impTabR_DEFAULT = /* Odd paragraph level */ /* In this table, conditional sequences receive the lower possible level until proven otherwise. */ { /* L, R, EN, AN, ON, S, B, Res */
*** 2609,2619 **** private static final short[] impAct0 = {0,1,2,3,4}; private static final ImpTabPair impTab_DEFAULT = new ImpTabPair( impTabL_DEFAULT, impTabR_DEFAULT, impAct0, impAct0); ! private static final byte impTabL_NUMBERS_SPECIAL[][] = { /* Even paragraph level */ /* In this table, conditional sequences receive the lower possible level until proven otherwise. */ /* L, R, EN, AN, ON, S, B, Res */ /* 0 : init */ { 0, 2, 0x11, 0x11, 0, 0, 0, 0 }, --- 2609,2619 ---- private static final short[] impAct0 = {0,1,2,3,4}; private static final ImpTabPair impTab_DEFAULT = new ImpTabPair( impTabL_DEFAULT, impTabR_DEFAULT, impAct0, impAct0); ! private static final byte[][] impTabL_NUMBERS_SPECIAL = { /* Even paragraph level */ /* In this table, conditional sequences receive the lower possible level until proven otherwise. */ /* L, R, EN, AN, ON, S, B, Res */ /* 0 : init */ { 0, 2, 0x11, 0x11, 0, 0, 0, 0 },
*** 2623,2633 **** /* 4 : R+EN/AN */ { 0, 2, 4, 4, 0x13, 0x13, 0, 2 } }; private static final ImpTabPair impTab_NUMBERS_SPECIAL = new ImpTabPair( impTabL_NUMBERS_SPECIAL, impTabR_DEFAULT, impAct0, impAct0); ! private static final byte impTabL_GROUP_NUMBERS_WITH_R[][] = { /* In this table, EN/AN+ON sequences receive levels as if associated with R until proven that there is L or sor/eor on both sides. AN is handled like EN. */ /* L, R, EN, AN, ON, S, B, Res */ /* 0 init */ { 0, 3, 0x11, 0x11, 0, 0, 0, 0 }, --- 2623,2633 ---- /* 4 : R+EN/AN */ { 0, 2, 4, 4, 0x13, 0x13, 0, 2 } }; private static final ImpTabPair impTab_NUMBERS_SPECIAL = new ImpTabPair( impTabL_NUMBERS_SPECIAL, impTabR_DEFAULT, impAct0, impAct0); ! private static final byte[][] impTabL_GROUP_NUMBERS_WITH_R = { /* In this table, EN/AN+ON sequences receive levels as if associated with R until proven that there is L or sor/eor on both sides. AN is handled like EN. */ /* L, R, EN, AN, ON, S, B, Res */ /* 0 init */ { 0, 3, 0x11, 0x11, 0, 0, 0, 0 },
*** 2635,2645 **** /* 2 EN/AN+ON */ { 0x20, 3, 1, 1, 2, 0x20, 0x20, 1 }, /* 3 R */ { 0, 3, 5, 5, 0x14, 0, 0, 1 }, /* 4 R+ON */ { 0x20, 3, 5, 5, 4, 0x20, 0x20, 1 }, /* 5 R+EN/AN */ { 0, 3, 5, 5, 0x14, 0, 0, 2 } }; ! private static final byte impTabR_GROUP_NUMBERS_WITH_R[][] = { /* In this table, EN/AN+ON sequences receive levels as if associated with R until proven that there is L on both sides. AN is handled like EN. */ /* L, R, EN, AN, ON, S, B, Res */ /* 0 init */ { 2, 0, 1, 1, 0, 0, 0, 0 }, --- 2635,2645 ---- /* 2 EN/AN+ON */ { 0x20, 3, 1, 1, 2, 0x20, 0x20, 1 }, /* 3 R */ { 0, 3, 5, 5, 0x14, 0, 0, 1 }, /* 4 R+ON */ { 0x20, 3, 5, 5, 4, 0x20, 0x20, 1 }, /* 5 R+EN/AN */ { 0, 3, 5, 5, 0x14, 0, 0, 2 } }; ! private static final byte[][] impTabR_GROUP_NUMBERS_WITH_R = { /* In this table, EN/AN+ON sequences receive levels as if associated with R until proven that there is L on both sides. AN is handled like EN. */ /* L, R, EN, AN, ON, S, B, Res */ /* 0 init */ { 2, 0, 1, 1, 0, 0, 0, 0 },
*** 2650,2660 **** }; private static final ImpTabPair impTab_GROUP_NUMBERS_WITH_R = new ImpTabPair(impTabL_GROUP_NUMBERS_WITH_R, impTabR_GROUP_NUMBERS_WITH_R, impAct0, impAct0); ! private static final byte impTabL_INVERSE_NUMBERS_AS_L[][] = { /* This table is identical to the Default LTR table except that EN and AN are handled like L. */ /* L, R, EN, AN, ON, S, B, Res */ /* 0 : init */ { 0, 1, 0, 0, 0, 0, 0, 0 }, --- 2650,2660 ---- }; private static final ImpTabPair impTab_GROUP_NUMBERS_WITH_R = new ImpTabPair(impTabL_GROUP_NUMBERS_WITH_R, impTabR_GROUP_NUMBERS_WITH_R, impAct0, impAct0); ! private static final byte[][] impTabL_INVERSE_NUMBERS_AS_L = { /* This table is identical to the Default LTR table except that EN and AN are handled like L. */ /* L, R, EN, AN, ON, S, B, Res */ /* 0 : init */ { 0, 1, 0, 0, 0, 0, 0, 0 },
*** 2662,2672 **** /* 2 : AN */ { 0, 1, 0, 0, 0x15, 0x15, 0, 2 }, /* 3 : R+EN/AN */ { 0, 1, 0, 0, 0x14, 0x14, 0, 2 }, /* 4 : R+ON */ { 0x20, 1, 0x20, 0x20, 4, 4, 0x20, 1 }, /* 5 : AN+ON */ { 0x20, 1, 0x20, 0x20, 5, 5, 0x20, 1 } }; ! private static final byte impTabR_INVERSE_NUMBERS_AS_L[][] = { /* This table is identical to the Default RTL table except that EN and AN are handled like L. */ /* L, R, EN, AN, ON, S, B, Res */ /* 0 : init */ { 1, 0, 1, 1, 0, 0, 0, 0 }, --- 2662,2672 ---- /* 2 : AN */ { 0, 1, 0, 0, 0x15, 0x15, 0, 2 }, /* 3 : R+EN/AN */ { 0, 1, 0, 0, 0x14, 0x14, 0, 2 }, /* 4 : R+ON */ { 0x20, 1, 0x20, 0x20, 4, 4, 0x20, 1 }, /* 5 : AN+ON */ { 0x20, 1, 0x20, 0x20, 5, 5, 0x20, 1 } }; ! private static final byte[][] impTabR_INVERSE_NUMBERS_AS_L = { /* This table is identical to the Default RTL table except that EN and AN are handled like L. */ /* L, R, EN, AN, ON, S, B, Res */ /* 0 : init */ { 1, 0, 1, 1, 0, 0, 0, 0 },
*** 2678,2688 **** }; private static final ImpTabPair impTab_INVERSE_NUMBERS_AS_L = new ImpTabPair (impTabL_INVERSE_NUMBERS_AS_L, impTabR_INVERSE_NUMBERS_AS_L, impAct0, impAct0); ! private static final byte impTabR_INVERSE_LIKE_DIRECT[][] = { /* Odd paragraph level */ /* In this table, conditional sequences receive the lower possible level until proven otherwise. */ /* L, R, EN, AN, ON, S, B, Res */ /* 0 : init */ { 1, 0, 2, 2, 0, 0, 0, 0 }, --- 2678,2688 ---- }; private static final ImpTabPair impTab_INVERSE_NUMBERS_AS_L = new ImpTabPair (impTabL_INVERSE_NUMBERS_AS_L, impTabR_INVERSE_NUMBERS_AS_L, impAct0, impAct0); ! private static final byte[][] impTabR_INVERSE_LIKE_DIRECT = { /* Odd paragraph level */ /* In this table, conditional sequences receive the lower possible level until proven otherwise. */ /* L, R, EN, AN, ON, S, B, Res */ /* 0 : init */ { 1, 0, 2, 2, 0, 0, 0, 0 },
*** 2695,2705 **** }; private static final short[] impAct1 = {0,1,13,14}; private static final ImpTabPair impTab_INVERSE_LIKE_DIRECT = new ImpTabPair( impTabL_DEFAULT, impTabR_INVERSE_LIKE_DIRECT, impAct0, impAct1); ! private static final byte impTabL_INVERSE_LIKE_DIRECT_WITH_MARKS[][] = { /* The case handled in this table is (visually): R EN L */ /* L, R, EN, AN, ON, S, B, Res */ /* 0 : init */ { 0, 0x63, 0, 1, 0, 0, 0, 0 }, /* 1 : L+AN */ { 0, 0x63, 0, 1, 0x12, 0x30, 0, 4 }, --- 2695,2705 ---- }; private static final short[] impAct1 = {0,1,13,14}; private static final ImpTabPair impTab_INVERSE_LIKE_DIRECT = new ImpTabPair( impTabL_DEFAULT, impTabR_INVERSE_LIKE_DIRECT, impAct0, impAct1); ! private static final byte[][] impTabL_INVERSE_LIKE_DIRECT_WITH_MARKS = { /* The case handled in this table is (visually): R EN L */ /* L, R, EN, AN, ON, S, B, Res */ /* 0 : init */ { 0, 0x63, 0, 1, 0, 0, 0, 0 }, /* 1 : L+AN */ { 0, 0x63, 0, 1, 0x12, 0x30, 0, 4 },
*** 2707,2717 **** /* 3 : R */ { 0, 0x63, 0x55, 0x56, 0x14, 0x30, 0, 3 }, /* 4 : R+ON */ { 0x30, 0x43, 0x55, 0x56, 4, 0x30, 0x30, 3 }, /* 5 : R+EN */ { 0x30, 0x43, 5, 0x56, 0x14, 0x30, 0x30, 4 }, /* 6 : R+AN */ { 0x30, 0x43, 0x55, 6, 0x14, 0x30, 0x30, 4 } }; ! private static final byte impTabR_INVERSE_LIKE_DIRECT_WITH_MARKS[][] = { /* The cases handled in this table are (visually): R EN L R L AN L */ /* L, R, EN, AN, ON, S, B, Res */ /* 0 : init */ { 0x13, 0, 1, 1, 0, 0, 0, 0 }, --- 2707,2717 ---- /* 3 : R */ { 0, 0x63, 0x55, 0x56, 0x14, 0x30, 0, 3 }, /* 4 : R+ON */ { 0x30, 0x43, 0x55, 0x56, 4, 0x30, 0x30, 3 }, /* 5 : R+EN */ { 0x30, 0x43, 5, 0x56, 0x14, 0x30, 0x30, 4 }, /* 6 : R+AN */ { 0x30, 0x43, 0x55, 6, 0x14, 0x30, 0x30, 4 } }; ! private static final byte[][] impTabR_INVERSE_LIKE_DIRECT_WITH_MARKS = { /* The cases handled in this table are (visually): R EN L R L AN L */ /* L, R, EN, AN, ON, S, B, Res */ /* 0 : init */ { 0x13, 0, 1, 1, 0, 0, 0, 0 },
*** 2729,2739 **** impTabR_INVERSE_LIKE_DIRECT_WITH_MARKS, impAct2, impAct3); private static final ImpTabPair impTab_INVERSE_FOR_NUMBERS_SPECIAL = new ImpTabPair( impTabL_NUMBERS_SPECIAL, impTabR_INVERSE_LIKE_DIRECT, impAct0, impAct1); ! private static final byte impTabL_INVERSE_FOR_NUMBERS_SPECIAL_WITH_MARKS[][] = { /* The case handled in this table is (visually): R EN L */ /* L, R, EN, AN, ON, S, B, Res */ /* 0 : init */ { 0, 0x62, 1, 1, 0, 0, 0, 0 }, /* 1 : L+EN/AN */ { 0, 0x62, 1, 1, 0, 0x30, 0, 4 }, --- 2729,2739 ---- impTabR_INVERSE_LIKE_DIRECT_WITH_MARKS, impAct2, impAct3); private static final ImpTabPair impTab_INVERSE_FOR_NUMBERS_SPECIAL = new ImpTabPair( impTabL_NUMBERS_SPECIAL, impTabR_INVERSE_LIKE_DIRECT, impAct0, impAct1); ! private static final byte[][] impTabL_INVERSE_FOR_NUMBERS_SPECIAL_WITH_MARKS = { /* The case handled in this table is (visually): R EN L */ /* L, R, EN, AN, ON, S, B, Res */ /* 0 : init */ { 0, 0x62, 1, 1, 0, 0, 0, 0 }, /* 1 : L+EN/AN */ { 0, 0x62, 1, 1, 0, 0x30, 0, 4 },
< prev index next >