home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1998 January / PCO0198.ISO / 1&1 / java.z / java_301 / java / lang / Character.class (.txt) < prev    next >
Encoding:
Java Class File  |  1996-10-20  |  15.8 KB  |  640 lines

  1. package java.lang;
  2.  
  3. public final class Character {
  4.    public static final int MIN_RADIX = 2;
  5.    public static final int MAX_RADIX = 36;
  6.    public static final char MIN_VALUE = '\u0000';
  7.    public static final char MAX_VALUE = '\uffff';
  8.    private static long[] isLowerCaseTable = new long[]{0L, 576460743713488896L, 0L, -36028799166447616L, 6172933889249159850L, -3122495741643543723L, 2761033308231184681L, -6329340151129091520L, 11184810L, -22522413363298304L, 2170637221884L, 0L, 0L, 0L, -17592185978880L, 1032063467880447L, -281474976710656L, -6148914690341797889L, -6148914691236560894L, 156089602710049044L, 0L, -8589934592L, 255L, 0L, -6148914691236517206L, -6148914691236517206L, -6148914693967009110L, 192153584101141162L, 71777214282006783L, 4611405638684049471L, 62770015039848703L, 61925590106570972L};
  9.    private static long[] isUpperCaseTable = new long[]{0L, 134217726L, 0L, 2139095039L, -6172933889249159851L, 3122495741643543722L, 1274187284968361686L, 6057998273580016784L, 5592405L, 0L, 0L, 0L, 0L, 0L, 17575006099264L, 93819265613824L, 281474976702462L, 6148914689804861440L, 6148914691236495361L, 78044801355024522L, -562949953421312L, 8388607L, 0L, 0L, 6148914691236517205L, 6148914691236517205L, 6148914689806259541L, 96076792050570581L, -71777217515815168L, 280378317225728L, 2234065794919104256L, 2233819500287893248L};
  10.    private static long[] isDefinedTable01C0through06FF = new long[]{-270215977642229761L, 16777215L, -65536L, -279275953455105L, 4395899027455L, -1L, 4913427206346113087L, -17179879440L, 4503588160110591L, -8194L, -536936449L, -65409L, 234134404065073567L, -562949953421312L, -4320133121L, -288511851128421633L, 8734520370987023L, 576460745995194368L, -211110526976001L, 9007199254740991999L, 288019269919145983L};
  11.    private static long[] isDefinedTable0900through0EFF = new long[]{-864691128455135250L, 562949938692095L, -3186861885341720594L, 576460544811219359L, -3211631683292264476L, 9006925953907079L, -869759877059465234L, 281204393851839L, -878767076314341394L, 562690925803919L, -4341532606274353172L, 2251250066275783L, -4327961440926441490L, 281212990012895L, -4327961440926441492L, 281214063754719L, -4323457841299070996L, 281212992110031L, 0L, 0L, -8646911284551352322L, 268435455L, 4323434403644581270L, 872365919L};
  12.    private static long[] isDefinedTable1080through11FF = new long[]{-4294967296L, 612489549322321983L, -1L, -2080374785L, -1065151889409L, 288230376151711743L};
  13.    private static long[] isDefinedTable1E00through27BF = new long[]{-1L, -1L, -4160749569L, 288230376151711743L, -3233808385L, 4611686017001275199L, -9007199254740993L, 9213520412398321631L, -140737488355329L, -3945047720460161L, 8791798087679L, 17179803648L, 144115188075855871L, -524288L, -65529L, 8796093022207L, -1L, -1L, -1L, 1125899906842623L, -3L, 576460752303423487L, 0L, 0L, 137438953471L, -4294965249L, -1L, 8796093022207L, -1L, -1L, -4290772993L, 281474976710655L, -66060289L, 281474976710655L, 0L, 0L, -1099511630882L, -18013305452384257L, 9223090561863385087L};
  14.    private static long[] isDefinedTable3000through33FF = new long[]{-9151314442816847873L, -2L, -6473908225L, Long.MAX_VALUE, -527765581332512L, -1L, 4294934527L, 0L, -3758096385L, -8070450536542896113L, 562949953421311L, 9223372036854714367L, -1L, -540431955284459521L, -1L, 9223372033633550335L};
  15.    private static long[] isDefinedTableFB00throughFFFF = new long[]{6881500229564629119L, -37L, 1125899906842623L, -524288L, -1L, -1L, -1L, -1L, -1L, -65536L, -196609L, 1152640029630136575L, -281410552201216L, -11523431615431137L, -1L, -6917529027641081857L, -2L, -6442450945L, Long.MAX_VALUE, 2305983193137609980L};
  16.    private static long[] isLetterTable0000through06FF = new long[]{0L, 576460743847706622L, 0L, -36028797027352577L, -1L, -1L, -1L, -270215977642229761L, 16777215L, -65536L, -279275953455105L, 4395899027455L, -1L, 4913427206346113087L, -17179879440L, 4503588160110591L, -8194L, -536936449L, -65409L, 234134404065073567L, -562949953421312L, -4320133121L, -288511851128421633L, 8734520370987023L, 576460745995194368L, -215504278519809L, 9007199254740991999L, 70368744144895L};
  17.    private static long[] isLetterTable0900through0EFF = new long[]{-864691128455135250L, 281749839888383L, -3186861885341720594L, 576179344712415647L, -3211631683292264476L, 8725725855103367L, -869759877059465234L, 4295048127L, -878767076314341394L, 281490827000207L, -4341532606274353172L, 1970324845379015L, -4327961440926441490L, 12891209183L, -4327961440926441492L, 13964951007L, -4323457841299070996L, 12893306319L, 0L, 0L, -8646911284551352322L, 201392127L, 4323434403644581270L, 805322591L};
  18.    private static long[] isLetterTable1080through11FF;
  19.    private static long[] isLetterTable1E00through1FFF;
  20.    private static long[] isLetterTable3000through33FF;
  21.    private static long[] isLetterTableFB00throughFFFF;
  22.    private static long[] isLDTable0000through06FF;
  23.    private static long[] isLDTable0900through0EFF;
  24.    private static long[] isLDTable1080through11FF;
  25.    private static long[] isLDTable1E00through1FFF;
  26.    private static long[] isLDTable3000through33FF;
  27.    private static long[] isLDTableFB00throughFFFF;
  28.    private static long[] toLowerCaseTable;
  29.    private static long[] toUpperCaseTable;
  30.    private char value;
  31.  
  32.    public static boolean isLowerCase(char ch) {
  33.       return ((ch < 1536 ? isLowerCaseTable[ch >> 6] : ((ch & '∩╕Ç') == 7680 ? isLowerCaseTable[ch - 6144 >> 6] : ((ch & '\uffc0') == 64256 ? 16253055L : ((ch & '\uffc0') == 65344 ? 134217726L : 0L)))) >> (ch & 63) & 1L) != 0L;
  34.    }
  35.  
  36.    public static boolean isUpperCase(char ch) {
  37.       return ((ch < 1536 ? isUpperCaseTable[ch >> 6] : ((ch & '∩╕Ç') == 7680 ? isUpperCaseTable[ch - 6144 >> 6] : (ch >= 4256 && ch <= 4303 ? -4294967233L : ((ch & '\uffc0') == 65280 ? 576460743713488896L : 0L)))) >> (ch & 63) & 1L) != 0L;
  38.    }
  39.  
  40.    public static boolean isTitleCase(char ch) {
  41.       return ch == 453 || ch == 456 || ch == 459 || ch == 498;
  42.    }
  43.  
  44.    public static boolean isDigit(char ch) {
  45.       if (ch >= '0' && ch <= '9') {
  46.          return true;
  47.       } else {
  48.          switch (ch >> 8) {
  49.             case 255:
  50.                if (ch >= '∩╝É' && ch <= '∩╝Ö') {
  51.                   return true;
  52.                }
  53.  
  54.                return false;
  55.             case 14:
  56.                return ch >= 3664 && ch <= 3673 || ch >= 3792 && ch <= 3801;
  57.             case 13:
  58.                if (ch >= 3430 && ch <= 3439) {
  59.                   return true;
  60.                }
  61.  
  62.                return false;
  63.             case 12:
  64.                if (ch >= 3174 && ch <= 3183 || ch >= 3302 && ch <= 3311) {
  65.                   return true;
  66.                }
  67.  
  68.                return false;
  69.             case 11:
  70.                if (ch >= 2918 && ch <= 2927 || ch >= 3047 && ch <= 3055) {
  71.                   return true;
  72.                }
  73.  
  74.                return false;
  75.             case 10:
  76.                if (ch >= 2662 && ch <= 2671 || ch >= 2790 && ch <= 2799) {
  77.                   return true;
  78.                }
  79.  
  80.                return false;
  81.             case 9:
  82.                if (ch >= 2406 && ch <= 2415 || ch >= 2534 && ch <= 2543) {
  83.                   return true;
  84.                }
  85.  
  86.                return false;
  87.             case 6:
  88.                if (ch >= 1632 && ch <= 1641 || ch >= 1776 && ch <= 1785) {
  89.                   return true;
  90.                }
  91.  
  92.                return false;
  93.             default:
  94.                return false;
  95.          }
  96.       }
  97.    }
  98.  
  99.    public static boolean isDefined(char ch) {
  100.       if (ch < 502) {
  101.          return true;
  102.       } else if (ch < 1792) {
  103.          return (isDefinedTable01C0through06FF[ch - 448 >> 6] >> (ch & 63) & 1L) != 0L;
  104.       } else if (ch >= 2304 && ch <= 3839) {
  105.          return (isDefinedTable0900through0EFF[ch - 2304 >> 6] >> (ch & 63) & 1L) != 0L;
  106.       } else if (ch >= 4224 && ch <= 4607) {
  107.          return (isDefinedTable1080through11FF[ch - 4224 >> 6] >> (ch & 63) & 1L) != 0L;
  108.       } else if (ch >= 7680 && ch <= 10175) {
  109.          return (isDefinedTable1E00through27BF[ch - 7680 >> 6] >> (ch & 63) & 1L) != 0L;
  110.       } else if (ch >= 12288 && ch <= 13311) {
  111.          return (isDefinedTable3000through33FF[ch - 12288 >> 6] >> (ch & 63) & 1L) != 0L;
  112.       } else if (ch >= '∩¼Ç') {
  113.          return (isDefinedTableFB00throughFFFF[ch - '∩¼Ç' >> 6] >> (ch & 63) & 1L) != 0L;
  114.       } else {
  115.          return ch >= 13312 && ch <= 'Θ╛Ñ' || ch >= '∩ñÇ' && ch <= '∩¿¡';
  116.       }
  117.    }
  118.  
  119.    public static boolean isLetter(char ch) {
  120.       if (ch < 1792) {
  121.          return (isLetterTable0000through06FF[ch >> 6] >> (ch & 63) & 1L) != 0L;
  122.       } else if (ch >= 2304 && ch <= 3839) {
  123.          return (isLetterTable0900through0EFF[ch - 2304 >> 6] >> (ch & 63) & 1L) != 0L;
  124.       } else if (ch >= 4224 && ch <= 4607) {
  125.          return (isLetterTable1080through11FF[ch - 4224 >> 6] >> (ch & 63) & 1L) != 0L;
  126.       } else if (ch >= 7680 && ch <= 8191) {
  127.          return (isLetterTable1E00through1FFF[ch - 7680 >> 6] >> (ch & 63) & 1L) != 0L;
  128.       } else if (ch >= 12352 && ch <= 13311) {
  129.          return (isLetterTable3000through33FF[ch - 12288 >> 6] >> (ch & 63) & 1L) != 0L;
  130.       } else if (ch >= '∩¼Ç') {
  131.          return (isLetterTableFB00throughFFFF[ch - '∩¼Ç' >> 6] >> (ch & 63) & 1L) != 0L;
  132.       } else {
  133.          return ch >= 13312 && ch <= 'Θ╛Ñ' || ch >= '∩ñÇ' && ch <= '∩¿¡';
  134.       }
  135.    }
  136.  
  137.    public static boolean isLetterOrDigit(char ch) {
  138.       if (ch < 1792) {
  139.          return (isLDTable0000through06FF[ch >> 6] >> (ch & 63) & 1L) != 0L;
  140.       } else if (ch >= 2304 && ch <= 3839) {
  141.          return (isLDTable0900through0EFF[ch - 2304 >> 6] >> (ch & 63) & 1L) != 0L;
  142.       } else if (ch >= 4224 && ch <= 4607) {
  143.          return (isLDTable1080through11FF[ch - 4224 >> 6] >> (ch & 63) & 1L) != 0L;
  144.       } else if (ch >= 7680 && ch <= 8191) {
  145.          return (isLDTable1E00through1FFF[ch - 7680 >> 6] >> (ch & 63) & 1L) != 0L;
  146.       } else if (ch >= 12352 && ch <= 13311) {
  147.          return (isLDTable3000through33FF[ch - 12288 >> 6] >> (ch & 63) & 1L) != 0L;
  148.       } else if (ch >= '∩¼Ç') {
  149.          return (isLDTableFB00throughFFFF[ch - '∩¼Ç' >> 6] >> (ch & 63) & 1L) != 0L;
  150.       } else {
  151.          return ch >= 13312 && ch <= 'Θ╛Ñ' || ch >= '∩ñÇ' && ch <= '∩¿¡';
  152.       }
  153.    }
  154.  
  155.    public static boolean isJavaLetter(char ch) {
  156.       return isLetter(ch) || ch == '$' || ch == '_';
  157.    }
  158.  
  159.    public static boolean isJavaLetterOrDigit(char ch) {
  160.       return isLetterOrDigit(ch) || ch == '$' || ch == '_';
  161.    }
  162.  
  163.    public static char toLowerCase(char ch) {
  164.       if (ch >= 'A' && ch <= 'Z') {
  165.          return (char)(ch + 32);
  166.       } else if (ch < 192) {
  167.          return ch;
  168.       } else if (ch < 256) {
  169.          if (ch >= 223) {
  170.             return ch;
  171.          } else {
  172.             return ch == 215 ? ch : (char)(ch + 32);
  173.          }
  174.       } else {
  175.          if (((ch < 1536 ? toLowerCaseTable[ch - 256 >> 6] : ((ch & '∩╕Ç') == 7680 ? toLowerCaseTable[ch - 6400 >> 6] : (ch >= 4256 && ch <= 4293 ? -4294967233L : ((ch & '\uffc0') == 8512 ? 281470681743360L : (ch >= 9398 && ch <= 9423 ? -18014398509416449L : ((ch & '\uffc0') == 65280 ? 576460743713488896L : 0L)))))) >> (ch & 63) & 1L) != 0L) {
  176.             switch (ch >> 8) {
  177.                case 255:
  178.                   return (char)(ch + 32);
  179.                case 36:
  180.                   return (char)(ch + 26);
  181.                case 33:
  182.                   return (char)(ch + 16);
  183.                case 31:
  184.                   switch (ch & 255) {
  185.                      case 201:
  186.                         return 'ß╜│';
  187.                      case 200:
  188.                         return 'ß╜▓';
  189.                      case 188:
  190.                         return 'ß╛│';
  191.                      case 187:
  192.                         return 'ß╜▒';
  193.                      case 186:
  194.                         return 'ß╜░';
  195.                      case 252:
  196.                         return 'ß┐│';
  197.                      case 251:
  198.                         return 'ß╜╜';
  199.                      case 250:
  200.                         return 'ß╜╝';
  201.                      case 249:
  202.                         return 'ß╜╣';
  203.                      case 248:
  204.                         return 'ß╜╕';
  205.                      case 236:
  206.                         return 'ß┐Ñ';
  207.                      case 235:
  208.                         return 'ß╜╗';
  209.                      case 234:
  210.                         return 'ß╜║';
  211.                      case 219:
  212.                         return 'ß╜╖';
  213.                      case 218:
  214.                         return 'ß╜╢';
  215.                      case 204:
  216.                         return 'ß┐â';
  217.                      case 203:
  218.                         return 'ß╜╡';
  219.                      case 202:
  220.                         return 'ß╜┤';
  221.                      default:
  222.                         return (char)(ch - 8);
  223.                   }
  224.                case 30:
  225.                   return (char)(ch + 1);
  226.                case 16:
  227.                case 5:
  228.                   return (char)(ch + 48);
  229.                case 4:
  230.                   if (ch < 1040) {
  231.                      return (char)(ch + 80);
  232.                   }
  233.  
  234.                   if (ch < 1120) {
  235.                      return (char)(ch + 32);
  236.                   }
  237.  
  238.                   return (char)(ch + 1);
  239.                case 3:
  240.                   switch (ch & 255) {
  241.                      case 143:
  242.                         return '╧Ä';
  243.                      case 142:
  244.                         return '╧ì';
  245.                      case 140:
  246.                         return '╧î';
  247.                      case 138:
  248.                         return '╬»';
  249.                      case 137:
  250.                         return '╬«';
  251.                      case 136:
  252.                         return '╬¡';
  253.                      case 134:
  254.                         return '╬¼';
  255.                      default:
  256.                         if (ch < 944) {
  257.                            return (char)(ch + 32);
  258.                         }
  259.  
  260.                         return (char)(ch + 1);
  261.                   }
  262.                case 2:
  263.                   return (char)(ch + 1);
  264.                case 1:
  265.                   switch (ch & 255) {
  266.                      case 199:
  267.                         return '╟ë';
  268.                      case 196:
  269.                         return '╟å';
  270.                      case 183:
  271.                         return '╩Æ';
  272.                      case 178:
  273.                         return '╩ï';
  274.                      case 177:
  275.                         return '╩è';
  276.                      case 174:
  277.                         return '╩ê';
  278.                      case 169:
  279.                         return '╩â';
  280.                      case 157:
  281.                         return '╔▓';
  282.                      case 156:
  283.                         return '╔»';
  284.                      case 151:
  285.                         return '╔¿';
  286.                      case 150:
  287.                         return '╔⌐';
  288.                      case 148:
  289.                         return '╔ú';
  290.                      case 147:
  291.                         return '╔á';
  292.                      case 144:
  293.                         return '╔¢';
  294.                      case 143:
  295.                         return '╔Ö';
  296.                      case 142:
  297.                         return '╔ÿ';
  298.                      case 241:
  299.                         return '╟│';
  300.                      case 138:
  301.                         return '╔ù';
  302.                      case 134:
  303.                         return '╔ö';
  304.                      case 129:
  305.                         return '╔ô';
  306.                      case 120:
  307.                         return '├┐';
  308.                      case 202:
  309.                         return '╟î';
  310.                      default:
  311.                         return (char)(ch + 1);
  312.                   }
  313.             }
  314.          }
  315.  
  316.          return ch;
  317.       }
  318.    }
  319.  
  320.    public static char toUpperCase(char ch) {
  321.       if (ch >= 'a' && ch <= 'z') {
  322.          return (char)(ch + -32);
  323.       } else if (ch < 224) {
  324.          return ch;
  325.       } else if (ch < 256) {
  326.          if (ch == 247) {
  327.             return ch;
  328.          } else {
  329.             return ch == 255 ? '┼╕' : (char)(ch - 32);
  330.          }
  331.       } else {
  332.          if (((ch < 1536 ? toUpperCaseTable[ch - 256 >> 6] : ((ch & '∩╕Ç') == 7680 ? toUpperCaseTable[ch - 6400 >> 6] : ((ch & '\uffc0') == 8512 ? -281474976710656L : ((ch & '\uffc0') == 9408 ? 4398046445568L : ((ch & '\uffc0') == 65344 ? 134217726L : 0L))))) >> (ch & 63) & 1L) != 0L) {
  333.             switch (ch >> 8) {
  334.                case 255:
  335.                   return (char)(ch - 32);
  336.                case 36:
  337.                   return (char)(ch - 26);
  338.                case 33:
  339.                   return (char)(ch - 16);
  340.                case 31:
  341.                   switch (ch & 255) {
  342.                      case 195:
  343.                         return 'ß┐î';
  344.                      case 179:
  345.                         return 'ß╛╝';
  346.                      case 243:
  347.                         return 'ß┐╝';
  348.                      case 229:
  349.                         return 'ß┐¼';
  350.                      case 125:
  351.                         return 'ß┐╗';
  352.                      case 124:
  353.                         return 'ß┐║';
  354.                      case 123:
  355.                         return 'ß┐½';
  356.                      case 122:
  357.                         return 'ß┐¬';
  358.                      case 121:
  359.                         return 'ß┐╣';
  360.                      case 120:
  361.                         return 'ß┐╕';
  362.                      case 119:
  363.                         return 'ß┐¢';
  364.                      case 118:
  365.                         return 'ß┐Ü';
  366.                      case 117:
  367.                         return 'ß┐ï';
  368.                      case 116:
  369.                         return 'ß┐è';
  370.                      case 115:
  371.                         return 'ß┐ë';
  372.                      case 114:
  373.                         return 'ß┐ê';
  374.                      case 113:
  375.                         return 'ß╛╗';
  376.                      case 112:
  377.                         return 'ß╛║';
  378.                      default:
  379.                         return (char)(ch + 8);
  380.                   }
  381.                case 30:
  382.                   return (char)(ch - 1);
  383.                case 5:
  384.                   return (char)(ch - 48);
  385.                case 4:
  386.                   if (ch < 1104) {
  387.                      return (char)(ch - 32);
  388.                   }
  389.  
  390.                   if (ch < 1120) {
  391.                      return (char)(ch - 80);
  392.                   }
  393.  
  394.                   return (char)(ch - 1);
  395.                case 3:
  396.                   switch (ch & 255) {
  397.                      case 194:
  398.                         return '╬ú';
  399.                      case 175:
  400.                         return '╬è';
  401.                      case 174:
  402.                         return '╬ë';
  403.                      case 173:
  404.                         return '╬ê';
  405.                      case 172:
  406.                         return '╬å';
  407.                      case 241:
  408.                         return '╬í';
  409.                      case 240:
  410.                         return '╬Ü';
  411.                      case 214:
  412.                         return '╬á';
  413.                      case 213:
  414.                         return '╬ª';
  415.                      case 209:
  416.                         return '╬ÿ';
  417.                      case 208:
  418.                         return '╬Æ';
  419.                      case 206:
  420.                         return '╬Å';
  421.                      case 205:
  422.                         return '╬Ä';
  423.                      case 204:
  424.                         return '╬î';
  425.                      default:
  426.                         if (ch < 992) {
  427.                            return (char)(ch - 32);
  428.                         }
  429.  
  430.                         return (char)(ch - 1);
  431.                   }
  432.                case 2:
  433.                   if (ch < 576) {
  434.                      return (char)(ch - 1);
  435.                   }
  436.  
  437.                   switch (ch & 255) {
  438.                      case 99:
  439.                         return '╞ö';
  440.                      case 96:
  441.                         return '╞ô';
  442.                      case 91:
  443.                         return '╞É';
  444.                      case 89:
  445.                         return '╞Å';
  446.                      case 88:
  447.                         return '╞Ä';
  448.                      case 87:
  449.                         return '╞è';
  450.                      case 84:
  451.                         return '╞å';
  452.                      case 83:
  453.                         return '╞ü';
  454.                      case 146:
  455.                         return '╞╖';
  456.                      case 139:
  457.                         return '╞▓';
  458.                      case 138:
  459.                         return '╞▒';
  460.                      case 136:
  461.                         return '╞«';
  462.                      case 131:
  463.                         return '╞⌐';
  464.                      case 114:
  465.                         return '╞¥';
  466.                      case 111:
  467.                         return '╞£';
  468.                      case 105:
  469.                         return '╞û';
  470.                      case 104:
  471.                         return '╞ù';
  472.                      default:
  473.                         return ch;
  474.                   }
  475.                case 1:
  476.                   if (ch == 383) {
  477.                      return 'S';
  478.                   }
  479.  
  480.                   if (ch != 454 && ch != 457 && ch != 460 && ch != 499) {
  481.                      return (char)(ch - 1);
  482.                   }
  483.  
  484.                   return (char)(ch - 2);
  485.             }
  486.          }
  487.  
  488.          return ch;
  489.       }
  490.    }
  491.  
  492.    public static char toTitleCase(char ch) {
  493.       if ((ch & '\uffc0') != 448) {
  494.          return toUpperCase(ch);
  495.       } else if (ch >= 452 && ch <= 454) {
  496.          return '╟à';
  497.       } else if (ch >= 455 && ch <= 457) {
  498.          return '╟ê';
  499.       } else if (ch >= 458 && ch <= 460) {
  500.          return '╟ï';
  501.       } else {
  502.          return ch >= 497 && ch <= 499 ? '╟▓' : toUpperCase(ch);
  503.       }
  504.    }
  505.  
  506.    public static int digit(char ch, int radix) {
  507.       int value = -1;
  508.       if (radix >= 2 && radix <= 36) {
  509.          if (ch >= '0' && ch <= '9') {
  510.             value = ch - 48;
  511.          } else if (ch >= 'A' && ch <= 'Z') {
  512.             value = ch + -55;
  513.          } else if (ch >= 'a' && ch <= 'z') {
  514.             value = ch + -87;
  515.          } else {
  516.             switch (ch >> 8) {
  517.                case 255:
  518.                   if (ch >= '∩╝É' && ch <= '∩╝Ö') {
  519.                      value = ch - '∩╝É';
  520.                   }
  521.                   break;
  522.                case 14:
  523.                   if (ch >= 3664 && ch <= 3673) {
  524.                      value = ch - 3664;
  525.                   } else if (ch >= 3792 && ch <= 3801) {
  526.                      value = ch - 3792;
  527.                   }
  528.                   break;
  529.                case 13:
  530.                   if (ch >= 3430 && ch <= 3439) {
  531.                      value = ch - 3430;
  532.                   }
  533.                   break;
  534.                case 12:
  535.                   if (ch >= 3174 && ch <= 3183) {
  536.                      value = ch - 3174;
  537.                   } else if (ch >= 3302 && ch <= 3311) {
  538.                      value = ch - 3302;
  539.                   }
  540.                   break;
  541.                case 11:
  542.                   if (ch >= 2918 && ch <= 2927) {
  543.                      value = ch - 2918;
  544.                   } else if (ch >= 3047 && ch <= 3055) {
  545.                      value = ch - 3046;
  546.                   }
  547.                   break;
  548.                case 10:
  549.                   if (ch >= 2662 && ch <= 2671) {
  550.                      value = ch - 2662;
  551.                   } else if (ch >= 2790 && ch <= 2799) {
  552.                      value = ch - 2790;
  553.                   }
  554.                   break;
  555.                case 9:
  556.                   if (ch >= 2406 && ch <= 2415) {
  557.                      value = ch - 2406;
  558.                   } else if (ch >= 2534 && ch <= 2543) {
  559.                      value = ch - 2534;
  560.                   }
  561.                   break;
  562.                case 6:
  563.                   if (ch >= 1632 && ch <= 1641) {
  564.                      value = ch - 1632;
  565.                   } else if (ch >= 1776 && ch <= 1785) {
  566.                      value = ch - 1776;
  567.                   }
  568.             }
  569.          }
  570.       }
  571.  
  572.       return value < radix ? value : -1;
  573.    }
  574.  
  575.    public static boolean isSpace(char ch) {
  576.       switch (ch) {
  577.          case ' ':
  578.          case '\r':
  579.          case '\f':
  580.          case '\n':
  581.          case '\t':
  582.             return true;
  583.          default:
  584.             return false;
  585.       }
  586.    }
  587.  
  588.    public static char forDigit(int digit, int radix) {
  589.       if (digit < radix && digit >= 0) {
  590.          if (radix >= 2 && radix <= 36) {
  591.             return digit < 10 ? (char)(48 + digit) : (char)(97 + digit - 10);
  592.          } else {
  593.             return '\u0000';
  594.          }
  595.       } else {
  596.          return '\u0000';
  597.       }
  598.    }
  599.  
  600.    public Character(char value) {
  601.       this.value = value;
  602.    }
  603.  
  604.    public char charValue() {
  605.       return this.value;
  606.    }
  607.  
  608.    public int hashCode() {
  609.       return this.value;
  610.    }
  611.  
  612.    public boolean equals(Object obj) {
  613.       if (obj != null && obj instanceof Character) {
  614.          return this.value == (Character)obj;
  615.       } else {
  616.          return false;
  617.       }
  618.    }
  619.  
  620.    public String toString() {
  621.       char[] buf = new char[]{this.value};
  622.       return String.valueOf(buf);
  623.    }
  624.  
  625.    static {
  626.       isLetterTable1080through11FF = isDefinedTable1080through11FF;
  627.       isLetterTable1E00through1FFF = isDefinedTable1E00through27BF;
  628.       isLetterTable3000through33FF = isDefinedTable3000through33FF;
  629.       isLetterTableFB00throughFFFF = new long[]{6881500229564629119L, -37L, 1125899906842623L, -524288L, -1L, -1L, -1L, -1L, -1L, -65536L, -196609L, 1152640029630136575L, 0L, -11540474045136896L, -1L, 2305843009213693951L, 576460743713488896L, -274743689218L, Long.MAX_VALUE, 486341884L};
  630.       isLDTable0000through06FF = new long[]{287948901175001088L, 576460743847706622L, 0L, -36028797027352577L, -1L, -1L, -1L, -270215977642229761L, 16777215L, -65536L, -279275953455105L, 4395899027455L, -1L, 4913427206346113087L, -17179879440L, 4503588160110591L, -8194L, -536936449L, -65409L, 234134404065073567L, -562949953421312L, -4320133121L, -288511851128421633L, 8734520370987023L, 576460745995194368L, -211110526976001L, 9007199254740991999L, 288019269919145983L};
  631.       isLDTable0900through0EFF = new long[]{-864691128455135250L, 562949938692095L, -3186861885341720594L, 576460544811219359L, -3211631683292264476L, 9006925953907079L, -869759877059465234L, 281204393851839L, -878767076314341394L, 562690925803919L, -4341532606274353172L, 2251250066275783L, -4327961440926441490L, 281212990012895L, -4327961440926441492L, 281214063754719L, -4323457841299070996L, 281212992110031L, 0L, 0L, -8646911284551352322L, 268435455L, 4323434403644581270L, 872365919L};
  632.       isLDTable1080through11FF = isDefinedTable1080through11FF;
  633.       isLDTable1E00through1FFF = isDefinedTable1E00through27BF;
  634.       isLDTable3000through33FF = isDefinedTable3000through33FF;
  635.       isLDTableFB00throughFFFF = new long[]{6881500229564629119L, -37L, 1125899906842623L, -524288L, -1L, -1L, -1L, -1L, -1L, -65536L, -196609L, 1152640029630136575L, 0L, -11540474045136896L, -1L, 2305843009213693951L, 576460743780532224L, -274743689218L, Long.MAX_VALUE, 486341884L};
  636.       toLowerCaseTable = new long[]{-6173215364225870507L, 3122495741643543722L, 1274187282820877526L, 6059124173486861744L, 5592405L, 0L, 0L, 0L, 0L, 0L, 17575006099264L, 93819265613824L, 281474976702462L, 6148914689804861440L, 6148914691236495361L, 78044801355024522L, -562949953421312L, 8388607L, 0L, 0L, 6148914691236517205L, 6148914691236517205L, 6148914689806259541L, 96076792050570581L, -71777217515815168L, 280378317225728L, 2234065794919104256L, 2233819500287893248L};
  637.       toUpperCaseTable = new long[]{6100313345257810602L, -3122495741643544235L, 2472794134709276968L, -6328495726735828128L, 11184810L, 1269983369232384L, 265480L, 0L, 0L, 0L, -299067162755072L, 1032063467880447L, -281474976710656L, -6148914690341797889L, -6148914691236560894L, 156089602710049044L, 0L, -8589934592L, 127L, 0L, -6148914691236517206L, -6148914691236517206L, -6148914694097032534L, 192153584101141162L, 71777214282006783L, 4611405638678478911L, 3097319977189631L, 2251950137737224L};
  638.    }
  639. }
  640.