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