jdk/make/tools/GenerateCharacter/CharacterData01.java.template
author peytoia
Fri, 10 Apr 2009 11:51:36 +0900
changeset 2497 903fd9d785ef
parent 2 90ce3da70b43
child 5506 202f599c92aa
permissions -rw-r--r--
6404304: RFE: Unicode 5.1 support Reviewed-by: okutsu, naoto
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
 * Copyright 2003-2006 Sun Microsystems, Inc.  All Rights Reserved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Sun designates this
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 * by Sun in the LICENSE file that accompanied this code.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 * CA 95054 USA or visit www.sun.com if you need additional information or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
 * have any questions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package java.lang;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
/** The CharacterData class encapsulates the large tables once found in
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
 *  java.lang.Character. 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
class CharacterData01 extends CharacterData {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
    /* The character properties are currently encoded into 32 bits in the following manner:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
        1 bit   mirrored property
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
        4 bits  directionality property
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
        9 bits  signed offset used for converting case
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
        1 bit   if 1, adding the signed offset converts the character to lowercase
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
        1 bit   if 1, subtracting the signed offset converts the character to uppercase
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
        1 bit   if 1, this character has a titlecase equivalent (possibly itself)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
        3 bits  0  may not be part of an identifier
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
                1  ignorable control; may continue a Unicode identifier or Java identifier
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
                2  may continue a Java identifier but not a Unicode identifier (unused)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
                3  may continue a Unicode identifier or Java identifier
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
                4  is a Java whitespace character
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
                5  may start or continue a Java identifier;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
                   may continue but not start a Unicode identifier (underscores)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
                6  may start or continue a Java identifier but not a Unicode identifier ($)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
                7  may start or continue a Unicode identifier or Java identifier
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
                Thus:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
                   5, 6, 7 may start a Java identifier
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
                   1, 2, 3, 5, 6, 7 may continue a Java identifier
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
                   7 may start a Unicode identifier
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
                   1, 3, 5, 7 may continue a Unicode identifier
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
                   1 is ignorable within an identifier
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
                   4 is Java whitespace
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
        2 bits  0  this character has no numeric property
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
                1  adding the digit offset to the character code and then
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
                   masking with 0x1F will produce the desired numeric value
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
                2  this character has a "strange" numeric value
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
                3  a Java supradecimal digit: adding the digit offset to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
                   character code, then masking with 0x1F, then adding 10
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
                   will produce the desired numeric value
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
        5 bits  digit offset
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
        5 bits  character type
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
        The encoding of character properties is subject to change at any time.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
    int getProperties(int ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
        char offset = (char)ch;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
        int props = $$Lookup(offset);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
        return props;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
    int getType(int ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
        int props = getProperties(ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
        return (props & $$maskType);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
    boolean isJavaIdentifierStart(int ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
        int props = getProperties(ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
        return ((props & $$maskIdentifierInfo) >= $$lowJavaStart);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
    boolean isJavaIdentifierPart(int ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
        int props = getProperties(ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
        return ((props & $$nonzeroJavaPart) != 0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
    boolean isUnicodeIdentifierStart(int ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
        int props = getProperties(ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
        return ((props & $$maskIdentifierInfo) == $$valueUnicodeStart);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
    boolean isUnicodeIdentifierPart(int ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
        int props = getProperties(ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
        return ((props & $$maskUnicodePart) != 0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
    boolean isIdentifierIgnorable(int ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
        int props = getProperties(ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
        return ((props & $$maskIdentifierInfo) == $$valueIgnorable);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
    int toLowerCase(int ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
        int mapChar = ch;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
        int val = getProperties(ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
        if ((val & $$maskLowerCase) != 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
            int offset = val << $$shiftCaseOffsetSign >> ($$shiftCaseOffsetSign+$$shiftCaseOffset);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
            mapChar = ch + offset;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
        return  mapChar;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
    int toUpperCase(int ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
        int mapChar = ch;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
        int val = getProperties(ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
        if ((val & $$maskUpperCase) != 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
            int offset = val  << $$shiftCaseOffsetSign >> ($$shiftCaseOffsetSign+$$shiftCaseOffset);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
            mapChar =  ch - offset;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
        return  mapChar;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
    int toTitleCase(int ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
        int mapChar = ch;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
        int val = getProperties(ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
        if ((val & $$maskTitleCase) != 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
            // There is a titlecase equivalent.  Perform further checks:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
            if ((val & $$maskUpperCase) == 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
                // The character does not have an uppercase equivalent, so it must
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
                // already be uppercase; so add 1 to get the titlecase form.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
                mapChar = ch + 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
            else if ((val & $$maskLowerCase) == 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
                // The character does not have a lowercase equivalent, so it must
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
                // already be lowercase; so subtract 1 to get the titlecase form.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
                mapChar = ch - 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
            // else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
            // The character has both an uppercase equivalent and a lowercase
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
            // equivalent, so it must itself be a titlecase form; return it.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
            // return ch;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
            //}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
        else if ((val & $$maskUpperCase) != 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
            // This character has no titlecase equivalent but it does have an
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
            // uppercase equivalent, so use that (subtract the signed case offset).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
            mapChar = toUpperCase(ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
        return  mapChar;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
    int digit(int ch, int radix) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
        int value = -1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
        if (radix >= Character.MIN_RADIX && radix <= Character.MAX_RADIX) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
            int val = getProperties(ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
            int kind = val & $$maskType;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
            if (kind == Character.DECIMAL_DIGIT_NUMBER) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
                value = ch + ((val & $$maskDigitOffset) >> $$shiftDigitOffset) & $$maskDigit;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
            else if ((val & $$maskNumericType) == $$valueJavaSupradecimal) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
                // Java supradecimal digit
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
                value = (ch + ((val & $$maskDigitOffset) >> $$shiftDigitOffset) & $$maskDigit) + 10;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
        return (value < radix) ? value : -1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
    int getNumericValue(int ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
        int val = getProperties(ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
        int retval = -1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
        switch (val & $$maskNumericType) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
        default: // cannot occur
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
        case ($$valueNotNumeric):         // not numeric
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
            retval = -1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
            break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
        case ($$valueDigit):              // simple numeric
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
            retval = ch + ((val & $$maskDigitOffset) >> $$shiftDigitOffset) & $$maskDigit;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
            break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
        case ($$valueStrangeNumeric)      :       // "strange" numeric
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
            switch(ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
            case 0x10113: retval = 40; break;      // AEGEAN NUMBER FORTY
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
            case 0x10114: retval = 50; break;      // AEGEAN NUMBER FIFTY
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
            case 0x10115: retval = 60; break;      // AEGEAN NUMBER SIXTY
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
            case 0x10116: retval = 70; break;      // AEGEAN NUMBER SEVENTY
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
            case 0x10117: retval = 80; break;      // AEGEAN NUMBER EIGHTY
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
            case 0x10118: retval = 90; break;      // AEGEAN NUMBER NINETY
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
            case 0x10119: retval = 100; break;     // AEGEAN NUMBER ONE HUNDRED
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
            case 0x1011A: retval = 200; break;     // AEGEAN NUMBER TWO HUNDRED
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
            case 0x1011B: retval = 300; break;     // AEGEAN NUMBER THREE HUNDRED
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
            case 0x1011C: retval = 400; break;     // AEGEAN NUMBER FOUR HUNDRED
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
            case 0x1011D: retval = 500; break;     // AEGEAN NUMBER FIVE HUNDRED
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
            case 0x1011E: retval = 600; break;     // AEGEAN NUMBER SIX HUNDRED
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
            case 0x1011F: retval = 700; break;     // AEGEAN NUMBER SEVEN HUNDRED
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
            case 0x10120: retval = 800; break;     // AEGEAN NUMBER EIGHT HUNDRED
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
            case 0x10121: retval = 900; break;     // AEGEAN NUMBER NINE HUNDRED
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
            case 0x10122: retval = 1000; break;    // AEGEAN NUMBER ONE THOUSAND
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
            case 0x10123: retval = 2000; break;    // AEGEAN NUMBER TWO THOUSAND
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
            case 0x10124: retval = 3000; break;    // AEGEAN NUMBER THREE THOUSAND
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
            case 0x10125: retval = 4000; break;    // AEGEAN NUMBER FOUR THOUSAND
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
            case 0x10126: retval = 5000; break;    // AEGEAN NUMBER FIVE THOUSAND
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
            case 0x10127: retval = 6000; break;    // AEGEAN NUMBER SIX THOUSAND
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
            case 0x10128: retval = 7000; break;    // AEGEAN NUMBER SEVEN THOUSAND
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
            case 0x10129: retval = 8000; break;    // AEGEAN NUMBER EIGHT THOUSAND
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
            case 0x1012A: retval = 9000; break;    // AEGEAN NUMBER NINE THOUSAND
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
            case 0x1012B: retval = 10000; break;   // AEGEAN NUMBER TEN THOUSAND
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
            case 0x1012C: retval = 20000; break;   // AEGEAN NUMBER TWENTY THOUSAND
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
            case 0x1012D: retval = 30000; break;   // AEGEAN NUMBER THIRTY THOUSAND
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
            case 0x1012E: retval = 40000; break;   // AEGEAN NUMBER FORTY THOUSAND
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
            case 0x1012F: retval = 50000; break;   // AEGEAN NUMBER FIFTY THOUSAND
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
            case 0x10130: retval = 60000; break;   // AEGEAN NUMBER SIXTY THOUSAND
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
            case 0x10131: retval = 70000; break;   // AEGEAN NUMBER SEVENTY THOUSAND
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
            case 0x10132: retval = 80000; break;   // AEGEAN NUMBER EIGHTY THOUSAND
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
            case 0x10133: retval = 90000; break;   // AEGEAN NUMBER NINETY THOUSAND
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
            case 0x10323: retval = 50; break;      // OLD ITALIC NUMERAL FIFTY
2497
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
   221
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
   222
            case 0x010144: retval = 50; break;     // ACROPHONIC ATTIC FIFTY
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
   223
            case 0x010145: retval = 500; break;    // ACROPHONIC ATTIC FIVE HUNDRED
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
   224
            case 0x010146: retval = 5000; break;   // ACROPHONIC ATTIC FIVE THOUSAND
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
   225
            case 0x010147: retval = 50000; break;  // ACROPHONIC ATTIC FIFTY THOUSAND
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
   226
            case 0x01014A: retval = 50; break;     // ACROPHONIC ATTIC FIFTY TALENTS
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
   227
            case 0x01014B: retval = 100; break;    // ACROPHONIC ATTIC ONE HUNDRED TALENTS
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
   228
            case 0x01014C: retval = 500; break;    // ACROPHONIC ATTIC FIVE HUNDRED TALENTS
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
   229
            case 0x01014D: retval = 1000; break;   // ACROPHONIC ATTIC ONE THOUSAND TALENTS
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
   230
            case 0x01014E: retval = 5000; break;   // ACROPHONIC ATTIC FIVE THOUSAND TALENTS
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
   231
            case 0x010151: retval = 50; break;     // ACROPHONIC ATTIC FIFTY STATERS
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
   232
            case 0x010152: retval = 100; break;    // ACROPHONIC ATTIC ONE HUNDRED STATERS
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
   233
            case 0x010153: retval = 500; break;    // ACROPHONIC ATTIC FIVE HUNDRED STATERS
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
   234
            case 0x010154: retval = 1000; break;   // ACROPHONIC ATTIC ONE THOUSAND STATERS
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
   235
            case 0x010155: retval = 10000; break;  // ACROPHONIC ATTIC TEN THOUSAND STATERS
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
   236
            case 0x010156: retval = 50000; break;  // ACROPHONIC ATTIC FIFTY THOUSAND STATERS
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
   237
            case 0x010166: retval = 50; break;     // ACROPHONIC TROEZENIAN FIFTY
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
   238
            case 0x010167: retval = 50; break;     // ACROPHONIC TROEZENIAN FIFTY ALTERNATE FORM
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
   239
            case 0x010168: retval = 50; break;     // ACROPHONIC HERMIONIAN FIFTY
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
   240
            case 0x010169: retval = 50; break;     // ACROPHONIC THESPIAN FIFTY
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
   241
            case 0x01016A: retval = 100; break;    // ACROPHONIC THESPIAN ONE HUNDRED
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
   242
            case 0x01016B: retval = 300; break;    // ACROPHONIC THESPIAN THREE HUNDRED
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
   243
            case 0x01016C: retval = 500; break;    // ACROPHONIC EPIDAUREAN FIVE HUNDRED
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
   244
            case 0x01016D: retval = 500; break;    // ACROPHONIC TROEZENIAN FIVE HUNDRED
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
   245
            case 0x01016E: retval = 500; break;    // ACROPHONIC THESPIAN FIVE HUNDRED
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
   246
            case 0x01016F: retval = 500; break;    // ACROPHONIC CARYSTIAN FIVE HUNDRED
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
   247
            case 0x010170: retval = 500; break;    // ACROPHONIC NAXIAN FIVE HUNDRED
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
   248
            case 0x010171: retval = 1000; break;   // ACROPHONIC THESPIAN ONE THOUSAND
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
   249
            case 0x010172: retval = 5000; break;   // ACROPHONIC THESPIAN FIVE THOUSAND
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
   250
            case 0x010174: retval = 50; break;     // ACROPHONIC STRATIAN FIFTY MNAS
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
   251
            case 0x010341: retval = 90; break;     // GOTHIC LETTER NINETY
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
   252
            case 0x01034A: retval = 900; break;    // GOTHIC LETTER NINE HUNDRED
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
   253
            case 0x0103D5: retval = 100; break;    // OLD PERSIAN NUMBER HUNDRED
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
   254
            case 0x010919: retval = 100; break;    // PHOENICIAN NUMBER ONE HUNDRED
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
   255
            case 0x010A46: retval = 100; break;    // KHAROSHTHI NUMBER ONE HUNDRED
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
   256
            case 0x010A47: retval = 1000; break;   // KHAROSHTHI NUMBER ONE THOUSAND
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
   257
            case 0x01D36C: retval = 40; break;     // COUNTING ROD TENS DIGIT FOUR
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
   258
            case 0x01D36D: retval = 50; break;     // COUNTING ROD TENS DIGIT FIVE
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
   259
            case 0x01D36E: retval = 60; break;     // COUNTING ROD TENS DIGIT SIX
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
   260
            case 0x01D36F: retval = 70; break;     // COUNTING ROD TENS DIGIT SEVEN
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
   261
            case 0x01D370: retval = 80; break;     // COUNTING ROD TENS DIGIT EIGHT
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
   262
            case 0x01D371: retval = 90; break;     // COUNTING ROD TENS DIGIT NINE
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
            default: retval = -2; break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
            
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
            break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
        case ($$valueJavaSupradecimal):           // Java supradecimal
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
            retval = (ch + ((val & $$maskDigitOffset) >> $$shiftDigitOffset) & $$maskDigit) + 10;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
            break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
        return retval;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
    boolean isWhitespace(int ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
        int props = getProperties(ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
        return ((props & $$maskIdentifierInfo) == $$valueJavaWhitespace);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
    byte getDirectionality(int ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
        int val = getProperties(ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
        byte directionality = (byte)((val & $$maskBidi) >> $$shiftBidi);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
        if (directionality == 0xF ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
            directionality = Character.DIRECTIONALITY_UNDEFINED;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
        return directionality;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
    boolean isMirrored(int ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
        int props = getProperties(ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
        return ((props & $$maskMirrored) != 0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
    static final CharacterData instance = new CharacterData01();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
    private CharacterData01() {};
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
    $$Tables
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
    static {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
        $$Initializers
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
    }        
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
}