1. /*
  2. * @(#)Character.java 1.61 00/02/02
  3. *
  4. * Copyright 1994-2000 Sun Microsystems, Inc. All Rights Reserved.
  5. *
  6. * This software is the proprietary information of Sun Microsystems, Inc.
  7. * Use is subject to license terms.
  8. *
  9. */
  10. // This file was generated AUTOMATICALLY from a template file Fri Jun 19 11:07:53 PDT 1998
  11. // Hand-merged JDK 1.1.7 Unicode 2.1.2 table changes back into 1.2 source - 7/23/98
  12. package java.lang;
  13. /**
  14. * The Character class wraps a value of the primitive type <code>char</code>
  15. * in an object. An object of type <code>Character</code> contains a
  16. * single field whose type is <code>char</code>.
  17. * <p>
  18. * In addition, this class provides several methods for determining
  19. * the type of a character and converting characters from uppercase
  20. * to lowercase and vice versa.
  21. * <p>
  22. * Many of the methods of class <code>Character</code> are defined
  23. * in terms of a "Unicode attribute table" that specifies
  24. * a name for every defined Unicode code point. The table also
  25. * includes other attributes, such as a decimal value, an uppercase
  26. * equivalent, a lowercase equivalent, and/or a titlecase equivalent.
  27. * The character attribute tables for specific versions of Unicode
  28. * are available on the World Wide Web in various subdirectories of:
  29. * <blockquote><pre>
  30. * ftp://ftp.unicode.org/Public/
  31. * </pre></blockquote>
  32. * <p>
  33. * For a more detailed specification of the <code>Character</code>
  34. * class, one that encompasses the exact behavior of methods such as
  35. * <code>isDigit</code>, <code>isLetter</code>,
  36. * <code>isLowerCase</code>, and <code>isUpperCase</code> over the
  37. * full range of Unicode values, see Gosling, Joy, and Steele, <i>The
  38. * Java Language Specification</i>.
  39. *
  40. * @author Lee Boynton
  41. * @author Guy Steele
  42. * @author Akira Tanaka
  43. * @version 1.61, 02/02/00
  44. * @since JDK1.0
  45. */
  46. public final class Character
  47. extends Object
  48. implements java.io.Serializable, Comparable
  49. {
  50. /**
  51. * The minimum radix available for conversion to and from Strings.
  52. * The constant value of this field is the smallest value permitted
  53. * for the radix argument in radix-conversion methods such as the
  54. * <code>digit</code> method, the <code>forDigit</code>
  55. * method, and the <code>toString</code> method of class
  56. * <code>Integer</code>.
  57. *
  58. * @see java.lang.Character#digit(char, int)
  59. * @see java.lang.Character#forDigit(int, int)
  60. * @see java.lang.Integer#toString(int, int)
  61. * @see java.lang.Integer#valueOf(java.lang.String)
  62. */
  63. public static final int MIN_RADIX = 2;
  64. /**
  65. * The maximum radix available for conversion to and from Strings.
  66. * The constant value of this field is the largest value permitted
  67. * for the radix argument in radix-conversion methods such as the
  68. * <code>digit</code> method, the <code>forDigit</code>
  69. * method, and the <code>toString</code> method of class
  70. * <code>Integer</code>.
  71. *
  72. * @see java.lang.Character#digit(char, int)
  73. * @see java.lang.Character#forDigit(int, int)
  74. * @see java.lang.Integer#toString(int, int)
  75. * @see java.lang.Integer#valueOf(java.lang.String)
  76. */
  77. public static final int MAX_RADIX = 36;
  78. /**
  79. * The constant value of this field is the smallest value of type
  80. * <code>char</code>.
  81. *
  82. * @since JDK1.0.2
  83. */
  84. public static final char MIN_VALUE = '\u0000';
  85. /**
  86. * The constant value of this field is the largest value of type
  87. * <code>char</code>.
  88. *
  89. * @since JDK1.0.2
  90. */
  91. public static final char MAX_VALUE = '\uffff';
  92. /**
  93. * The Class object representing the primitive type char.
  94. *
  95. * @since JDK1.1
  96. */
  97. public static final Class TYPE = Class.getPrimitiveClass("char");
  98. /**
  99. * Public data for enumerated Unicode general category types.
  100. *
  101. * @since JDK1.1
  102. */
  103. public static final byte
  104. UNASSIGNED = 0,
  105. UPPERCASE_LETTER = 1,
  106. LOWERCASE_LETTER = 2,
  107. TITLECASE_LETTER = 3,
  108. MODIFIER_LETTER = 4,
  109. OTHER_LETTER = 5,
  110. NON_SPACING_MARK = 6,
  111. ENCLOSING_MARK = 7,
  112. COMBINING_SPACING_MARK = 8,
  113. DECIMAL_DIGIT_NUMBER = 9,
  114. LETTER_NUMBER = 10,
  115. OTHER_NUMBER = 11,
  116. SPACE_SEPARATOR = 12,
  117. LINE_SEPARATOR = 13,
  118. PARAGRAPH_SEPARATOR = 14,
  119. CONTROL = 15,
  120. FORMAT = 16,
  121. PRIVATE_USE = 18,
  122. SURROGATE = 19,
  123. DASH_PUNCTUATION = 20,
  124. START_PUNCTUATION = 21,
  125. END_PUNCTUATION = 22,
  126. CONNECTOR_PUNCTUATION = 23,
  127. OTHER_PUNCTUATION = 24,
  128. MATH_SYMBOL = 25,
  129. CURRENCY_SYMBOL = 26,
  130. MODIFIER_SYMBOL = 27,
  131. OTHER_SYMBOL = 28;
  132. /**
  133. * Instances of this class represent particular subsets of the Unicode
  134. * character set. The only family of subsets defined in the
  135. * <code>Character</code> class is <code>{@link Character.UnicodeBlock
  136. * UnicodeBlock}</code>. Other portions of the Java API may define other
  137. * subsets for their own purposes.
  138. *
  139. * @since 1.2
  140. */
  141. public static class Subset {
  142. private String name;
  143. /**
  144. * Constructs a new <code>Subset</code> instance.
  145. *
  146. * @param name The name of this subset
  147. */
  148. protected Subset(String name) {
  149. this.name = name;
  150. }
  151. /**
  152. * Compares two <code>Subset</code> objects for equality. This
  153. * method returns <code>true</code> if and only if <code>x</code> and
  154. * <code>y</code> refer to the same object, and because it is final it
  155. * guarantees this for all subclasses.
  156. */
  157. public final boolean equals(Object obj) {
  158. return (this == obj);
  159. }
  160. /**
  161. * Returns the standard hash code as defined by the <code>{@link
  162. * Object#hashCode}</code> method. This method is final in order to
  163. * ensure that the <code>equals</code> and <code>hashCode</code>
  164. * methods will be consistent in all subclasses.
  165. */
  166. public final int hashCode() {
  167. return super.hashCode();
  168. }
  169. /**
  170. * Returns the name of this subset.
  171. */
  172. public final String toString() {
  173. return name;
  174. }
  175. }
  176. /**
  177. * A family of character subsets representing the character blocks defined
  178. * by the Unicode 2.0 specification. Any given character is contained by
  179. * at most one Unicode block.
  180. *
  181. * @since 1.2
  182. */
  183. public static final class UnicodeBlock extends Subset {
  184. private UnicodeBlock(String name) {
  185. super(name);
  186. }
  187. /** Constant for the Unicode character block of the same name. */
  188. public static final UnicodeBlock
  189. BASIC_LATIN
  190. = new UnicodeBlock("BASIC_LATIN"),
  191. LATIN_1_SUPPLEMENT
  192. = new UnicodeBlock("LATIN_1_SUPPLEMENT"),
  193. LATIN_EXTENDED_A
  194. = new UnicodeBlock("LATIN_EXTENDED_A"),
  195. LATIN_EXTENDED_B
  196. = new UnicodeBlock("LATIN_EXTENDED_B"),
  197. IPA_EXTENSIONS
  198. = new UnicodeBlock("IPA_EXTENSIONS"),
  199. SPACING_MODIFIER_LETTERS
  200. = new UnicodeBlock("SPACING_MODIFIER_LETTERS"),
  201. COMBINING_DIACRITICAL_MARKS
  202. = new UnicodeBlock("COMBINING_DIACRITICAL_MARKS"),
  203. GREEK
  204. = new UnicodeBlock("GREEK"),
  205. CYRILLIC
  206. = new UnicodeBlock("CYRILLIC"),
  207. ARMENIAN
  208. = new UnicodeBlock("ARMENIAN"),
  209. HEBREW
  210. = new UnicodeBlock("HEBREW"),
  211. ARABIC
  212. = new UnicodeBlock("ARABIC"),
  213. DEVANAGARI
  214. = new UnicodeBlock("DEVANAGARI"),
  215. BENGALI
  216. = new UnicodeBlock("BENGALI"),
  217. GURMUKHI
  218. = new UnicodeBlock("GURMUKHI"),
  219. GUJARATI
  220. = new UnicodeBlock("GUJARATI"),
  221. ORIYA
  222. = new UnicodeBlock("ORIYA"),
  223. TAMIL
  224. = new UnicodeBlock("TAMIL"),
  225. TELUGU
  226. = new UnicodeBlock("TELUGU"),
  227. KANNADA
  228. = new UnicodeBlock("KANNADA"),
  229. MALAYALAM
  230. = new UnicodeBlock("MALAYALAM"),
  231. THAI
  232. = new UnicodeBlock("THAI"),
  233. LAO
  234. = new UnicodeBlock("LAO"),
  235. TIBETAN
  236. = new UnicodeBlock("TIBETAN"),
  237. GEORGIAN
  238. = new UnicodeBlock("GEORGIAN"),
  239. HANGUL_JAMO
  240. = new UnicodeBlock("HANGUL_JAMO"),
  241. LATIN_EXTENDED_ADDITIONAL
  242. = new UnicodeBlock("LATIN_EXTENDED_ADDITIONAL"),
  243. GREEK_EXTENDED
  244. = new UnicodeBlock("GREEK_EXTENDED"),
  245. GENERAL_PUNCTUATION
  246. = new UnicodeBlock("GENERAL_PUNCTUATION"),
  247. SUPERSCRIPTS_AND_SUBSCRIPTS
  248. = new UnicodeBlock("SUPERSCRIPTS_AND_SUBSCRIPTS"),
  249. CURRENCY_SYMBOLS
  250. = new UnicodeBlock("CURRENCY_SYMBOLS"),
  251. COMBINING_MARKS_FOR_SYMBOLS
  252. = new UnicodeBlock("COMBINING_MARKS_FOR_SYMBOLS"),
  253. LETTERLIKE_SYMBOLS
  254. = new UnicodeBlock("LETTERLIKE_SYMBOLS"),
  255. NUMBER_FORMS
  256. = new UnicodeBlock("NUMBER_FORMS"),
  257. ARROWS
  258. = new UnicodeBlock("ARROWS"),
  259. MATHEMATICAL_OPERATORS
  260. = new UnicodeBlock("MATHEMATICAL_OPERATORS"),
  261. MISCELLANEOUS_TECHNICAL
  262. = new UnicodeBlock("MISCELLANEOUS_TECHNICAL"),
  263. CONTROL_PICTURES
  264. = new UnicodeBlock("CONTROL_PICTURES"),
  265. OPTICAL_CHARACTER_RECOGNITION
  266. = new UnicodeBlock("OPTICAL_CHARACTER_RECOGNITION"),
  267. ENCLOSED_ALPHANUMERICS
  268. = new UnicodeBlock("ENCLOSED_ALPHANUMERICS"),
  269. BOX_DRAWING
  270. = new UnicodeBlock("BOX_DRAWING"),
  271. BLOCK_ELEMENTS
  272. = new UnicodeBlock("BLOCK_ELEMENTS"),
  273. GEOMETRIC_SHAPES
  274. = new UnicodeBlock("GEOMETRIC_SHAPES"),
  275. MISCELLANEOUS_SYMBOLS
  276. = new UnicodeBlock("MISCELLANEOUS_SYMBOLS"),
  277. DINGBATS
  278. = new UnicodeBlock("DINGBATS"),
  279. CJK_SYMBOLS_AND_PUNCTUATION
  280. = new UnicodeBlock("CJK_SYMBOLS_AND_PUNCTUATION"),
  281. HIRAGANA
  282. = new UnicodeBlock("HIRAGANA"),
  283. KATAKANA
  284. = new UnicodeBlock("KATAKANA"),
  285. BOPOMOFO
  286. = new UnicodeBlock("BOPOMOFO"),
  287. HANGUL_COMPATIBILITY_JAMO
  288. = new UnicodeBlock("HANGUL_COMPATIBILITY_JAMO"),
  289. KANBUN
  290. = new UnicodeBlock("KANBUN"),
  291. ENCLOSED_CJK_LETTERS_AND_MONTHS
  292. = new UnicodeBlock("ENCLOSED_CJK_LETTERS_AND_MONTHS"),
  293. CJK_COMPATIBILITY
  294. = new UnicodeBlock("CJK_COMPATIBILITY"),
  295. CJK_UNIFIED_IDEOGRAPHS
  296. = new UnicodeBlock("CJK_UNIFIED_IDEOGRAPHS"),
  297. HANGUL_SYLLABLES
  298. = new UnicodeBlock("HANGUL_SYLLABLES"),
  299. SURROGATES_AREA
  300. = new UnicodeBlock("SURROGATES_AREA"),
  301. PRIVATE_USE_AREA
  302. = new UnicodeBlock("PRIVATE_USE_AREA"),
  303. CJK_COMPATIBILITY_IDEOGRAPHS
  304. = new UnicodeBlock("CJK_COMPATIBILITY_IDEOGRAPHS"),
  305. ALPHABETIC_PRESENTATION_FORMS
  306. = new UnicodeBlock("ALPHABETIC_PRESENTATION_FORMS"),
  307. ARABIC_PRESENTATION_FORMS_A
  308. = new UnicodeBlock("ARABIC_PRESENTATION_FORMS_A"),
  309. COMBINING_HALF_MARKS
  310. = new UnicodeBlock("COMBINING_HALF_MARKS"),
  311. CJK_COMPATIBILITY_FORMS
  312. = new UnicodeBlock("CJK_COMPATIBILITY_FORMS"),
  313. SMALL_FORM_VARIANTS
  314. = new UnicodeBlock("SMALL_FORM_VARIANTS"),
  315. ARABIC_PRESENTATION_FORMS_B
  316. = new UnicodeBlock("ARABIC_PRESENTATION_FORMS_B"),
  317. HALFWIDTH_AND_FULLWIDTH_FORMS
  318. = new UnicodeBlock("HALFWIDTH_AND_FULLWIDTH_FORMS"),
  319. SPECIALS
  320. = new UnicodeBlock("SPECIALS");
  321. private static final char blockStarts[] = {
  322. '\u0000',
  323. '\u0080',
  324. '\u0100',
  325. '\u0180',
  326. '\u0250',
  327. '\u02B0',
  328. '\u0300',
  329. '\u0370',
  330. '\u0400',
  331. '\u0500', // unassigned
  332. '\u0530',
  333. '\u0590',
  334. '\u0600',
  335. '\u0700', // unassigned
  336. '\u0900',
  337. '\u0980',
  338. '\u0A00',
  339. '\u0A80',
  340. '\u0B00',
  341. '\u0B80',
  342. '\u0C00',
  343. '\u0C80',
  344. '\u0D00',
  345. '\u0D80', // unassigned
  346. '\u0E00',
  347. '\u0E80',
  348. '\u0F00',
  349. '\u0FC0', // unassigned
  350. '\u10A0',
  351. '\u1100',
  352. '\u1200', // unassigned
  353. '\u1E00',
  354. '\u1F00',
  355. '\u2000',
  356. '\u2070',
  357. '\u20A0',
  358. '\u20D0',
  359. '\u2100',
  360. '\u2150',
  361. '\u2190',
  362. '\u2200',
  363. '\u2300',
  364. '\u2400',
  365. '\u2440',
  366. '\u2460',
  367. '\u2500',
  368. '\u2580',
  369. '\u25A0',
  370. '\u2600',
  371. '\u2700',
  372. '\u27C0', // unassigned
  373. '\u3000',
  374. '\u3040',
  375. '\u30A0',
  376. '\u3100',
  377. '\u3130',
  378. '\u3190',
  379. '\u3200',
  380. '\u3300',
  381. '\u3400', // unassigned
  382. '\u4E00',
  383. '\uA000', // unassigned
  384. '\uAC00',
  385. '\uD7A4', // unassigned
  386. '\uD800',
  387. '\uE000',
  388. '\uF900',
  389. '\uFB00',
  390. '\uFB50',
  391. '\uFE00', // unassigned
  392. '\uFE20',
  393. '\uFE30',
  394. '\uFE50',
  395. '\uFE70',
  396. '\uFEFF', // special
  397. '\uFF00',
  398. '\uFFF0'
  399. };
  400. private static final UnicodeBlock blocks[] = {
  401. BASIC_LATIN,
  402. LATIN_1_SUPPLEMENT,
  403. LATIN_EXTENDED_A,
  404. LATIN_EXTENDED_B,
  405. IPA_EXTENSIONS,
  406. SPACING_MODIFIER_LETTERS,
  407. COMBINING_DIACRITICAL_MARKS,
  408. GREEK,
  409. CYRILLIC,
  410. null,
  411. ARMENIAN,
  412. HEBREW,
  413. ARABIC,
  414. null,
  415. DEVANAGARI,
  416. BENGALI,
  417. GURMUKHI,
  418. GUJARATI,
  419. ORIYA,
  420. TAMIL,
  421. TELUGU,
  422. KANNADA,
  423. MALAYALAM,
  424. null,
  425. THAI,
  426. LAO,
  427. TIBETAN,
  428. null,
  429. GEORGIAN,
  430. HANGUL_JAMO,
  431. null,
  432. LATIN_EXTENDED_ADDITIONAL,
  433. GREEK_EXTENDED,
  434. GENERAL_PUNCTUATION,
  435. SUPERSCRIPTS_AND_SUBSCRIPTS,
  436. CURRENCY_SYMBOLS,
  437. COMBINING_MARKS_FOR_SYMBOLS,
  438. LETTERLIKE_SYMBOLS,
  439. NUMBER_FORMS,
  440. ARROWS,
  441. MATHEMATICAL_OPERATORS,
  442. MISCELLANEOUS_TECHNICAL,
  443. CONTROL_PICTURES,
  444. OPTICAL_CHARACTER_RECOGNITION,
  445. ENCLOSED_ALPHANUMERICS,
  446. BOX_DRAWING,
  447. BLOCK_ELEMENTS,
  448. GEOMETRIC_SHAPES,
  449. MISCELLANEOUS_SYMBOLS,
  450. DINGBATS,
  451. null,
  452. CJK_SYMBOLS_AND_PUNCTUATION,
  453. HIRAGANA,
  454. KATAKANA,
  455. BOPOMOFO,
  456. HANGUL_COMPATIBILITY_JAMO,
  457. KANBUN,
  458. ENCLOSED_CJK_LETTERS_AND_MONTHS,
  459. CJK_COMPATIBILITY,
  460. null,
  461. CJK_UNIFIED_IDEOGRAPHS,
  462. null,
  463. HANGUL_SYLLABLES,
  464. null,
  465. SURROGATES_AREA,
  466. PRIVATE_USE_AREA,
  467. CJK_COMPATIBILITY_IDEOGRAPHS,
  468. ALPHABETIC_PRESENTATION_FORMS,
  469. ARABIC_PRESENTATION_FORMS_A,
  470. null,
  471. COMBINING_HALF_MARKS,
  472. CJK_COMPATIBILITY_FORMS,
  473. SMALL_FORM_VARIANTS,
  474. ARABIC_PRESENTATION_FORMS_B,
  475. SPECIALS,
  476. HALFWIDTH_AND_FULLWIDTH_FORMS,
  477. SPECIALS
  478. };
  479. /**
  480. * Returns the object representing the Unicode block containing the
  481. * given character, or <code>null</code> if the character is not a
  482. * member of a defined block.
  483. *
  484. * @param c The character in question
  485. * @return The <code>UnicodeBlock</code> instance representing the
  486. * Unicode block of which this character is a member, or
  487. * <code>null</code> if the character is not a member of any
  488. * Unicode block
  489. */
  490. public static UnicodeBlock of(char c) {
  491. int top, bottom, current;
  492. bottom = 0;
  493. top = blockStarts.length;
  494. current = top2;
  495. // invariant: top > current >= bottom && ch >= unicodeBlockStarts[bottom]
  496. while (top - bottom > 1) {
  497. if (c >= blockStarts[current]) {
  498. bottom = current;
  499. } else {
  500. top = current;
  501. }
  502. current = (top + bottom) / 2;
  503. }
  504. return blocks[current];
  505. }
  506. }
  507. /**
  508. * The value of the Character.
  509. *
  510. * @serial
  511. */
  512. private char value;
  513. /** use serialVersionUID from JDK 1.0.2 for interoperability */
  514. private static final long serialVersionUID = 3786198910865385080L;
  515. /**
  516. * Constructs a <code>Character</code> object and initializes it so
  517. * that it represents the primitive <code>value</code> argument.
  518. *
  519. * @param value value for the new <code>Character</code> object.
  520. */
  521. public Character(char value) {
  522. this.value = value;
  523. }
  524. /**
  525. * Returns the value of this Character object.
  526. * @return the primitive <code>char</code> value represented by
  527. * this object.
  528. */
  529. public char charValue() {
  530. return value;
  531. }
  532. /**
  533. * Returns a hash code for this Character.
  534. * @return a hash code value for this object.
  535. */
  536. public int hashCode() {
  537. return (int)value;
  538. }
  539. /**
  540. * Compares this object against the specified object.
  541. * The result is <code>true</code> if and only if the argument is not
  542. * <code>null</code> and is a <code>Character</code> object that
  543. * represents the same <code>char</code> value as this object.
  544. *
  545. * @param obj the object to compare with.
  546. * @return <code>true</code> if the objects are the same;
  547. * <code>false</code> otherwise.
  548. */
  549. public boolean equals(Object obj) {
  550. if (obj instanceof Character) {
  551. return value == ((Character)obj).charValue();
  552. }
  553. return false;
  554. }
  555. /**
  556. * Returns a String object representing this character's value.
  557. * Converts this <code>Character</code> object to a string. The
  558. * result is a string whose length is <code>1</code>. The string's
  559. * sole component is the primitive <code>char</code> value represented
  560. * by this object.
  561. *
  562. * @return a string representation of this object.
  563. */
  564. public String toString() {
  565. char buf[] = {value};
  566. return String.valueOf(buf);
  567. }
  568. /**
  569. * Determines if the specified character is a lowercase character.
  570. * A character is lowercase if it is not in the range
  571. * <code>'\u2000'</code> through <code>'\u2FFF'</code>, the Unicode
  572. * attribute table does not specify a mapping to lowercase for the
  573. * character, and at least one of the following is true:
  574. * <ul>
  575. * <li>The attribute table specifies a mapping to uppercase for the
  576. * character.
  577. * <li>The name for the character contains the words "<code>SMALL
  578. * LETTER</code>".
  579. * <li>The name for the character contains the words "<code>SMALL
  580. * LIGATURE</code>".
  581. * </ul>
  582. * <p> A character is considered to be lowercase if and only if
  583. * it is specified to be lowercase by the Unicode 2.0 standard
  584. * (category "Ll" in the Unicode specification data file).
  585. * <p>
  586. * Of the ISO-LATIN-1 characters (character codes 0x0000 through 0x00FF),
  587. * the following are lowercase:
  588. * <p><blockquote><pre>
  589. * a b c d e f g h i j k l m n o p q r s t u v w x y z
  590. * \u00DF \u00E0 \u00E1 \u00E2 \u00E3 \u00E4 \u00E5 \u00E6 \u00E7
  591. * \u00E8 \u00E9 \u00EA \u00EB \u00EC \u00ED \u00EE \u00EF \u00F0
  592. * \u00F1 \u00F2 \u00F3 \u00F4 \u00F5 \u00F6 \u00F8 \u00F9 \u00FA
  593. * \u00FB \u00FC \u00FD \u00FE \u00FF
  594. * </pre></blockquote>
  595. * <p> Many other Unicode characters are lowercase, too.
  596. *
  597. * @param ch the character to be tested.
  598. * @return <code>true</code> if the character is lowercase;
  599. * <code>false</code> otherwise.
  600. * @see java.lang.Character#isLowerCase(char)
  601. * @see java.lang.Character#isTitleCase(char)
  602. * @see java.lang.Character#toLowerCase(char)
  603. */
  604. public static boolean isLowerCase(char ch) {
  605. return (A[Y[(X[ch>>6]<<5)|((ch>>1)&0x1F)]|(ch&0x1)] & 0x1F) == LOWERCASE_LETTER;
  606. }
  607. /**
  608. * Determines if the specified character is an uppercase character.
  609. * A character is uppercase if it is not in the range
  610. * <code>'\u2000'</code> through <code>'\u2FFF'</code>, the Unicode
  611. * attribute table does not specify a mapping to uppercase for the
  612. * character, and at least one of the following is true:
  613. * <ul>
  614. * <li>The attribute table specifies a mapping to lowercase for the
  615. * character.
  616. * <li>The name for the character contains the words
  617. * "<code>CAPITAL LETTER</code>".
  618. * <li>The name for the character contains the words
  619. * "<code>CAPITAL LIGATURE</code>".
  620. * </ul>
  621. * <p>
  622. * Of the ISO-LATIN-1 characters (character codes 0x0000 through 0x00FF),
  623. * the following are uppercase:
  624. * <p><blockquote><pre>
  625. * A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
  626. * \u00C0 \u00C1 \u00C2 \u00C3 \u00C4 \u00C5 \u00C6 \u00C7
  627. * \u00C8 \u00C9 \u00CA \u00CB \u00CC \u00CD \u00CE \u00CF \u00D0
  628. * \u00D1 \u00D2 \u00D3 \u00D4 \u00D5 \u00D6 \u00D8 \u00D9 \u00DA
  629. * \u00DB \u00DC \u00DD \u00DE
  630. * </pre></blockquote>
  631. * <p> Many other Unicode characters are uppercase, too.
  632. *
  633. * @param ch the character to be tested.
  634. * @return <code>true</code> if the character is uppercase;
  635. * <code>false</code> otherwise.
  636. * @see java.lang.Character#isLowerCase(char)
  637. * @see java.lang.Character#isTitleCase(char)
  638. * @see java.lang.Character#toUpperCase(char)
  639. * @since 1.0
  640. */
  641. public static boolean isUpperCase(char ch) {
  642. return (A[Y[(X[ch>>6]<<5)|((ch>>1)&0x1F)]|(ch&0x1)] & 0x1F) == UPPERCASE_LETTER;
  643. }
  644. /**
  645. * Determines if the specified character is a titlecase character.
  646. * A character is considered to be titlecase if and only if
  647. * it is specified to be titlecase by the Unicode 2.0 standard
  648. * (category "Lt" in the Unicode specification data file).
  649. * <p>
  650. * The printed representations of four Unicode characters look like
  651. * pairs of Latin letters. For example, there is an uppercase letter
  652. * that looks like "LJ" and has a corresponding lowercase letter that
  653. * looks like "lj". A third form, which looks like "Lj",
  654. * is the appropriate form to use when rendering a word in lowercase
  655. * with initial capitals, as for a book title.
  656. * <p>
  657. * These are the Unicode characters for which this method returns
  658. * <code>true</code>:
  659. * <ul>
  660. * <li><code>LATIN CAPITAL LETTER D WITH SMALL LETTER Z WITH CARON</code>
  661. * <li><code>LATIN CAPITAL LETTER L WITH SMALL LETTER J</code>
  662. * <li><code>LATIN CAPITAL LETTER N WITH SMALL LETTER J</code>
  663. * <li><code>LATIN CAPITAL LETTER D WITH SMALL LETTER Z</code>
  664. * </ul>
  665. *
  666. * @param ch the character to be tested.
  667. * @return <code>true</code> if the character is titlecase;
  668. * <code>false</code> otherwise.
  669. * @see java.lang.Character#isLowerCase(char)
  670. * @see java.lang.Character#isUpperCase(char)
  671. * @see java.lang.Character#toTitleCase(char)
  672. * @since JDK1.0.2
  673. */
  674. public static boolean isTitleCase(char ch) {
  675. return (A[Y[(X[ch>>6]<<5)|((ch>>1)&0x1F)]|(ch&0x1)] & 0x1F) == TITLECASE_LETTER;
  676. }
  677. /**
  678. * Determines if the specified character is a digit.
  679. * A character is considered to be a digit if it is not in the range
  680. * <code>'\u2000' <= ch <= '\u2FFF'</code>
  681. * and its Unicode name contains the word
  682. * "<code>DIGIT</code>". For a more complete
  683. * specification that encompasses all Unicode characters that are
  684. * defined as digits, see Gosling, Joy, and Steele, <i>The Java
  685. * Language Specification</i>.
  686. * <p>
  687. * These are the ranges of Unicode characters that are considered digits:
  688. * <table>
  689. * <tr><td>0x0030 through 0x0039</td>
  690. * <td>ISO-LATIN-1 digits ('0' through '9')</td></tr>
  691. * <tr><td>0x0660 through 0x0669</td> <td>Arabic-Indic digits</td></tr>
  692. * <tr><td>0x06F0 through 0x06F9</td>
  693. * <td>Extended Arabic-Indic digits</td></tr>
  694. * <tr><td>0x0966 through 0x096F</td> <td>Devanagari digits</td></tr>
  695. * <tr><td>0x09E6 through 0x09EF</td> <td>Bengali digits</td></tr>
  696. * <tr><td>0x0A66 through 0x0A6F</td> <td>Gurmukhi digits</td></tr>
  697. * <tr><td>0x0AE6 through 0x0AEF</td> <td>Gujarati digits</td></tr>
  698. * <tr><td>0x0B66 through 0x0B6F</td> <td>Oriya digits</td></tr>
  699. * <tr><td>0x0BE7 through 0x0BEF</td> <td>Tamil digits</td></tr>
  700. * <tr><td>0x0C66 through 0x0C6F</td> <td>Telugu digits</td></tr>
  701. * <tr><td>0x0CE6 through 0x0CEF</td> <td>Kannada digits</td></tr>
  702. * <tr><td>0x0D66 through 0x0D6F</td> <td>Malayalam digits</td></tr>
  703. * <tr><td>0x0E50 through 0x0E59</td> <td>Thai digits</td></tr>
  704. * <tr><td>0x0ED0 through 0x0ED9</td> <td>Lao digits</td></tr>
  705. * <tr><td>0x0F20 through 0x0F29</td> <td>Tibetan digits</td></tr>
  706. * <tr><td>0xFF10 through 0xFF19</td> <td>Fullwidth digits</td></tr>
  707. * </table>
  708. *
  709. * @param ch the character to be tested.
  710. * @return <code>true</code> if the character is a digit;
  711. * <code>false</code> otherwise.
  712. * @see java.lang.Character#digit(char, int)
  713. * @see java.lang.Character#forDigit(int, int)
  714. */
  715. public static boolean isDigit(char ch) {
  716. return (A[Y[(X[ch>>6]<<5)|((ch>>1)&0x1F)]|(ch&0x1)] & 0x1F) == DECIMAL_DIGIT_NUMBER;
  717. }
  718. /**
  719. * Determines if a character has a defined meaning in Unicode.
  720. * A character is defined if at least one of the following is true:
  721. * <ul>
  722. * <li>It has an entry in the Unicode attribute table.
  723. * <li>Its value is in the range
  724. * <code>
  725. * '\u3040' <= ch <= '\u9FA5'</code>.
  726. * <li>Its value is in the range
  727. * <code>
  728. * '\uF900' <= ch <= '\uFA2D'</code>.
  729. * </ul>
  730. *
  731. * @param ch the character to be tested
  732. * @return <code>true</code> if the character has a defined meaning
  733. * in Unicode; <code>false</code> otherwise.
  734. * @see java.lang.Character#isDigit(char)
  735. * @see java.lang.Character#isLetter(char)
  736. * @see java.lang.Character#isLetterOrDigit(char)
  737. * @see java.lang.Character#isLowerCase(char)
  738. * @see java.lang.Character#isTitleCase(char)
  739. * @see java.lang.Character#isUpperCase(char)
  740. * @since JDK1.0.2
  741. */
  742. public static boolean isDefined(char ch) {
  743. return (A[Y[(X[ch>>6]<<5)|((ch>>1)&0x1F)]|(ch&0x1)] & 0x1F) != UNASSIGNED;
  744. }
  745. /**
  746. * Determines if the specified character is a letter. For a
  747. * more complete specification that encompasses all Unicode
  748. * characters, see Gosling, Joy, and Steele, <i>The Java Language
  749. * Specification</i>.
  750. *
  751. * <p> A character is considered to be a letter if and only if
  752. * it is specified to be a letter by the Unicode 2.0 standard
  753. * (category "Lu", "Ll", "Lt", "Lm", or "Lo" in the Unicode
  754. * specification data file).
  755. *
  756. * <p> Note that most ideographic characters are considered
  757. * to be letters (category "Lo") for this purpose.
  758. *
  759. * <p> Note also that not all letters have case: many Unicode characters are
  760. * letters but are neither uppercase nor lowercase nor titlecase.
  761. *
  762. * @param ch the character to be tested.
  763. * @return <code>true</code> if the character is a letter;
  764. * <code>false</code> otherwise.
  765. * @see java.lang.Character#isDigit(char)
  766. * @see java.lang.Character#isJavaIdentifierStart(char)
  767. * @see java.lang.Character#isJavaLetter(char)
  768. * @see java.lang.Character#isJavaLetterOrDigit(char)
  769. * @see java.lang.Character#isLetterOrDigit(char)
  770. * @see java.lang.Character#isLowerCase(char)
  771. * @see java.lang.Character#isTitleCase(char)
  772. * @see java.lang.Character#isUnicodeIdentifierStart(char)
  773. * @see java.lang.Character#isUpperCase(char)
  774. */
  775. public static boolean isLetter(char ch) {
  776. return (((((1 << UPPERCASE_LETTER) |
  777. (1 << LOWERCASE_LETTER) |
  778. (1 << TITLECASE_LETTER) |
  779. (1 << MODIFIER_LETTER) |
  780. (1 << OTHER_LETTER))
  781. >> (A[Y[(X[ch>>6]<<5)|((ch>>1)&0x1F)]|(ch&0x1)] & 0x1F)) & 1) != 0);
  782. }
  783. /**
  784. * Determines if the specified character is a letter or digit.
  785. * For a more complete specification that encompasses all Unicode
  786. * characters, see Gosling, Joy, and Steele, <i>The Java Language
  787. * Specification</i>.
  788. *
  789. * <p> A character is considered to be a letter if and only if
  790. * it is specified to be a letter or a digit by the Unicode 2.0 standard
  791. * (category "Lu", "Ll", "Lt", "Lm", "Lo", or "Nd" in the Unicode
  792. * specification data file). In other words, isLetterOrDigit is true
  793. * of a character if and only if either isLetter is true of the character
  794. * or isDigit is true of the character.
  795. *
  796. * @param ch the character to be tested.
  797. * @return <code>true</code> if the character is a letter or digit;
  798. * <code>false</code> otherwise.
  799. * @see java.lang.Character#isDigit(char)
  800. * @see java.lang.Character#isJavaIdentifierPart(char)
  801. * @see java.lang.Character#isJavaLetter(char)
  802. * @see java.lang.Character#isJavaLetterOrDigit(char)
  803. * @see java.lang.Character#isLetter(char)
  804. * @see java.lang.Character#isUnicodeIdentifierPart(char)
  805. * @since JDK1.0.2
  806. */
  807. public static boolean isLetterOrDigit(char ch) {
  808. return (((((1 << UPPERCASE_LETTER) |
  809. (1 << LOWERCASE_LETTER) |
  810. (1 << TITLECASE_LETTER) |
  811. (1 << MODIFIER_LETTER) |
  812. (1 << OTHER_LETTER) |
  813. (1 << DECIMAL_DIGIT_NUMBER))
  814. >> (A[Y[(X[ch>>6]<<5)|((ch>>1)&0x1F)]|(ch&0x1)] & 0x1F)) & 1) != 0);
  815. }
  816. /**
  817. * Determines if the specified character is a
  818. * "Java" letter, that is, the character is permissible
  819. * as the first character in an identifier in the Java language.
  820. * <p>
  821. * A character is considered to be a Java letter if and only if it
  822. * is a letter, the ASCII dollar sign character <code>'$'</code>, or
  823. * the underscore character <code>'_'</code>.
  824. *
  825. * @param ch the character to be tested.
  826. * @return <code>true</code> if the character is a Java letter;
  827. * <code>false</code> otherwise.
  828. * @see java.lang.Character#isJavaIdentifierStart(char)
  829. * @see java.lang.Character#isJavaLetterOrDigit(char)
  830. * @see java.lang.Character#isLetter(char)
  831. * @see java.lang.Character#isLetterOrDigit(char)
  832. * @see java.lang.Character#isUnicodeIdentifierStart(char)
  833. * @since JDK1.0.2
  834. * @deprecated Replaced by isJavaIdentifierStart(char).
  835. */
  836. public static boolean isJavaLetter(char ch) {
  837. return (A[Y[(X[ch>>6]<<5)|((ch>>1)&0x1F)]|(ch&0x1)] & 0x00070000) >= 0x00050000;
  838. }
  839. /**
  840. * Determines if the specified character is a
  841. * "Java" letter or digit, that is, the character is
  842. * permissible as a non-initial character in an identifier in the
  843. * Java language.
  844. * <p>
  845. * A character is considered to be a Java letter or digit if and
  846. * only if it is a letter, a digit, the ASCII dollar sign character
  847. * <code>'$'</code>, or the underscore character <code>'_'</code>.
  848. *
  849. * @param ch the character to be tested.
  850. * @return <code>true</code> if the character is a Java letter or digit;
  851. * <code>false</code> otherwise.
  852. * @see java.lang.Character#isJavaIdentifierPart(char)
  853. * @see java.lang.Character#isJavaLetter(char)
  854. * @see java.lang.Character#isLetter(char)
  855. * @see java.lang.Character#isLetterOrDigit(char)
  856. * @see java.lang.Character#isUnicodeIdentifierPart(char)
  857. * @since JDK1.0.2
  858. * @deprecated Replaced by isJavaIdentifierPart(char).
  859. */
  860. public static boolean isJavaLetterOrDigit(char ch) {
  861. return (A[Y[(X[ch>>6]<<5)|((ch>>1)&0x1F)]|(ch&0x1)] & 0x00030000) != 0;
  862. }
  863. /**
  864. * Determines if the specified character is
  865. * permissible as the first character in a Java identifier.
  866. * A character may start a Java identifier if and only if
  867. * it is one of the following:
  868. * <ul>
  869. * <li> a letter
  870. * <li> a currency symbol (such as "$")
  871. * <li> a connecting punctuation character (such as "_").
  872. * </ul>
  873. *
  874. * @param ch the character to be tested.
  875. * @return true if the character may start a Java identifier;
  876. * false otherwise.
  877. * @see java.lang.Character#isJavaIdentifierPart(char)
  878. * @see java.lang.Character#isLetter(char)
  879. * @see java.lang.Character#isUnicodeIdentifierStart(char)
  880. * @since JDK1.1
  881. */
  882. public static boolean isJavaIdentifierStart(char ch) {
  883. return (A[Y[(X[ch>>6]<<5)|((ch>>1)&0x1F)]|(ch&0x1)] & 0x00070000) >= 0x00050000;
  884. }
  885. /**
  886. * Determines if the specified character may be part of a Java
  887. * identifier as other than the first character.
  888. * A character may be part of a Java identifier if and only if
  889. * it is one of the following:
  890. * <ul>
  891. * <li> a letter
  892. * <li> a currency symbol (such as "$")
  893. * <li> a connecting punctuation character (such as "_").
  894. * <li> a digit
  895. * <li> a numeric letter (such as a Roman numeral character)
  896. * <li> a combining mark
  897. * <li> a non-spacing mark
  898. * <li> an ignorable control character
  899. * </ul>
  900. *
  901. * @param ch the character to be tested.
  902. * @return true if the character may be part of a Unicode identifier;
  903. * false otherwise.
  904. * @see java.lang.Character#isIdentifierIgnorable(char)
  905. * @see java.lang.Character#isJavaIdentifierStart(char)
  906. * @see java.lang.Character#isLetterOrDigit(char)
  907. * @see java.lang.Character#isUnicodeIdentifierPart(char)
  908. * @since JDK1.1
  909. */
  910. public static boolean isJavaIdentifierPart(char ch) {
  911. return (A[Y[(X[ch>>6]<<5)|((ch>>1)&0x1F)]|(ch&0x1)] & 0x00030000) != 0;
  912. }
  913. /**
  914. * Determines if the specified character is
  915. * permissible as the first character in a Unicode identifier.
  916. * A character may start a Unicode identifier if and only if
  917. * it is a letter.
  918. *
  919. * @param ch the character to be tested.
  920. * @return true if the character may start a Unicode identifier;
  921. * false otherwise.
  922. * @see java.lang.Character#isJavaIdentifierStart(char)
  923. * @see java.lang.Character#isLetter(char)
  924. * @see java.lang.Character#isUnicodeIdentifierPart(char)
  925. * @since JDK1.1
  926. */
  927. public static boolean isUnicodeIdentifierStart(char ch) {
  928. return (A[Y[(X[ch>>6]<<5)|((ch>>1)&0x1F)]|(ch&0x1)] & 0x00070000) == 0x00070000;
  929. }
  930. /**
  931. * Determines if the specified character may be part of a Unicode
  932. * identifier as other than the first character.
  933. * A character may be part of a Unicode identifier if and only if
  934. * it is one of the following:
  935. * <ul>
  936. * <li> a letter
  937. * <li> a connecting punctuation character (such as "_").
  938. * <li> a digit
  939. * <li> a numeric letter (such as a Roman numeral character)
  940. * <li> a combining mark
  941. * <li> a non-spacing mark
  942. * <li> an ignorable control character
  943. * </ul>
  944. *
  945. * @param ch the character to be tested.
  946. * @return true if the character may be part of a Unicode identifier;
  947. * false otherwise.
  948. * @see java.lang.Character#isIdentifierIgnorable(char)
  949. * @see java.lang.Character#isJavaIdentifierPart(char)
  950. * @see java.lang.Character#isLetterOrDigit(char)
  951. * @see java.lang.Character#isUnicodeIdentifierStart(char)
  952. * @since JDK1.1
  953. */
  954. public static boolean isUnicodeIdentifierPart(char ch) {
  955. return (A[Y[(X[ch>>6]<<5)|((ch>>1)&0x1F)]|(ch&0x1)] & 0x00010000) != 0;
  956. }
  957. /**
  958. * Determines if the specified character should be regarded as
  959. * an ignorable character in a Java identifier or a Unicode identifier.
  960. * The following Unicode characters are ignorable in a Java identifier
  961. * or a Unicode identifier:
  962. * <table>
  963. * <tr><td>0x0000 through 0x0008,</td>
  964. * <td>ISO control characters that</td></tr>
  965. * <tr><td>0x000E through 0x001B,</td> <td>are not whitespace</td></tr>
  966. * <tr><td>and 0x007F through 0x009F</td></tr>
  967. * <tr><td>0x200C through 0x200F</td> <td>join controls</td></tr>
  968. * <tr><td>0x200A through 0x200E</td> <td>bidirectional controls</td></tr>
  969. * <tr><td>0x206A through 0x206F</td> <td>format controls</td></tr>
  970. * <tr><td>0xFEFF</td> <td>zero-width no-break space</td></tr>
  971. * </table>
  972. *
  973. * @param ch the character to be tested.
  974. * @return true if the character may be part of a Unicode identifier;
  975. * false otherwise.
  976. * @see java.lang.Character#isJavaIdentifierPart(char)
  977. * @see java.lang.Character#isUnicodeIdentifierPart(char)
  978. * @since JDK1.1
  979. */
  980. public static boolean isIdentifierIgnorable(char ch) {
  981. return (A[Y[(X[ch>>6]<<5)|((ch>>1)&0x1F)]|(ch&0x1)] & 0x00070000) == 0x00010000;
  982. }
  983. /**
  984. * The given character is mapped to its lowercase equivalent; if the
  985. * character has no lowercase equivalent, the character itself is
  986. * returned.
  987. * <p>
  988. * A character has a lowercase equivalent if and only if a lowercase
  989. * mapping is specified for the character in the Unicode attribute
  990. * table.
  991. * <p>
  992. * Note that some Unicode characters in the range
  993. * <code>'\u2000'</code> to <code>'\u2FFF'</code> have lowercase
  994. * mappings; this method does map such characters to their lowercase
  995. * equivalents even though the method <code>isUpperCase</code> does
  996. * not return <code>true</code> for such characters.
  997. *
  998. * @param ch the character to be converted.
  999. * @return the lowercase equivalent of the character, if any;
  1000. * otherwise the character itself.
  1001. * @see java.lang.Character#isLowerCase(char)
  1002. * @see java.lang.Character#isUpperCase(char)
  1003. * @see java.lang.Character#toTitleCase(char)
  1004. * @see java.lang.Character#toUpperCase(char)
  1005. */
  1006. public static char toLowerCase(char ch) {
  1007. int val = A[Y[(X[ch>>6]<<5)|((ch>>1)&0x1F)]|(ch&0x1)];
  1008. if ((val & 0x00200000) != 0)
  1009. return (char)(ch + (val >> 22));
  1010. else
  1011. return ch;
  1012. }
  1013. /**
  1014. * Converts the character argument to uppercase. A character has an
  1015. * uppercase equivalent if and only if an uppercase mapping is
  1016. * specified for the character in the Unicode attribute table.
  1017. * <p>
  1018. * Note that some Unicode characters in the range
  1019. * <code>'\u2000'</code> to <code>'\u2000FFF'</code> have uppercase
  1020. * mappings; this method does map such characters to their titlecase
  1021. * equivalents even though the method <code>isLowerCase</code> does
  1022. * not return <code>true</code> for such characters.
  1023. *
  1024. * @param ch the character to be converted.
  1025. * @return the uppercase equivalent of the character, if any;
  1026. * otherwise the character itself.
  1027. * @see java.lang.Character#isLowerCase(char)
  1028. * @see java.lang.Character#isUpperCase(char)
  1029. * @see java.lang.Character#toLowerCase(char)
  1030. * @see java.lang.Character#toTitleCase(char)
  1031. */
  1032. public static char toUpperCase(char ch) {
  1033. int val = A[Y[(X[ch>>6]<<5)|((ch>>1)&0x1F)]|(ch&0x1)];
  1034. if ((val & 0x00100000) != 0)
  1035. return (char)(ch - (val >> 22));
  1036. else
  1037. return ch;
  1038. }
  1039. /**
  1040. * Converts the character argument to titlecase. A character has a
  1041. * titlecase equivalent if and only if a titlecase mapping is
  1042. * specified for the character in the Unicode attribute table.
  1043. * <p>
  1044. * Note that some Unicode characters in the range
  1045. * <code>'\u2000'</code> through <code>'\u2FFF'</code> have titlecase
  1046. * mappings; this method does map such characters to their titlecase
  1047. * equivalents even though the method <code>isTitleCase</code> does
  1048. * not return <code>true</code> for such characters.
  1049. * <p>
  1050. * There are only four Unicode characters that are truly titlecase forms
  1051. * that are distinct from uppercase forms. As a rule, if a character has no
  1052. * true titlecase equivalent but does have an uppercase mapping, then the
  1053. * Unicode 2.0 attribute table specifies a titlecase mapping that is the
  1054. * same as the uppercase mapping.
  1055. *
  1056. * @param ch the character to be converted.
  1057. * @return the titlecase equivalent of the character, if any;
  1058. * otherwise the character itself.
  1059. * @see java.lang.Character#isTitleCase(char)
  1060. * @see java.lang.Character#toLowerCase(char)
  1061. * @see java.lang.Character#toUpperCase(char)
  1062. * @since JDK1.0.2
  1063. */
  1064. public static char toTitleCase(char ch) {
  1065. int val = A[Y[(X[ch>>6]<<5)|((ch>>1)&0x1F)]|(ch&0x1)];
  1066. if ((val & 0x00080000) != 0) {
  1067. // There is a titlecase equivalent. Perform further checks:
  1068. if ((val & 0x00100000) == 0) {
  1069. // The character does not have an uppercase equivalent, so it must
  1070. // already be uppercase; so add 1 to get the titlecase form.
  1071. return (char)(ch + 1);
  1072. }
  1073. else if ((val & 0x00200000) == 0) {
  1074. // The character does not have a lowercase equivalent, so it must
  1075. // already be lowercase; so subtract 1 to get the titlecase form.
  1076. return (char)(ch - 1);
  1077. }
  1078. else {
  1079. // The character has both an uppercase equivalent and a lowercase
  1080. // equivalent, so it must itself be a titlecase form; return it.
  1081. return ch;
  1082. }
  1083. }
  1084. else if ((val & 0x00100000) != 0) {
  1085. // This character has no titlecase equivalent but it does have an
  1086. // uppercase equivalent, so use that (subtract the signed case offset).
  1087. return (char)(ch - (val >> 22));
  1088. }
  1089. else
  1090. return ch;
  1091. }
  1092. /**
  1093. * Returns the numeric value of the character <code>ch</code> in the
  1094. * specified radix.
  1095. * <p>
  1096. * If the radix is not in the range <code>MIN_RADIX</code> <=
  1097. * <code>radix</code> <= <code>MAX_RADIX</code> or if the
  1098. * value of <code>ch</code> is not a valid digit in the specified
  1099. * radix, <code>-1</code> is returned. A character is a valid digit
  1100. * if at least one of the following is true:
  1101. * <ul>
  1102. * <li>The method <code>isDigit</code> is true of the character
  1103. * and the Unicode decimal digit value of the character (or its
  1104. * single-character decomposition) is less than the specified radix.
  1105. * In this case the decimal digit value is returned.
  1106. * <li>The character is one of the uppercase Latin letters
  1107. * <code>'A'</code> through <code>'Z'</code> and its code is less than
  1108. * <code>radix + 'A' - 10</code>.
  1109. * In this case, <code>ch - 'A' + 10</code>
  1110. * is returned.
  1111. * <li>The character is one of the lowercase Latin letters
  1112. * <code>'a'</code> through <code>'z'</code> and its code is less than
  1113. * <code>radix + 'a' - 10</code>.
  1114. * In this case, <code>ch - 'a' + 10</code>
  1115. * is returned.
  1116. * </ul>
  1117. *
  1118. * @param ch the character to be converted.
  1119. * @param radix the radix.
  1120. * @return the numeric value represented by the character in the
  1121. * specified radix.
  1122. * @see java.lang.Character#forDigit(int, int)
  1123. * @see java.lang.Character#isDigit(char)
  1124. */
  1125. public static int digit(char ch, int radix) {
  1126. int value = -1;
  1127. if (radix >= Character.MIN_RADIX && radix <= Character.MAX_RADIX) {
  1128. int val = A[Y[(X[ch>>6]<<5)|((ch>>1)&0x1F)]|(ch&0x1)];
  1129. int kind = val & 0x1F;
  1130. if (kind == DECIMAL_DIGIT_NUMBER) {
  1131. value = ((ch + (val >> 9)) & 0x1F);
  1132. }
  1133. else if ((val & 0x0000C000) == 0x0000C000) {
  1134. // Java supradecimal digit
  1135. value = ((ch + (val >> 9)) & 0x1F) + 10;
  1136. }
  1137. }
  1138. return (value < radix) ? value : -1;
  1139. }
  1140. /**
  1141. * Returns the Unicode numeric value of the character as a
  1142. * nonnegative integer.
  1143. * If the character does not have a numeric value, then -1 is returned.
  1144. * If the character has a numeric value that cannot be represented as a
  1145. * nonnegative integer (for example, a fractional value), then -2
  1146. * is returned.
  1147. *
  1148. * @param ch the character to be converted.
  1149. * @return the numeric value of the character, as a nonnegative int value;
  1150. * -2 if the character has a numeric value that is not a
  1151. * nonnegative integer; -1 if the character has no numeric value.
  1152. * @see java.lang.Character#forDigit(int, int)
  1153. * @see java.lang.Character#isDigit(char)
  1154. * @since JDK1.1
  1155. */
  1156. public static int getNumericValue(char ch) {
  1157. int val = A[Y[(X[ch>>6]<<5)|((ch>>1)&0x1F)]|(ch&0x1)];
  1158. switch ((val >> 14) & 0x3) {
  1159. default: // cannot occur
  1160. case (0x00000000 >> 14): // not numeric
  1161. return -1;
  1162. case (0x00004000 >> 14): // simple numeric
  1163. return (ch + (val >> 9)) & 0x1F;
  1164. case (0x00008000 >> 14) : // "strange" numeric
  1165. switch (ch) {
  1166. case '\u0BF1': return 100; // TAMIL NUMBER ONE HUNDRED
  1167. case '\u0BF2': return 1000; // TAMIL NUMBER ONE THOUSAND
  1168. case '\u216C': return 50; // ROMAN NUMERAL FIFTY
  1169. case '\u216D': return 100; // ROMAN NUMERAL ONE HUNDRED
  1170. case '\u216E': return 500; // ROMAN NUMERAL FIVE HUNDRED
  1171. case '\u216F': return 1000; // ROMAN NUMERAL ONE THOUSAND
  1172. case '\u217C': return 50; // SMALL ROMAN NUMERAL FIFTY
  1173. case '\u217D': return 100; // SMALL ROMAN NUMERAL ONE HUNDRED
  1174. case '\u217E': return 500; // SMALL ROMAN NUMERAL FIVE HUNDRED
  1175. case '\u217F': return 1000; // SMALL ROMAN NUMERAL ONE THOUSAND
  1176. case '\u2180': return 1000; // ROMAN NUMERAL ONE THOUSAND C D
  1177. case '\u2181': return 5000; // ROMAN NUMERAL FIVE THOUSAND
  1178. case '\u2182': return 10000; // ROMAN NUMERAL TEN THOUSAND
  1179. default: return -2;
  1180. }
  1181. case (0x0000C000 >> 14): // Java supradecimal
  1182. return ((ch + (val >> 9)) & 0x1F) + 10;
  1183. }
  1184. }
  1185. /**
  1186. * Determines if the specified character is ISO-LATIN-1 white space.
  1187. * This method returns <code>true</code> for the following five
  1188. * characters only:
  1189. * <table>
  1190. * <tr><td>'\t'</td> <td>\u0009</td>
  1191. * <td><code>HORIZONTAL TABULATION</code></td></tr>
  1192. * <tr><td>'\n'</td> <td>\u000A</td>
  1193. * <td><code>NEW LINE</code></td></tr>
  1194. * <tr><td>'\f'</td> <td>\u000C</td>
  1195. * <td><code>FORM FEED</code></td></tr>
  1196. * <tr><td>'\r'</td> <td>\u000D</td>
  1197. * <td><code>CARRIAGE RETURN</code></td></tr>
  1198. * <tr><td>'  '</td> <td>\u0020</td>
  1199. * <td><code>SPACE</code></td></tr>
  1200. * </table>
  1201. *
  1202. * @param ch the character to be tested.
  1203. * @return <code>true</code> if the character is ISO-LATIN-1 white
  1204. * space; <code>false</code> otherwise.
  1205. * @see java.lang.Character#isSpaceChar(char)
  1206. * @see java.lang.Character#isWhitespace(char)
  1207. * @deprecated Replaced by isWhitespace(char).
  1208. */
  1209. public static boolean isSpace(char ch) {
  1210. return (ch <= 0x0020) &&
  1211. (((((1L << 0x0009) |
  1212. (1L << 0x000A) |
  1213. (1L << 0x000C) |
  1214. (1L << 0x000D) |
  1215. (1L << 0x0020)) >> ch) & 1L) != 0);
  1216. }
  1217. /**
  1218. * Determines if the specified character is a Unicode space character.
  1219. * A character is considered to be a space character if and only if
  1220. * it is specified to be a space character by the Unicode 2.0 standard
  1221. * (category "Zs", "Zl, or "Zp" in the Unicode specification data file).
  1222. *
  1223. * @param ch the character to be tested.
  1224. * @return true if the character is a space character; false otherwise.
  1225. * @see java.lang.Character#isWhitespace(char)
  1226. * @since JDK1.1
  1227. */
  1228. public static boolean isSpaceChar(char ch) {
  1229. return (((((1 << SPACE_SEPARATOR) |
  1230. (1 << LINE_SEPARATOR) |
  1231. (1 << PARAGRAPH_SEPARATOR))
  1232. >> (A[Y[(X[ch>>6]<<5)|((ch>>1)&0x1F)]|(ch&0x1)] & 0x1F)) & 1) != 0);
  1233. }
  1234. /**
  1235. * Determines if the specified character is white space according to Java.
  1236. * A character is considered to be a Java whitespace character if and only
  1237. * if it satisfies one of the following criteria:
  1238. * <ul>
  1239. * <li> It is a Unicode space separator (category "Zs"), but is not
  1240. * a no-break space (\u00A0 or \uFEFF).
  1241. * <li> It is a Unicode line separator (category "Zl").
  1242. * <li> It is a Unicode paragraph separator (category "Zp").
  1243. * <li> It is \u0009, HORIZONTAL TABULATION.
  1244. * <li> It is \u000A, LINE FEED.
  1245. * <li> It is \u000B, VERTICAL TABULATION.
  1246. * <li> It is \u000C, FORM FEED.
  1247. * <li> It is \u000D, CARRIAGE RETURN.
  1248. * <li> It is \u001C, FILE SEPARATOR.
  1249. * <li> It is \u001D, GROUP SEPARATOR.
  1250. * <li> It is \u001E, RECORD SEPARATOR.
  1251. * <li> It is \u001F, UNIT SEPARATOR.
  1252. * </ul>
  1253. *
  1254. * @param ch the character to be tested.
  1255. * @return true if the character is a Java whitespace character;
  1256. * false otherwise.
  1257. * @see java.lang.Character#isSpaceChar(char)
  1258. * @since JDK1.1
  1259. */
  1260. public static boolean isWhitespace(char ch) {
  1261. return (A[Y[(X[ch>>6]<<5)|((ch>>1)&0x1F)]|(ch&0x1)] & 0x00070000) == 0x00040000;
  1262. }
  1263. /**
  1264. * Determines if the specified character is an ISO control character.
  1265. * A character is considered to be an ISO control character if its
  1266. * code is in the range \u0000 through \u001F or in the range
  1267. * \u007F through \u009F.
  1268. *
  1269. * @param ch the character to be tested.
  1270. * @return true if the character is an ISO control character;
  1271. * false otherwise.
  1272. *
  1273. * @see java.lang.Character#isSpaceChar(char)
  1274. * @see java.lang.Character#isWhitespace(char)
  1275. * @since JDK1.1
  1276. */
  1277. public static boolean isISOControl(char ch) {
  1278. return (ch <= 0x009F) && ((ch <= 0x001F) || (ch >= 0x007F));
  1279. }
  1280. /**
  1281. * Returns a value indicating a character category.
  1282. *
  1283. * @param ch the character to be tested.
  1284. * @return a value of type int, the character category.
  1285. * @see java.lang.Character#COMBINING_SPACING_MARK
  1286. * @see java.lang.Character#CONNECTOR_PUNCTUATION
  1287. * @see java.lang.Character#CONTROL
  1288. * @see java.lang.Character#CURRENCY_SYMBOL
  1289. * @see java.lang.Character#DASH_PUNCTUATION
  1290. * @see java.lang.Character#DECIMAL_DIGIT_NUMBER
  1291. * @see java.lang.Character#ENCLOSING_MARK
  1292. * @see java.lang.Character#END_PUNCTUATION
  1293. * @see java.lang.Character#FORMAT
  1294. * @see java.lang.Character#LETTER_NUMBER
  1295. * @see java.lang.Character#LINE_SEPARATOR
  1296. * @see java.lang.Character#LOWERCASE_LETTER
  1297. * @see java.lang.Character#MATH_SYMBOL
  1298. * @see java.lang.Character#MODIFIER_LETTER
  1299. * @see java.lang.Character#MODIFIER_SYMBOL
  1300. * @see java.lang.Character#NON_SPACING_MARK
  1301. * @see java.lang.Character#OTHER_LETTER
  1302. * @see java.lang.Character#OTHER_NUMBER
  1303. * @see java.lang.Character#OTHER_PUNCTUATION
  1304. * @see java.lang.Character#OTHER_SYMBOL
  1305. * @see java.lang.Character#PARAGRAPH_SEPARATOR
  1306. * @see java.lang.Character#PRIVATE_USE
  1307. * @see java.lang.Character#SPACE_SEPARATOR
  1308. * @see java.lang.Character#START_PUNCTUATION
  1309. * @see java.lang.Character#SURROGATE
  1310. * @see java.lang.Character#TITLECASE_LETTER
  1311. * @see java.lang.Character#UNASSIGNED
  1312. * @see java.lang.Character#UPPERCASE_LETTER
  1313. * @since JDK1.1
  1314. */
  1315. public static int getType(char ch) {
  1316. return A[Y[(X[ch>>6]<<5)|((ch>>1)&0x1F)]|(ch&0x1)] & 0x1F;
  1317. }
  1318. /**
  1319. * Determines the character representation for a specific digit in
  1320. * the specified radix. If the value of <code>radix</code> is not a
  1321. * valid radix, or the value of <code>digit</code> is not a valid
  1322. * digit in the specified radix, the null character
  1323. * (<code>'\u0000'</code>) is returned.
  1324. * <p>
  1325. * The <code>radix</code> argument is valid if it is greater than or
  1326. * equal to <code>MIN_RADIX</code> and less than or equal to
  1327. * <code>MAX_RADIX</code>. The <code>digit</code> argument is valid if
  1328. * <code>0 <= digit <= radix</code>.
  1329. * <p>
  1330. * If the digit is less than 10, then
  1331. * <code>'0' + digit</code> is returned. Otherwise, the value
  1332. * <code>'a' + digit - 10</code> is returned.
  1333. *
  1334. * @param digit the number to convert to a character.
  1335. * @param radix the radix.
  1336. * @return the <code>char</code> representation of the specified digit
  1337. * in the specified radix.
  1338. * @see java.lang.Character#MIN_RADIX
  1339. * @see java.lang.Character#MAX_RADIX
  1340. * @see java.lang.Character#digit(char, int)
  1341. */
  1342. public static char forDigit(int digit, int radix) {
  1343. if ((digit >= radix) || (digit < 0)) {
  1344. return '\0';
  1345. }
  1346. if ((radix < MIN_RADIX) || (radix > MAX_RADIX)) {
  1347. return '\0';
  1348. }
  1349. if (digit < 10) {
  1350. return (char)('0' + digit);
  1351. }
  1352. return (char)('a' - 10 + digit);
  1353. }
  1354. /**
  1355. * Compares two Characters numerically.
  1356. *
  1357. * @param anotherCharacter the <code>Character</code> to be compared.
  1358. * @return the value <code>0</code> if the argument Character is equal to
  1359. * this Character; a value less than <code>0</code> if this
  1360. * Character is numerically less than the Character argument; and
  1361. * a value greater than <code>0</code> if this Character is
  1362. * numerically greater than the Character argument (unsigned
  1363. * comparison). Note that this is strictly a numerical
  1364. * comparison; it is not locale-dependent.
  1365. * @since 1.2
  1366. */
  1367. public int compareTo(Character anotherCharacter) {
  1368. return this.value - anotherCharacter.value;
  1369. }
  1370. /**
  1371. * Compares this Character to another Object. If the Object is
  1372. * a Character, this function behaves like
  1373. * <code>compareTo(Character)</code>. Otherwise, it throws a
  1374. * <code>ClassCastException</code> (as Characters are
  1375. * comparable only to other Characters).
  1376. *
  1377. * @param o the <code>Object</code> to be compared.
  1378. * @return the value <code>0</code> if the argument is a Character
  1379. * numerically equal to this Character; a value less than
  1380. * <code>0</code> if the argument is a Character numerically
  1381. * greater than this Character; and a value greater than
  1382. * <code>0</code> if the argument is a Character numerically
  1383. * less than this Character.
  1384. * @exception <code>ClassCastException</code> if the argument is not a
  1385. * <code>Character</code>.
  1386. * @see java.lang.Comparable
  1387. * @since 1.2 */
  1388. public int compareTo(Object o) {
  1389. return compareTo((Character)o);
  1390. }
  1391. /* The character properties are currently encoded into 32 bits in the following manner:
  1392. 10 bits signed offset used for converting case
  1393. 1 bit if 1, adding the signed offset converts the character to lowercase
  1394. 1 bit if 1, subtracting the signed offset converts the character to uppercase
  1395. 1 bit if 1, this character has a titlecase equivalent (possibly itself)
  1396. 3 bits 0 may not be part of an identifier
  1397. 1 ignorable control; may continue a Unicode identifier or Java identifier
  1398. 2 may continue a Java identifier but not a Unicode identifier (unused)
  1399. 3 may continue a Unicode identifier or Java identifier
  1400. 4 is a Java whitespace character
  1401. 5 may start or continue a Java identifier;
  1402. may continue but not start a Unicode identifier (underscores)
  1403. 6 may start or continue a Java identifier but not a Unicode identifier ($)
  1404. 7 may start or continue a Unicode identifier or Java identifier
  1405. Thus:
  1406. 5, 6, 7 may start a Java identifier
  1407. 1, 2, 3, 5, 6, 7 may continue a Java identifier
  1408. 7 may start a Unicode identifier
  1409. 1, 3, 5, 7 may continue a Unicode identifier
  1410. 1 is ignorable within an identifier
  1411. 4 is Java whitespace
  1412. 2 bits 0 this character has no numeric property
  1413. 1 adding the digit offset to the character code and then
  1414. masking with 0x1F will produce the desired numeric value
  1415. 2 this character has a "strange" numeric value
  1416. 3 a Java supradecimal digit: adding the digit offset to the
  1417. character code, then masking with 0x1F, then adding 10
  1418. will produce the desired numeric value
  1419. 5 bits digit offset
  1420. 4 bits reserved for future use
  1421. 5 bits character type
  1422. */
  1423. // The following tables and code generated using:
  1424. // java GenerateCharacter -string -o Character.java.x [10 5 1] [-spec UnicodeData-2.1.2.txt] [-template Character.java.template]
  1425. // The X table has 1024 entries for a total of 1024 bytes.
  1426. private static final byte X[] = new byte[1024];
  1427. private static final String X_DATA =
  1428. "\u0100\u0302\u0504\u0706\u0908\u0B0A\u0D0C\u0F0E\u1110\u1312\u1514\u1716\u1918"+
  1429. "\u1B1A\u1C1C\u1C1C\u1C1C\u1C1C\u1E1D\u201F\u2221\u2423\u2625\u2827\u2A29\u2C2B"+
  1430. "\u2E2D\u1C1C\u302F\u3231\u3433\u1C35\u1C1C\u3736\u3938\u3B3A\u1C1C\u1C1C\u1C1C"+
  1431. "\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C"+
  1432. "\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u3C3C\u3E3D\u403F\u4241\u4443"+
  1433. "\u4645\u4847\u4A49\u4C4B\u4E4D\u504F\u1C1C\u5251\u5453\u5555\u5756\u5758\u1C1C"+
  1434. "\u5A59\u1C5B\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C"+
  1435. "\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u5D5C\u5F5E\u3860\u1C61\u6362\u6564\u6766\u6866"+
  1436. "\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C"+
  1437. "\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C"+
  1438. "\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C"+
  1439. "\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C"+
  1440. "\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838"+
  1441. "\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838"+
  1442. "\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838"+
  1443. "\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838"+
  1444. "\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838"+
  1445. "\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838"+
  1446. "\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838"+
  1447. "\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838"+
  1448. "\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838"+
  1449. "\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838"+
  1450. "\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838"+
  1451. "\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838"+
  1452. "\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u1C69\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C"+
  1453. "\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C"+
  1454. "\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u1C1C\u3838\u3838\u3838\u3838\u3838\u3838\u3838"+
  1455. "\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838"+
  1456. "\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838"+
  1457. "\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838"+
  1458. "\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838"+
  1459. "\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838"+
  1460. "\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838\u3838"+
  1461. "\u3838\u3838\u1C6A\u6B6B\u6B6B\u6B6B\u6B6B\u6B6B\u6B6B\u6B6B\u6B6B\u6B6B\u6B6B"+
  1462. "\u6B6B\u6B6B\u6B6B\u6B6B\u6B6B\u6B6B\u6C6C\u6C6C\u6C6C\u6C6C\u6C6C\u6C6C\u6C6C"+
  1463. "\u6C6C\u6C6C\u6C6C\u6C6C\u6C6C\u6C6C\u6C6C\u6C6C\u6C6C\u6C6C\u6C6C\u6C6C\u6C6C"+
  1464. "\u6C6C\u6C6C\u6C6C\u6C6C\u6C6C\u6C6C\u6C6C\u6C6C\u6C6C\u6C6C\u6C6C\u6C6C\u6C6C"+
  1465. "\u6C6C\u6C6C\u6C6C\u6C6C\u6C6C\u6C6C\u6C6C\u6C6C\u6C6C\u6C6C\u6C6C\u6C6C\u6C6C"+
  1466. "\u6C6C\u6C6C\u6C6C\u6C6C\u3838\u3838\u1C6D\u1C1C\u6F6E\u7170\u7272\u7272\u7473"+
  1467. "\u7675\u7877\u7972\u7B7A\u7D7C";
  1468. // The Y table has 4032 entries for a total of 8064 bytes.
  1469. private static final short Y[] = new short[4032];
  1470. private static final String Y_DATA =
  1471. "\000\000\000\000\002\004\004\000\000\000\000\000\000\000\004\004\006\010\012"+
  1472. "\014\016\020\022\024\026\026\026\026\026\030\032\034\036\040\040\040\040\040"+
  1473. "\040\040\040\040\040\040\040\042\044\046\050\052\052\052\052\052\052\052\052"+
  1474. "\052\052\052\052\054\056\060\000\000\000\000\000\000\000\000\000\000\000\000"+
  1475. "\000\000\000\000\062\064\064\066\070\072\074\076\100\102\104\106\110\112\114"+
  1476. "\116\120\120\120\120\120\120\120\120\120\120\120\122\120\120\120\124\126\126"+
  1477. "\126\126\126\126\126\126\126\126\126\130\126\126\126\132\134\134\134\134\134"+
  1478. "\134\134\134\134\134\134\134\134\134\134\134\134\134\134\134\134\134\134\134"+
  1479. "\136\134\134\134\140\142\142\142\142\142\142\142\144\134\134\134\134\134\134"+
  1480. "\134\134\134\134\134\134\134\134\134\134\134\134\134\134\134\134\134\146\142"+
  1481. "\142\150\152\134\134\154\156\160\144\162\164\156\166\170\134\172\174\176\134"+
  1482. "\134\134\200\202\204\134\206\210\212\142\214\134\216\134\220\220\220\222\224"+
  1483. "\226\222\230\142\142\142\142\142\142\142\232\134\134\134\134\134\134\134\134"+
  1484. "\134\234\226\134\236\236\134\134\134\134\134\134\134\134\134\134\134\134\134"+
  1485. "\134\134\236\236\236\236\236\236\236\236\236\236\236\236\236\236\236\236\236"+
  1486. "\236\236\236\236\236\236\236\236\236\236\236\172\240\242\244\246\250\172\172"+
  1487. "\252\254\172\172\256\172\172\260\172\262\264\172\172\172\172\172\172\266\172"+
  1488. "\172\270\272\172\172\172\274\172\172\172\172\172\172\172\172\172\172\276\236"+
  1489. "\236\236\300\300\300\300\302\304\300\300\300\306\306\306\306\306\306\306\300"+
  1490. "\306\306\306\306\306\306\310\300\300\302\306\306\236\236\236\236\236\236\236"+
  1491. "\236\236\236\236\312\312\312\312\312\312\312\312\312\312\312\312\312\312\312"+
  1492. "\312\312\312\312\312\312\312\312\312\312\312\312\312\312\312\312\312\312\312"+
  1493. "\312\236\236\236\236\236\236\236\236\236\236\236\236\236\312\236\236\236\236"+
  1494. "\236\236\236\236\236\314\236\236\316\236\320\236\236\306\322\324\326\330\332"+
  1495. "\334\120\120\120\120\120\120\120\120\336\120\120\120\120\340\342\344\126\126"+
  1496. "\126\126\126\126\126\126\346\126\126\126\126\350\352\354\356\360\362\236\364"+
  1497. "\364\364\364\134\134\134\134\134\134\134\366\216\236\236\236\236\236\236\370"+
  1498. "\372\372\372\372\372\374\372\120\120\120\120\120\120\120\120\120\120\120\120"+
  1499. "\120\120\120\120\126\126\126\126\126\126\126\126\126\126\126\126\126\126\126"+
  1500. "\126\376\u0100\u0100\u0100\u0100\u0100\u0102\u0100\134\134\134\134\134\134"+
  1501. "\134\134\134\134\134\134\134\134\134\134\134\u0104\312\u0106\236\236\236\236"+
  1502. "\134\134\134\134\134\134\134\134\134\134\134\134\134\134\134\134\134\134\134"+
  1503. "\134\134\134\134\134\u0108\142\u010A\u010C\u010A\u010C\u010A\236\134\134\134"+
  1504. "\134\134\134\134\134\134\134\134\134\134\134\236\134\134\134\134\236\134\236"+
  1505. "\236\236\236\236\236\236\236\236\236\236\236\236\236\236\236\236\236\236\236"+
  1506. "\236\236\236\236\236\236\236\u010E\u0110\u0110\u0110\u0110\u0110\u0110\u0110"+
  1507. "\u0110\u0110\u0110\u0110\u0110\u0110\u0110\u0110\u0110\u0110\u0110\u0112\u0114"+
  1508. "\314\314\314\u0116\u0118\u0118\u0118\u0118\u0118\u0118\u0118\u0118\u0118\u0118"+
  1509. "\u0118\u0118\u0118\u0118\u0118\u0118\u0118\u0118\u011A\u011C\236\236\236\u011E"+
  1510. "\u0120\u0120\u0120\u0120\u0120\u0120\u0120\u0120\u011E\u0120\u0120\u0120\u0120"+
  1511. "\u0120\u0120\u0120\u0120\u0120\u0120\u0120\u011E\u0120\u0122\u0122\u0124\u0126"+
  1512. "\236\236\236\236\236\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128"+
  1513. "\u0128\u0128\u0128\u0128\u012A\236\236\u0128\u012C\u012E\236\236\236\236\236"+
  1514. "\236\236\236\236\236\236\u012E\236\236\236\236\236\236\u0130\236\u0130\u0132"+
  1515. "\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u012A"+
  1516. "\236\236\u0134\u0128\u0128\u0128\u0128\u0136\u0120\u0120\u0120\u0126\236\236"+
  1517. "\236\236\236\236\u0138\u0138\u0138\u0138\u0138\u013A\u013C\236\u013E\u0128"+
  1518. "\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128"+
  1519. "\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128"+
  1520. "\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\236\u0128\u0128\u012A\u0128"+
  1521. "\u0128\u0128\u0128\u0128\u0128\u0128\u012A\u0128\u0128\u0140\u0120\u0120\u0120"+
  1522. "\u0142\u0144\u0120\u0120\u0146\u0148\u014A\u0120\u0120\236\026\026\026\026"+
  1523. "\026\236\236\236\236\236\236\236\236\236\236\236\236\236\236\236\236\236\236"+
  1524. "\236\236\236\236\236\236\236\236\236\236\236\236\236\236\236\236\236\u014C"+
  1525. "\u014E\u0150\220\220\220\220\220\220\220\220\220\220\220\220\220\220\220\220"+
  1526. "\220\220\220\220\220\220\220\220\220\220\236\u0152\u0154\u0156\312\312\312"+
  1527. "\u014E\u0154\u0156\236\u0104\312\u0106\236\220\220\220\220\220\312\314\u0158"+
  1528. "\u0158\u0158\u0158\u0158\320\236\236\236\236\236\236\236\u014C\u0154\u0150"+
  1529. "\220\220\220\u015A\u0150\u015A\u0150\220\220\220\220\220\220\220\220\220\220"+
  1530. "\u015A\220\220\220\u015A\u015A\236\220\220\236\u0106\u0154\u0156\312\u0106"+
  1531. "\u015C\u015E\u015C\u0156\236\236\236\236\u015C\236\236\220\u0150\220\312\236"+
  1532. "\u0158\u0158\u0158\u0158\u0158\220\u0160\u0162\u0162\u0164\u0166\236\236\236"+
  1533. "\u0106\u0150\220\220\u015A\236\u0150\u015A\u0150\220\220\220\220\220\220\220"+
  1534. "\220\220\220\u015A\220\220\220\u015A\220\u0150\u015A\220\236\u0106\u0154\u0156"+
  1535. "\u0106\236\u014C\u0106\u014C\312\236\236\236\236\236\u0150\220\u015A\u015A"+
  1536. "\236\236\236\u0158\u0158\u0158\u0158\u0158\312\220\u015A\236\236\236\236\236"+
  1537. "\u014C\u014E\u0150\220\220\220\u0150\u0150\220\u0150\220\220\220\220\220\220"+
  1538. "\220\220\220\220\u015A\220\220\220\u015A\220\u0150\220\220\236\u0152\u0154"+
  1539. "\u0156\312\312\u014C\u014E\u015C\u0156\236\u0166\236\236\236\236\236\236\236"+
  1540. "\u015A\236\236\u0158\u0158\u0158\u0158\u0158\236\236\236\236\236\236\236\236"+
  1541. "\u014C\u0154\u0150\220\220\220\u015A\u0150\u015A\u0150\220\220\220\220\220"+
  1542. "\220\220\220\220\220\u015A\220\220\220\u015A\220\236\220\220\236\u0152\u0156"+
  1543. "\u0156\312\236\u015C\u015E\u015C\u0156\236\236\236\236\u014E\236\236\220\u0150"+
  1544. "\220\236\236\u0158\u0158\u0158\u0158\u0158\u0166\236\236\236\236\236\236\236"+
  1545. "\236\u014E\u0150\220\220\u015A\236\220\u015A\220\220\236\u0150\u015A\u015A"+
  1546. "\220\236\u0150\u015A\236\220\u015A\236\220\220\220\220\u0150\220\236\236\u0154"+
  1547. "\u014E\u015E\236\u0154\u015E\u0154\u0156\236\236\236\236\u015C\236\236\236"+
  1548. "\236\236\236\236\u0168\u0158\u0158\u0158\u0158\u016A\u016C\236\236\236\236"+
  1549. "\236\236\u015C\u0154\u0150\220\220\220\u015A\220\u015A\220\220\220\220\220"+
  1550. "\220\220\220\220\220\220\u015A\220\220\220\220\220\u0150\220\220\236\236\312"+
  1551. "\u014E\u0154\u015E\312\u0106\312\312\236\236\236\u014C\u0106\236\236\236\236"+
  1552. "\220\236\236\u0158\u0158\u0158\u0158\u0158\236\236\236\236\236\236\236\236"+
  1553. "\236\u0154\u0150\220\220\220\u015A\220\u015A\220\220\220\220\220\220\220\220"+
  1554. "\220\220\220\u015A\220\220\220\220\220\u0150\220\220\236\236\u0156\u0154\u0154"+
  1555. "\u015E\u014E\u015E\u0154\312\236\236\236\u015C\u015E\236\236\236\u015A\220"+
  1556. "\236\236\u0158\u0158\u0158\u0158\u0158\236\236\236\236\236\236\236\236\236"+
  1557. "\u0154\u0150\220\220\220\u015A\220\u015A\220\220\220\220\220\220\220\220\220"+
  1558. "\220\220\u015A\220\220\220\220\220\220\220\220\236\236\u0154\u0156\312\236"+
  1559. "\u0154\u015E\u0154\u0156\236\236\236\236\u015C\236\236\236\236\220\236\236"+
  1560. "\u0158\u0158\u0158\u0158\u0158\236\236\236\236\236\236\236\236\u0150\220\220"+
  1561. "\220\220\220\220\220\220\220\220\220\220\220\220\220\220\220\220\220\220\220"+
  1562. "\220\u016E\u0170\220\312\312\312\u0106\236\u0172\220\220\220\u0174\312\312"+
  1563. "\312\u0176\u0178\u0178\u0178\u0178\u0178\314\236\236\236\236\236\236\236\236"+
  1564. "\236\236\236\236\236\236\236\236\236\236\u0150\u015A\u015A\u0150\u015A\u015A"+
  1565. "\u0150\236\236\236\220\220\u0150\220\220\220\u0150\220\u0150\u0150\236\220"+
  1566. "\u0150\u016E\u0170\220\312\312\312\u014C\u0152\236\220\220\u015A\316\312\312"+
  1567. "\312\236\u0178\u0178\u0178\u0178\u0178\236\220\236\236\236\236\236\236\236"+
  1568. "\236\236\236\236\236\236\236\236\236\236\u017A\u017A\314\314\314\314\314\314"+
  1569. "\314\u017C\u017A\u017A\312\u017A\u017A\u017A\u017E\u017E\u017E\u017E\u017E"+
  1570. "\u0180\u0180\u0180\u0180\u0180\u0104\u0104\u0104\u0182\u0182\u0154\220\220"+
  1571. "\220\220\u0150\220\220\220\220\220\220\220\220\220\220\220\220\220\220\220"+
  1572. "\220\236\236\236\u014C\312\312\312\312\312\312\u014E\312\312\u0184\312\312"+
  1573. "\312\236\236\312\312\312\u014C\u014C\312\312\312\312\312\312\312\312\312\312"+
  1574. "\236\u014C\312\312\312\u014C\236\236\236\236\236\236\236\236\236\236\236\236"+
  1575. "\236\236\236\236\236\236\236\u0110\u0110\u0110\u0110\u0110\u0110\u0110\u0110"+
  1576. "\u0110\u0110\u0110\u0110\u0110\u0110\u0110\u0110\u0110\u0110\u0110\236\236"+
  1577. "\236\236\236\172\172\172\172\172\172\172\172\172\172\172\172\172\172\172\172"+
  1578. "\172\172\172\276\236\u011C\236\236\220\220\220\220\220\220\220\220\220\220"+
  1579. "\220\220\220\220\220\220\220\220\220\220\220\220\220\220\220\220\220\220\220"+
  1580. "\220\220\220\220\220\220\220\220\220\220\220\220\220\220\220\220\236\236\u0150"+
  1581. "\220\220\220\220\220\220\220\220\220\220\220\220\220\220\220\220\220\220\220"+
  1582. "\220\220\220\220\220\220\220\220\220\220\220\220\220\220\u015A\236\236\220"+
  1583. "\220\220\220\220\220\220\220\220\220\220\220\220\220\220\220\220\220\220\220"+
  1584. "\220\220\220\220\220\220\220\220\220\220\220\220\220\220\220\220\220\220\220"+
  1585. "\220\220\236\236\236\134\134\134\134\134\134\134\134\134\134\134\134\134\134"+
  1586. "\134\134\134\134\134\134\134\134\134\134\134\134\134\134\134\134\134\134\134"+
  1587. "\134\134\134\134\134\134\134\134\134\134\172\172\u0186\236\236\134\134\134"+
  1588. "\134\134\134\134\134\134\134\134\134\134\134\134\134\134\134\134\134\134\134"+
  1589. "\134\134\134\134\134\134\134\134\134\134\134\134\134\134\134\134\134\134\134"+
  1590. "\134\134\134\134\236\236\236\u0188\u0188\u0188\u0188\u018A\u018A\u018A\u018A"+
  1591. "\u0188\u0188\u0188\236\u018A\u018A\u018A\236\u0188\u0188\u0188\u0188\u018A"+
  1592. "\u018A\u018A\u018A\u0188\u0188\u0188\u0188\u018A\u018A\u018A\u018A\u0188\u0188"+
  1593. "\u0188\236\u018A\u018A\u018A\236\u018C\u018C\u018C\u018C\u018E\u018E\u018E"+
  1594. "\u018E\u0188\u0188\u0188\u0188\u018A\u018A\u018A\u018A\u0190\u0192\u0192\u0194"+
  1595. "\u0196\u0198\u019A\236\u0188\u0188\u0188\u0188\u018A\u018A\u018A\u018A\u0188"+
  1596. "\u0188\u0188\u0188\u018A\u018A\u018A\u018A\u0188\u0188\u0188\u0188\u018A\u018A"+
  1597. "\u018A\u018A\u0188\u019C\276\172\u018A\u019E\u01A0\u01A2\306\u019C\276\172"+
  1598. "\u01A4\u01A4\u01A0\306\u0188\172\236\172\u018A\u01A6\u01A8\306\u0188\172\u01AA"+
  1599. "\172\u018A\u01AC\u01AE\306\236\u019C\276\172\u01B0\u01B2\u01A0\310\u01B4\u01B4"+
  1600. "\u01B4\u01B6\u01B4\u01B4\u01B8\u01BA\u01BC\u01BC\u01BC\014\u01BE\u01C0\u01BE"+
  1601. "\u01C0\014\014\014\014\u01C2\u01B8\u01B8\u01C4\u01C6\u01C6\u01C8\014\u01CA"+
  1602. "\u01CC\014\u01CE\u01D0\014\u01D2\u01D4\236\236\236\236\236\236\236\236\236"+
  1603. "\236\236\236\236\236\236\236\236\u01B8\u01B8\u01B8\u01D6\236\102\102\102\u01D8"+
  1604. "\u01D2\u01DA\u01DC\u01DC\u01DC\u01DC\u01DC\u01D8\u01D2\u01D4\236\236\236\236"+
  1605. "\236\236\236\236\064\064\064\064\064\064\u01DE\236\236\236\236\236\236\236"+
  1606. "\236\236\236\236\236\236\236\236\236\236\312\312\312\312\312\312\u01E0\u01E2"+
  1607. "\u01E4\236\236\236\236\236\236\236\236\236\236\236\236\236\236\236\066\u01E6"+
  1608. "\066\u01E8\066\u01EA\u01EC\u01EE\u01EC\u01F0\u01E8\066\u01EC\u01EC\u01EC\066"+
  1609. "\066\066\u01E6\u01E6\u01E6\u01EC\u01EC\u01EE\u01EC\u01E8\u01F2\u01F4\u01F6"+
  1610. "\236\236\236\236\236\236\236\236\236\236\236\236\u01F8\114\114\114\114\114"+
  1611. "\u01FA\u01FC\u01FC\u01FC\u01FC\u01FC\u01FC\u01FE\u01FE\u0200\u0200\u0200\u0200"+
  1612. "\u0200\u0200\u0202\u0202\u0204\u0206\236\236\236\236\236\236\u0208\u0208\u020A"+
  1613. "\066\066\066\066\066\066\066\066\066\066\066\066\066\066\066\066\066\066\066"+
  1614. "\066\066\066\066\066\066\066\066\066\066\066\u020A\u020A\066\066\066\066\066"+
  1615. "\066\066\066\066\066\u020C\236\236\236\236\236\236\236\236\236\236\u020E\u0210"+
  1616. "\032\u0208\u0210\u0210\u0210\u0208\u020E\u01D8\u020E\032\u0208\u0210\u0210"+
  1617. "\u020E\u0210\032\032\032\u0208\u020E\u0210\u0210\u0210\u0210\u0208\u0208\u020E"+
  1618. "\u020E\u0210\u0210\u0210\u0210\u0210\u0210\u0210\u0210\032\u0208\u0208\u0210"+
  1619. "\u0210\u0208\u0208\u0208\u0208\u020E\032\032\u0210\u0210\u0210\u0210\u0208"+
  1620. "\u0210\u0210\u0210\u0210\u0210\u0210\u0210\u0210\u0210\u0210\u0210\u0210\u0210"+
  1621. "\u0210\u0210\032\u020E\u0210\032\u0208\u0208\032\u0208\u0208\u0208\u0208\u0210"+
  1622. "\u0208\u0210\u0210\u0210\u0210\u0210\u0210\u0210\u0210\u0210\032\u0208\u0208"+
  1623. "\u0210\u0208\u0208\u0208\u0208\u020E\u0210\u0210\u0208\u0210\u0208\u0208\u0210"+
  1624. "\u0210\u0210\u0210\u0210\u0210\u0210\u0210\u0210\u0210\u0210\u0210\u0208\u0210"+
  1625. "\236\236\236\236\236\236\236\u020C\066\066\066\u0210\u0210\066\066\066\066"+
  1626. "\066\066\066\066\066\066\u0210\066\066\066\u0212\u0214\066\066\066\066\066"+
  1627. "\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A"+
  1628. "\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A"+
  1629. "\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u0166\236\236\066\066\066"+
  1630. "\066\066\066\066\066\066\066\066\066\066\066\066\066\066\066\u020C\236\236"+
  1631. "\236\236\236\236\236\236\236\236\236\236\236\066\066\066\066\066\u020C\236"+
  1632. "\236\236\236\236\236\236\236\236\236\u0216\u0216\u0216\u0216\u0216\u0216\u0216"+
  1633. "\u0216\u0216\u0216\u0218\u0218\u0218\u0218\u0218\u0218\u0218\u0218\u0218\u0218"+
  1634. "\u021A\u021A\u021A\u021A\u021A\u021A\u021A\u021A\u021A\u021A\066\066\066\066"+
  1635. "\066\066\066\066\066\066\066\066\066\u021C\u021C\u021C\u021C\u021C\u021C\u021C"+
  1636. "\u021C\u021C\u021C\u021C\u021C\u021C\u021E\u021E\u021E\u021E\u021E\u021E\u021E"+
  1637. "\u021E\u021E\u021E\u021E\u021E\u021E\u0220\236\236\236\236\236\236\236\236"+
  1638. "\236\236\066\066\066\066\066\066\066\066\066\066\066\066\066\066\066\066\066"+
  1639. "\066\066\066\066\066\066\066\066\066\066\066\066\066\066\066\066\066\066\066"+
  1640. "\066\066\066\066\066\066\066\236\236\236\236\236\066\066\066\066\066\066\066"+
  1641. "\066\066\066\066\066\066\066\066\066\066\066\066\066\066\066\066\066\066\066"+
  1642. "\066\066\066\066\066\066\066\066\066\066\066\066\066\066\236\236\236\236\236"+
  1643. "\236\236\236\066\066\066\066\066\066\066\066\066\066\236\236\236\066\066\066"+
  1644. "\066\066\066\066\066\066\066\066\066\066\066\066\066\066\066\066\u0222\066"+
  1645. "\u020C\066\066\236\066\066\066\066\066\066\066\066\066\066\066\066\066\066"+
  1646. "\u0222\066\066\066\066\066\066\066\066\066\066\066\066\066\066\066\066\066"+
  1647. "\u0222\u0222\066\u020C\236\u020C\066\066\066\u020C\u0222\066\066\066\236\236"+
  1648. "\236\236\236\236\236\u0224\u0224\u0224\u0224\u0224\u0216\u0216\u0216\u0216"+
  1649. "\u0216\u0226\u0226\u0226\u0226\u0226\u020C\236\066\066\066\066\066\066\066"+
  1650. "\066\066\066\066\066\u0222\066\066\066\066\066\066\u020C\006\014\u0228\u022A"+
  1651. "\016\016\016\016\016\066\016\016\016\016\u022C\u022E\u0230\u0232\u0232\u0232"+
  1652. "\u0232\312\312\312\u0234\u0236\u0236\066\236\236\236\u0222\u0150\220\220\220"+
  1653. "\220\220\220\220\220\220\220\220\220\220\220\220\220\220\220\220\220\220\220"+
  1654. "\220\220\220\220\220\220\220\220\220\220\220\220\220\220\220\220\220\220\220"+
  1655. "\u015A\236\u014C\u0238\300\316\u0150\220\220\220\220\220\220\220\220\220\220"+
  1656. "\220\220\220\220\220\220\220\220\220\220\220\220\220\220\220\220\220\220\220"+
  1657. "\220\220\220\220\220\220\220\220\220\220\220\220\220\220\220\u016E\300\316"+
  1658. "\236\236\u0150\220\220\220\220\220\220\220\220\220\220\220\220\220\220\220"+
  1659. "\220\220\220\220\u015A\236\u0150\220\220\220\220\220\220\220\220\220\220\220"+
  1660. "\220\220\220\u015A\u017A\u0180\u0180\u017A\u017A\u017A\u017A\u017A\236\236"+
  1661. "\236\236\236\236\236\236\236\236\236\236\236\236\236\236\u017A\u017A\u017A"+
  1662. "\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u0166\236"+
  1663. "\u0180\u0180\u0180\u0180\u0180\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A"+
  1664. "\u017A\u017A\u017A\u017A\u017A\236\236\236\236\236\236\236\236\236\236\236"+
  1665. "\236\236\236\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A"+
  1666. "\u017A\u017A\u017A\236\u023A\u023C\u023C\u023C\u023C\u023C\u017A\u017A\u017A"+
  1667. "\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A"+
  1668. "\u017A\u017A\u017A\u0166\236\236\236\236\236\236\236\u017A\u017A\u017A\u017A"+
  1669. "\u017A\u017A\236\236\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A"+
  1670. "\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A"+
  1671. "\u017A\u0166\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A"+
  1672. "\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A"+
  1673. "\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A"+
  1674. "\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A"+
  1675. "\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u0166\236\u023A\u017A"+
  1676. "\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A"+
  1677. "\u017A\u017A\u017A\236\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A\u017A"+
  1678. "\u017A\u017A\u017A\u017A\u017A\u017A\u0166\220\220\220\220\220\220\220\220"+
  1679. "\220\220\220\220\220\220\220\220\220\220\220\236\236\236\236\236\236\236\236"+
  1680. "\236\236\236\236\236\220\220\220\220\220\220\220\220\220\220\220\220\220\220"+
  1681. "\220\220\220\220\236\236\236\236\236\236\236\236\236\236\236\236\236\236\u023E"+
  1682. "\u023E\u023E\u023E\u023E\u023E\u023E\u023E\u023E\u023E\u023E\u023E\u023E\u023E"+
  1683. "\u023E\u023E\u023E\u023E\u023E\u023E\u023E\u023E\u023E\u023E\u023E\u023E\u023E"+
  1684. "\u023E\u023E\u023E\u023E\u023E\u0240\u0240\u0240\u0240\u0240\u0240\u0240\u0240"+
  1685. "\u0240\u0240\u0240\u0240\u0240\u0240\u0240\u0240\u0240\u0240\u0240\u0240\u0240"+
  1686. "\u0240\u0240\u0240\u0240\u0240\u0240\u0240\u0240\u0240\u0240\u0240\220\220"+
  1687. "\220\220\220\220\220\220\220\220\220\220\220\220\220\220\220\220\220\220\220"+
  1688. "\220\220\236\236\236\236\236\236\236\236\236\172\172\172\276\236\236\236\236"+
  1689. "\236\u0242\172\172\236\236\236\u013E\u0128\u0128\u0128\u0128\u0244\u0128\u0128"+
  1690. "\u0128\u0128\u0128\u0128\u012A\u0128\u0128\u012A\u012A\u0128\u0132\u012A\u0128"+
  1691. "\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128"+
  1692. "\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128"+
  1693. "\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128"+
  1694. "\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128"+
  1695. "\u0128\236\236\236\236\236\236\236\236\236\236\236\236\236\236\236\236\u0132"+
  1696. "\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128"+
  1697. "\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128"+
  1698. "\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128"+
  1699. "\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128"+
  1700. "\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128"+
  1701. "\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128"+
  1702. "\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u01BE\236\236\236\236\236\236\236"+
  1703. "\236\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128"+
  1704. "\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128"+
  1705. "\u0128\u0128\u0128\u0128\u0128\u0128\u0128\236\u0128\u0128\u0128\u0128\u0128"+
  1706. "\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128"+
  1707. "\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\236\236\236\236\236"+
  1708. "\236\236\236\236\236\236\236\236\236\236\236\236\236\236\236\u0128\u0128\u0128"+
  1709. "\u0128\u0128\u0128\236\236\236\236\236\236\236\236\236\236\236\236\236\236"+
  1710. "\236\236\236\236\u0246\u0246\236\236\236\236\236\236\u0248\u024A\u024C\u024E"+
  1711. "\u024E\u024E\u024E\u024E\u024E\u024E\u0250\236\u0252\014\u01CE\u0254\014\u0256"+
  1712. "\014\014\u022C\u024E\u024E\u01CC\014\074\u0208\u0258\u025A\014\236\236\u0128"+
  1713. "\u012A\u012A\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128"+
  1714. "\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128"+
  1715. "\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u0128\u012A\u025C"+
  1716. "\u0252\014\u025E\014\u01BE\u0260\u0248\014\026\026\026\026\026\014\u0208\u0262"+
  1717. "\036\040\040\040\040\040\040\040\040\040\040\040\040\u0264\u0266\046\050\052"+
  1718. "\052\052\052\052\052\052\052\052\052\052\052\u0268\u026A\u0258\u0252\u01BE"+
  1719. "\u026C\220\220\220\220\220\u026E\220\220\220\220\220\220\220\220\220\220\220"+
  1720. "\220\220\220\220\220\220\220\220\220\220\220\300\220\220\220\220\220\220\220"+
  1721. "\220\220\220\220\220\220\220\220\u015A\236\220\220\220\236\220\220\220\236"+
  1722. "\220\220\220\236\220\u015A\236\u0270\u0272\u0274\u0276\u0208\u0208\u020A\u020C"+
  1723. "\236\236\236\236\236\236\066\236";
  1724. // The A table has 632 entries for a total of 2528 bytes.
  1725. private static final int A[] = new int[632];
  1726. private static final String A_DATA =
  1727. "\001\u018F\001\u018F\001\u018F\004\u012F\004\u018F\004\u018F\004\u014C\000"+
  1728. "\u0198\000\u0198\000\270\006\272\000\270\000\u0198\000\u0198\000\u0175\000"+
  1729. "\u0176\000\u0198\000\271\000\370\000\264\000\370\000\230\003\u6069\003\u6069"+
  1730. "\000\370\000\u0198\000\u0179\000\u0199\000\u0179\000\u0198\000\u0198\u0827"+
  1731. "\uFE21\u0827\uFE21\u0827\uFE21\u0827\uFE21\000\u0175\000\u0198\000\u0176\000"+
  1732. "\u019B\005\u0197\000\u019B\u0817\uFE22\u0817\uFE22\u0817\uFE22\u0817\uFE22"+
  1733. "\000\u0175\000\u0199\000\u0176\000\u0199\001\u018F\000\u014C\000\u0198\006"+
  1734. "\272\006\272\000\u019C\000\u019C\000\u019B\000\u019C\007\u0182\000\u0195\000"+
  1735. "\u0199\000\u0194\000\u019C\000\u019B\000\274\000\271\000\u606B\000\u606B\000"+
  1736. "\u019B\007\u0182\000\u019C\000\u0198\000\u019B\000\u506B\007\u0182\000\u0196"+
  1737. "\000\u818B\000\u818B\000\u818B\000\u0198\u0827\041\u0827\041\u0827\041\000"+
  1738. "\u0199\u0827\041\007\042\u0817\042\u0817\042\u0817\042\000\u0199\u0817\042"+
  1739. "\uE1D7\042\147\041\127\042\uCE67\041\u3A17\042\007\042\147\041\127\042\147"+
  1740. "\041\127\042\007\042\uE1E7\041\147\041\127\042\u4B17\042\007\042\u34A7\041"+
  1741. "\u33A7\041\147\041\127\042\u3367\041\u3367\041\147\041\u13E7\041\u32A7\041"+
  1742. "\u32E7\041\147\041\u33E7\041\007\042\u34E7\041\u3467\041\007\042\007\042\u34E7"+
  1743. "\041\u3567\041\007\042\u35A7\041\007\041\147\041\127\042\u36A7\041\007\045"+
  1744. "\007\042\u36A7\041\147\041\127\042\u3667\041\u3667\041\147\041\127\042\u36E7"+
  1745. "\041\007\042\007\045\007\045\007\045\257\041\177\043\237\042\257\041\177\043"+
  1746. "\237\042\237\042\147\041\127\042\u13D7\042\007\042\257\041\000\000\000\000"+
  1747. "\007\042\u3497\042\u3397\042\007\042\u3357\042\u3357\042\007\042\u3297\042"+
  1748. "\007\042\u32D7\042\u3357\042\007\042\007\042\u33D7\042\u3457\042\u34D7\042"+
  1749. "\007\042\u34D7\042\u3557\042\007\042\007\042\uCAA7\042\007\042\u3697\042\u3697"+
  1750. "\042\007\042\u3657\042\u3657\042\u36D7\042\007\042\007\042\000\000\007\044"+
  1751. "\007\044\007\044\000\073\000\073\007\044\000\073\000\073\000\073\000\000\003"+
  1752. "\046\003\046\000\070\000\070\007\044\000\000\000\070\000\000\u09A7\041\000"+
  1753. "\070\u0967\041\u0967\041\u0967\041\000\000\u1027\041\000\000\u0FE7\041\u0FE7"+
  1754. "\041\007\042\u0827\041\000\000\u0827\041\u0997\042\u0957\042\u0957\042\u0957"+
  1755. "\042\007\042\u0817\042\u07D7\042\u0817\042\u1017\042\u0FD7\042\u0FD7\042\000"+
  1756. "\000\u0F97\042\u0E57\042\007\041\007\041\007\041\u0BD7\042\u0D97\042\000\000"+
  1757. "\007\041\000\000\u1597\042\u1417\042\000\000\u1427\041\u1427\041\u1427\041"+
  1758. "\u1427\041\000\000\000\000\u1417\042\u1417\042\u1417\042\u1417\042\000\000"+
  1759. "\000\074\003\046\003\046\000\000\007\045\147\041\127\042\000\000\000\000\147"+
  1760. "\041\000\000\u0C27\041\u0C27\041\u0C27\041\u0C27\041\000\000\000\000\007\044"+
  1761. "\000\000\u0C17\042\u0C17\042\u0C17\042\u0C17\042\007\042\000\000\000\070\000"+
  1762. "\000\003\106\003\106\003\106\000\130\003\106\003\106\000\130\003\106\000\000"+
  1763. "\007\105\007\105\007\105\000\000\007\105\000\130\000\130\000\000\000\000\000"+
  1764. "\130\000\000\007\105\007\104\007\105\007\105\003\106\003\u40C9\003\u40C9\000"+
  1765. "\270\000\330\000\330\000\130\003\106\007\105\000\130\007\105\003\106\000\107"+
  1766. "\000\107\003\106\003\106\007\104\007\104\003\106\003\106\000\134\000\000\003"+
  1767. "\046\003\046\003\050\000\000\007\045\003\046\007\045\003\050\003\050\003\050"+
  1768. "\003\046\003\u7429\003\u7429\007\045\000\000\000\000\003\050\003\050\000\000"+
  1769. "\006\072\006\072\000\u5A2B\000\u5A2B\000\u802B\000\u6E2B\000\074\000\000\000"+
  1770. "\000\003\u7429\000\u742B\000\u802B\000\u802B\000\000\007\045\000\070\007\045"+
  1771. "\003\046\000\000\006\072\007\044\003\046\003\046\000\074\003\u6029\003\u6029"+
  1772. "\000\074\000\074\000\070\000\074\003\u4029\003\u4029\000\053\000\053\000\065"+
  1773. "\000\066\003\046\000\070\007\042\u0ED7\042\uFE17\042\uFE17\042\uFE27\041\uFE27"+
  1774. "\041\007\042\uFE17\042\000\000\uFE27\041\uED97\042\uED97\042\uEA97\042\uEA97"+
  1775. "\042\uE717\042\uE717\042\uE017\042\uE017\042\uE417\042\uE417\042\uE097\042"+
  1776. "\uE097\042\007\042\uFDD7\042\uEDA7\041\uEDA7\041\uFDE7\041\000\073\007\041"+
  1777. "\000\073\uEAA7\041\uEAA7\041\uE727\041\uE727\041\000\000\000\073\007\042\uFE57"+
  1778. "\042\uE427\041\uE427\041\uFE67\041\000\073\uE027\041\uE027\041\uE0A7\041\uE0A7"+
  1779. "\041\004\u014C\004\u014C\004\u014C\004\354\001\u0190\001\u0190\001\060\001"+
  1780. "\120\000\u0194\000\u0194\000\u0195\000\u0196\000\u0195\000\u0195\004\u010D"+
  1781. "\004\u010E\001\u0190\000\000\000\270\000\270\000\270\000\u0198\000\u0198\000"+
  1782. "\u0195\000\u0196\000\u0198\000\u0198\005\u0197\005\u0197\000\u0198\000\u0199"+
  1783. "\000\u0175\000\u0176\000\000\000\u606B\000\000\000\271\000\271\000\u0176\007"+
  1784. "\u0182\000\u406B\000\u406B\006\272\000\000\003\046\000\047\000\047\000\047"+
  1785. "\000\047\003\046\007\u0181\000\u019C\000\u019C\007\u0181\007\u0182\007\u0181"+
  1786. "\007\u0181\007\u0181\007\u0182\007\u0182\007\u0181\007\u0182\007\u0182\007"+
  1787. "\u0185\007\u0185\007\u0185\007\u0185\000\000\000\000\000\u818B\000\u818B\000"+
  1788. "\u458B\u0427\u422A\u0427\u422A\u0427\u802A\u0427\u802A\u0417\u622A\u0417\u622A"+
  1789. "\u0417\u802A\u0417\u802A\007\u802A\007\u802A\007\u802A\000\000\000\u0199\000"+
  1790. "\u0199\000\u0199\000\u019C\000\u019C\000\000\000\u0199\000\u0179\000\u0179"+
  1791. "\000\u0179\000\u019C\000\u0175\000\u0176\000\u019C\000\u438B\000\u438B\000"+
  1792. "\u5B8B\000\u5B8B\000\u738B\000\u738B\u06A0\u019C\u06A0\u019C\u0690\u019C\u0690"+
  1793. "\u019C\000\u6D8B\000\000\000\000\000\u019C\000\u578B\000\u578B\000\u6F8B\000"+
  1794. "\u6F8B\000\u019C\007\u0184\000\u0198\007\u738A\000\u0194\000\u0195\000\u0196"+
  1795. "\000\u0196\000\u019C\007\u402A\007\u402A\007\u402A\000\u0194\007\u0184\007"+
  1796. "\u0184\007\u0184\003\046\007\044\000\000\000\074\000\u422B\000\u422B\000\063"+
  1797. "\000\063\000\062\000\062\000\000\007\042\007\105\000\131\003\u0186\003\u0186"+
  1798. "\000\u0198\000\u0194\000\u0194\005\u0197\005\u0197\000\u0195\000\u0196\000"+
  1799. "\u0195\000\u0196\000\000\000\000\000\u0198\005\u0197\005\u0197\000\u0198\000"+
  1800. "\000\000\u0199\000\000\000\u0198\006\u019A\000\000\001\u0190\006\u019A\000"+
  1801. "\u0198\000\u0198\000\u0199\000\u0199\000\u0198\u0827\uFE21\000\u0195\000\u0198"+
  1802. "\000\u0196\u0817\uFE22\000\u0195\000\u0199\000\u0196\000\u0198\000\070\007"+
  1803. "\044\007\045\006\u019A\006\u019A\000\u0199\000\u019B\000\u019C\006\u019A\006"+
  1804. "\u019A\000\000";
  1805. // In all, the character property tables require 11616 bytes.
  1806. static {
  1807. { // THIS CODE WAS AUTOMATICALLY CREATED BY GenerateCharacter:
  1808. int len = X_DATA.length();
  1809. int j=0;
  1810. for (int i=0; i<len; ++i) {
  1811. int c = X_DATA.charAt(i);
  1812. for (int k=0; k<2; ++k) {
  1813. X[j++] = (byte)c;
  1814. c >>= 8;
  1815. }
  1816. }
  1817. if (j != 1024) throw new RuntimeException();
  1818. }
  1819. { // THIS CODE WAS AUTOMATICALLY CREATED BY GenerateCharacter:
  1820. if (Y_DATA.length() != 4032) throw new RuntimeException();
  1821. for (int i=0; i<4032; ++i)
  1822. Y[i] = (short)Y_DATA.charAt(i);
  1823. }
  1824. { // THIS CODE WAS AUTOMATICALLY CREATED BY GenerateCharacter:
  1825. int len = A_DATA.length();
  1826. int j=0;
  1827. int charsInEntry=0;
  1828. int entry=0;
  1829. for (int i=0; i<len; ++i) {
  1830. entry |= A_DATA.charAt(i);
  1831. if (++charsInEntry == 2) {
  1832. A[j++] = entry;
  1833. entry = 0;
  1834. charsInEntry = 0;
  1835. }
  1836. else {
  1837. entry <<= 16;
  1838. }
  1839. }
  1840. if (j != 632) throw new RuntimeException();
  1841. }
  1842. }
  1843. }