jaroslav@68: /* jaroslav@68: * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. jaroslav@68: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. jaroslav@68: * jaroslav@68: * This code is free software; you can redistribute it and/or modify it jaroslav@68: * under the terms of the GNU General Public License version 2 only, as jaroslav@68: * published by the Free Software Foundation. Oracle designates this jaroslav@68: * particular file as subject to the "Classpath" exception as provided jaroslav@68: * by Oracle in the LICENSE file that accompanied this code. jaroslav@68: * jaroslav@68: * This code is distributed in the hope that it will be useful, but WITHOUT jaroslav@68: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or jaroslav@68: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License jaroslav@68: * version 2 for more details (a copy is included in the LICENSE file that jaroslav@68: * accompanied this code). jaroslav@68: * jaroslav@68: * You should have received a copy of the GNU General Public License version jaroslav@68: * 2 along with this work; if not, write to the Free Software Foundation, jaroslav@68: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. jaroslav@68: * jaroslav@68: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA jaroslav@68: * or visit www.oracle.com if you need additional information or have any jaroslav@68: * questions. jaroslav@68: */ jaroslav@68: jaroslav@68: package java.lang; jaroslav@68: jaroslav@68: import java.util.Arrays; jaroslav@68: import java.util.Map; jaroslav@68: import java.util.HashMap; jaroslav@68: import java.util.Locale; jaroslav@68: jaroslav@68: /** jaroslav@68: * The {@code Character} class wraps a value of the primitive jaroslav@68: * type {@code char} in an object. An object of type jaroslav@68: * {@code Character} contains a single field whose type is jaroslav@68: * {@code char}. jaroslav@68: *
jaroslav@68: * In addition, this class provides several methods for determining jaroslav@68: * a character's category (lowercase letter, digit, etc.) and for converting jaroslav@68: * characters from uppercase to lowercase and vice versa. jaroslav@68: *
jaroslav@68: * Character information is based on the Unicode Standard, version 6.0.0. jaroslav@68: *
jaroslav@68: * The methods and data of class {@code Character} are defined by jaroslav@68: * the information in the UnicodeData file that is part of the jaroslav@68: * Unicode Character Database maintained by the Unicode jaroslav@68: * Consortium. This file specifies various properties including name jaroslav@68: * and general category for every defined Unicode code point or jaroslav@68: * character range. jaroslav@68: *
jaroslav@68: * The file and its description are available from the Unicode Consortium at: jaroslav@68: *
The {@code char} data type (and therefore the value that a jaroslav@68: * {@code Character} object encapsulates) are based on the jaroslav@68: * original Unicode specification, which defined characters as jaroslav@68: * fixed-width 16-bit entities. The Unicode Standard has since been jaroslav@68: * changed to allow for characters whose representation requires more jaroslav@68: * than 16 bits. The range of legal code points is now jaroslav@68: * U+0000 to U+10FFFF, known as Unicode scalar value. jaroslav@68: * (Refer to the jaroslav@68: * definition of the U+n notation in the Unicode jaroslav@68: * Standard.) jaroslav@68: * jaroslav@68: *
The set of characters from U+0000 to U+FFFF is jaroslav@68: * sometimes referred to as the Basic Multilingual Plane (BMP). jaroslav@68: * Characters whose code points are greater jaroslav@68: * than U+FFFF are called supplementary characters. The Java jaroslav@68: * platform uses the UTF-16 representation in {@code char} arrays and jaroslav@68: * in the {@code String} and {@code StringBuffer} classes. In jaroslav@68: * this representation, supplementary characters are represented as a pair jaroslav@68: * of {@code char} values, the first from the high-surrogates jaroslav@68: * range, (\uD800-\uDBFF), the second from the jaroslav@68: * low-surrogates range (\uDC00-\uDFFF). jaroslav@68: * jaroslav@68: *
A {@code char} value, therefore, represents Basic jaroslav@68: * Multilingual Plane (BMP) code points, including the surrogate jaroslav@68: * code points, or code units of the UTF-16 encoding. An jaroslav@68: * {@code int} value represents all Unicode code points, jaroslav@68: * including supplementary code points. The lower (least significant) jaroslav@68: * 21 bits of {@code int} are used to represent Unicode code jaroslav@68: * points and the upper (most significant) 11 bits must be zero. jaroslav@68: * Unless otherwise specified, the behavior with respect to jaroslav@68: * supplementary characters and surrogate {@code char} values is jaroslav@68: * as follows: jaroslav@68: * jaroslav@68: *
In the Java SE API documentation, Unicode code point is
jaroslav@68: * used for character values in the range between U+0000 and U+10FFFF,
jaroslav@68: * and Unicode code unit is used for 16-bit
jaroslav@68: * {@code char} values that are code units of the UTF-16
jaroslav@68: * encoding. For more information on Unicode terminology, refer to the
jaroslav@68: * Unicode Glossary.
jaroslav@68: *
jaroslav@68: * @author Lee Boynton
jaroslav@68: * @author Guy Steele
jaroslav@68: * @author Akira Tanaka
jaroslav@68: * @author Martin Buchholz
jaroslav@68: * @author Ulf Zibis
jaroslav@68: * @since 1.0
jaroslav@68: */
jaroslav@68: public final
jaroslav@68: class Character implements java.io.Serializable, Comparable
jaroslav@68: * This block was previously known as the "Greek" block.
jaroslav@68: *
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock GREEK =
jaroslav@68: new UnicodeBlock("GREEK",
jaroslav@68: "GREEK AND COPTIC",
jaroslav@68: "GREEKANDCOPTIC");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Cyrillic" Unicode character block.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock CYRILLIC =
jaroslav@68: new UnicodeBlock("CYRILLIC");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Armenian" Unicode character block.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock ARMENIAN =
jaroslav@68: new UnicodeBlock("ARMENIAN");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Hebrew" Unicode character block.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock HEBREW =
jaroslav@68: new UnicodeBlock("HEBREW");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Arabic" Unicode character block.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock ARABIC =
jaroslav@68: new UnicodeBlock("ARABIC");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Devanagari" Unicode character block.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock DEVANAGARI =
jaroslav@68: new UnicodeBlock("DEVANAGARI");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Bengali" Unicode character block.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock BENGALI =
jaroslav@68: new UnicodeBlock("BENGALI");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Gurmukhi" Unicode character block.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock GURMUKHI =
jaroslav@68: new UnicodeBlock("GURMUKHI");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Gujarati" Unicode character block.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock GUJARATI =
jaroslav@68: new UnicodeBlock("GUJARATI");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Oriya" Unicode character block.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock ORIYA =
jaroslav@68: new UnicodeBlock("ORIYA");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Tamil" Unicode character block.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock TAMIL =
jaroslav@68: new UnicodeBlock("TAMIL");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Telugu" Unicode character block.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock TELUGU =
jaroslav@68: new UnicodeBlock("TELUGU");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Kannada" Unicode character block.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock KANNADA =
jaroslav@68: new UnicodeBlock("KANNADA");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Malayalam" Unicode character block.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock MALAYALAM =
jaroslav@68: new UnicodeBlock("MALAYALAM");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Thai" Unicode character block.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock THAI =
jaroslav@68: new UnicodeBlock("THAI");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Lao" Unicode character block.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock LAO =
jaroslav@68: new UnicodeBlock("LAO");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Tibetan" Unicode character block.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock TIBETAN =
jaroslav@68: new UnicodeBlock("TIBETAN");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Georgian" Unicode character block.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock GEORGIAN =
jaroslav@68: new UnicodeBlock("GEORGIAN");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Hangul Jamo" Unicode character block.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock HANGUL_JAMO =
jaroslav@68: new UnicodeBlock("HANGUL_JAMO",
jaroslav@68: "HANGUL JAMO",
jaroslav@68: "HANGULJAMO");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Latin Extended Additional" Unicode character block.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock LATIN_EXTENDED_ADDITIONAL =
jaroslav@68: new UnicodeBlock("LATIN_EXTENDED_ADDITIONAL",
jaroslav@68: "LATIN EXTENDED ADDITIONAL",
jaroslav@68: "LATINEXTENDEDADDITIONAL");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Greek Extended" Unicode character block.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock GREEK_EXTENDED =
jaroslav@68: new UnicodeBlock("GREEK_EXTENDED",
jaroslav@68: "GREEK EXTENDED",
jaroslav@68: "GREEKEXTENDED");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "General Punctuation" Unicode character block.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock GENERAL_PUNCTUATION =
jaroslav@68: new UnicodeBlock("GENERAL_PUNCTUATION",
jaroslav@68: "GENERAL PUNCTUATION",
jaroslav@68: "GENERALPUNCTUATION");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Superscripts and Subscripts" Unicode character
jaroslav@68: * block.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock SUPERSCRIPTS_AND_SUBSCRIPTS =
jaroslav@68: new UnicodeBlock("SUPERSCRIPTS_AND_SUBSCRIPTS",
jaroslav@68: "SUPERSCRIPTS AND SUBSCRIPTS",
jaroslav@68: "SUPERSCRIPTSANDSUBSCRIPTS");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Currency Symbols" Unicode character block.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock CURRENCY_SYMBOLS =
jaroslav@68: new UnicodeBlock("CURRENCY_SYMBOLS",
jaroslav@68: "CURRENCY SYMBOLS",
jaroslav@68: "CURRENCYSYMBOLS");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Combining Diacritical Marks for Symbols" Unicode
jaroslav@68: * character block.
jaroslav@68: *
jaroslav@68: * This block was previously known as "Combining Marks for Symbols".
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock COMBINING_MARKS_FOR_SYMBOLS =
jaroslav@68: new UnicodeBlock("COMBINING_MARKS_FOR_SYMBOLS",
jaroslav@68: "COMBINING DIACRITICAL MARKS FOR SYMBOLS",
jaroslav@68: "COMBININGDIACRITICALMARKSFORSYMBOLS",
jaroslav@68: "COMBINING MARKS FOR SYMBOLS",
jaroslav@68: "COMBININGMARKSFORSYMBOLS");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Letterlike Symbols" Unicode character block.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock LETTERLIKE_SYMBOLS =
jaroslav@68: new UnicodeBlock("LETTERLIKE_SYMBOLS",
jaroslav@68: "LETTERLIKE SYMBOLS",
jaroslav@68: "LETTERLIKESYMBOLS");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Number Forms" Unicode character block.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock NUMBER_FORMS =
jaroslav@68: new UnicodeBlock("NUMBER_FORMS",
jaroslav@68: "NUMBER FORMS",
jaroslav@68: "NUMBERFORMS");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Arrows" Unicode character block.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock ARROWS =
jaroslav@68: new UnicodeBlock("ARROWS");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Mathematical Operators" Unicode character block.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock MATHEMATICAL_OPERATORS =
jaroslav@68: new UnicodeBlock("MATHEMATICAL_OPERATORS",
jaroslav@68: "MATHEMATICAL OPERATORS",
jaroslav@68: "MATHEMATICALOPERATORS");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Miscellaneous Technical" Unicode character block.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock MISCELLANEOUS_TECHNICAL =
jaroslav@68: new UnicodeBlock("MISCELLANEOUS_TECHNICAL",
jaroslav@68: "MISCELLANEOUS TECHNICAL",
jaroslav@68: "MISCELLANEOUSTECHNICAL");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Control Pictures" Unicode character block.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock CONTROL_PICTURES =
jaroslav@68: new UnicodeBlock("CONTROL_PICTURES",
jaroslav@68: "CONTROL PICTURES",
jaroslav@68: "CONTROLPICTURES");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Optical Character Recognition" Unicode character block.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock OPTICAL_CHARACTER_RECOGNITION =
jaroslav@68: new UnicodeBlock("OPTICAL_CHARACTER_RECOGNITION",
jaroslav@68: "OPTICAL CHARACTER RECOGNITION",
jaroslav@68: "OPTICALCHARACTERRECOGNITION");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Enclosed Alphanumerics" Unicode character block.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock ENCLOSED_ALPHANUMERICS =
jaroslav@68: new UnicodeBlock("ENCLOSED_ALPHANUMERICS",
jaroslav@68: "ENCLOSED ALPHANUMERICS",
jaroslav@68: "ENCLOSEDALPHANUMERICS");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Box Drawing" Unicode character block.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock BOX_DRAWING =
jaroslav@68: new UnicodeBlock("BOX_DRAWING",
jaroslav@68: "BOX DRAWING",
jaroslav@68: "BOXDRAWING");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Block Elements" Unicode character block.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock BLOCK_ELEMENTS =
jaroslav@68: new UnicodeBlock("BLOCK_ELEMENTS",
jaroslav@68: "BLOCK ELEMENTS",
jaroslav@68: "BLOCKELEMENTS");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Geometric Shapes" Unicode character block.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock GEOMETRIC_SHAPES =
jaroslav@68: new UnicodeBlock("GEOMETRIC_SHAPES",
jaroslav@68: "GEOMETRIC SHAPES",
jaroslav@68: "GEOMETRICSHAPES");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Miscellaneous Symbols" Unicode character block.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock MISCELLANEOUS_SYMBOLS =
jaroslav@68: new UnicodeBlock("MISCELLANEOUS_SYMBOLS",
jaroslav@68: "MISCELLANEOUS SYMBOLS",
jaroslav@68: "MISCELLANEOUSSYMBOLS");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Dingbats" Unicode character block.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock DINGBATS =
jaroslav@68: new UnicodeBlock("DINGBATS");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "CJK Symbols and Punctuation" Unicode character block.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock CJK_SYMBOLS_AND_PUNCTUATION =
jaroslav@68: new UnicodeBlock("CJK_SYMBOLS_AND_PUNCTUATION",
jaroslav@68: "CJK SYMBOLS AND PUNCTUATION",
jaroslav@68: "CJKSYMBOLSANDPUNCTUATION");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Hiragana" Unicode character block.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock HIRAGANA =
jaroslav@68: new UnicodeBlock("HIRAGANA");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Katakana" Unicode character block.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock KATAKANA =
jaroslav@68: new UnicodeBlock("KATAKANA");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Bopomofo" Unicode character block.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock BOPOMOFO =
jaroslav@68: new UnicodeBlock("BOPOMOFO");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Hangul Compatibility Jamo" Unicode character block.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock HANGUL_COMPATIBILITY_JAMO =
jaroslav@68: new UnicodeBlock("HANGUL_COMPATIBILITY_JAMO",
jaroslav@68: "HANGUL COMPATIBILITY JAMO",
jaroslav@68: "HANGULCOMPATIBILITYJAMO");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Kanbun" Unicode character block.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock KANBUN =
jaroslav@68: new UnicodeBlock("KANBUN");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Enclosed CJK Letters and Months" Unicode character block.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock ENCLOSED_CJK_LETTERS_AND_MONTHS =
jaroslav@68: new UnicodeBlock("ENCLOSED_CJK_LETTERS_AND_MONTHS",
jaroslav@68: "ENCLOSED CJK LETTERS AND MONTHS",
jaroslav@68: "ENCLOSEDCJKLETTERSANDMONTHS");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "CJK Compatibility" Unicode character block.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock CJK_COMPATIBILITY =
jaroslav@68: new UnicodeBlock("CJK_COMPATIBILITY",
jaroslav@68: "CJK COMPATIBILITY",
jaroslav@68: "CJKCOMPATIBILITY");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "CJK Unified Ideographs" Unicode character block.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock CJK_UNIFIED_IDEOGRAPHS =
jaroslav@68: new UnicodeBlock("CJK_UNIFIED_IDEOGRAPHS",
jaroslav@68: "CJK UNIFIED IDEOGRAPHS",
jaroslav@68: "CJKUNIFIEDIDEOGRAPHS");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Hangul Syllables" Unicode character block.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock HANGUL_SYLLABLES =
jaroslav@68: new UnicodeBlock("HANGUL_SYLLABLES",
jaroslav@68: "HANGUL SYLLABLES",
jaroslav@68: "HANGULSYLLABLES");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Private Use Area" Unicode character block.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock PRIVATE_USE_AREA =
jaroslav@68: new UnicodeBlock("PRIVATE_USE_AREA",
jaroslav@68: "PRIVATE USE AREA",
jaroslav@68: "PRIVATEUSEAREA");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "CJK Compatibility Ideographs" Unicode character
jaroslav@68: * block.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock CJK_COMPATIBILITY_IDEOGRAPHS =
jaroslav@68: new UnicodeBlock("CJK_COMPATIBILITY_IDEOGRAPHS",
jaroslav@68: "CJK COMPATIBILITY IDEOGRAPHS",
jaroslav@68: "CJKCOMPATIBILITYIDEOGRAPHS");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Alphabetic Presentation Forms" Unicode character block.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock ALPHABETIC_PRESENTATION_FORMS =
jaroslav@68: new UnicodeBlock("ALPHABETIC_PRESENTATION_FORMS",
jaroslav@68: "ALPHABETIC PRESENTATION FORMS",
jaroslav@68: "ALPHABETICPRESENTATIONFORMS");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Arabic Presentation Forms-A" Unicode character
jaroslav@68: * block.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock ARABIC_PRESENTATION_FORMS_A =
jaroslav@68: new UnicodeBlock("ARABIC_PRESENTATION_FORMS_A",
jaroslav@68: "ARABIC PRESENTATION FORMS-A",
jaroslav@68: "ARABICPRESENTATIONFORMS-A");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Combining Half Marks" Unicode character block.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock COMBINING_HALF_MARKS =
jaroslav@68: new UnicodeBlock("COMBINING_HALF_MARKS",
jaroslav@68: "COMBINING HALF MARKS",
jaroslav@68: "COMBININGHALFMARKS");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "CJK Compatibility Forms" Unicode character block.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock CJK_COMPATIBILITY_FORMS =
jaroslav@68: new UnicodeBlock("CJK_COMPATIBILITY_FORMS",
jaroslav@68: "CJK COMPATIBILITY FORMS",
jaroslav@68: "CJKCOMPATIBILITYFORMS");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Small Form Variants" Unicode character block.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock SMALL_FORM_VARIANTS =
jaroslav@68: new UnicodeBlock("SMALL_FORM_VARIANTS",
jaroslav@68: "SMALL FORM VARIANTS",
jaroslav@68: "SMALLFORMVARIANTS");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Arabic Presentation Forms-B" Unicode character block.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock ARABIC_PRESENTATION_FORMS_B =
jaroslav@68: new UnicodeBlock("ARABIC_PRESENTATION_FORMS_B",
jaroslav@68: "ARABIC PRESENTATION FORMS-B",
jaroslav@68: "ARABICPRESENTATIONFORMS-B");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Halfwidth and Fullwidth Forms" Unicode character
jaroslav@68: * block.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock HALFWIDTH_AND_FULLWIDTH_FORMS =
jaroslav@68: new UnicodeBlock("HALFWIDTH_AND_FULLWIDTH_FORMS",
jaroslav@68: "HALFWIDTH AND FULLWIDTH FORMS",
jaroslav@68: "HALFWIDTHANDFULLWIDTHFORMS");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Specials" Unicode character block.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock SPECIALS =
jaroslav@68: new UnicodeBlock("SPECIALS");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * @deprecated As of J2SE 5, use {@link #HIGH_SURROGATES},
jaroslav@68: * {@link #HIGH_PRIVATE_USE_SURROGATES}, and
jaroslav@68: * {@link #LOW_SURROGATES}. These new constants match
jaroslav@68: * the block definitions of the Unicode Standard.
jaroslav@68: * The {@link #of(char)} and {@link #of(int)} methods
jaroslav@68: * return the new constants, not SURROGATES_AREA.
jaroslav@68: */
jaroslav@68: @Deprecated
jaroslav@68: public static final UnicodeBlock SURROGATES_AREA =
jaroslav@68: new UnicodeBlock("SURROGATES_AREA");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Syriac" Unicode character block.
jaroslav@68: * @since 1.4
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock SYRIAC =
jaroslav@68: new UnicodeBlock("SYRIAC");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Thaana" Unicode character block.
jaroslav@68: * @since 1.4
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock THAANA =
jaroslav@68: new UnicodeBlock("THAANA");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Sinhala" Unicode character block.
jaroslav@68: * @since 1.4
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock SINHALA =
jaroslav@68: new UnicodeBlock("SINHALA");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Myanmar" Unicode character block.
jaroslav@68: * @since 1.4
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock MYANMAR =
jaroslav@68: new UnicodeBlock("MYANMAR");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Ethiopic" Unicode character block.
jaroslav@68: * @since 1.4
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock ETHIOPIC =
jaroslav@68: new UnicodeBlock("ETHIOPIC");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Cherokee" Unicode character block.
jaroslav@68: * @since 1.4
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock CHEROKEE =
jaroslav@68: new UnicodeBlock("CHEROKEE");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Unified Canadian Aboriginal Syllabics" Unicode character block.
jaroslav@68: * @since 1.4
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS =
jaroslav@68: new UnicodeBlock("UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS",
jaroslav@68: "UNIFIED CANADIAN ABORIGINAL SYLLABICS",
jaroslav@68: "UNIFIEDCANADIANABORIGINALSYLLABICS");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Ogham" Unicode character block.
jaroslav@68: * @since 1.4
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock OGHAM =
jaroslav@68: new UnicodeBlock("OGHAM");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Runic" Unicode character block.
jaroslav@68: * @since 1.4
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock RUNIC =
jaroslav@68: new UnicodeBlock("RUNIC");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Khmer" Unicode character block.
jaroslav@68: * @since 1.4
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock KHMER =
jaroslav@68: new UnicodeBlock("KHMER");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Mongolian" Unicode character block.
jaroslav@68: * @since 1.4
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock MONGOLIAN =
jaroslav@68: new UnicodeBlock("MONGOLIAN");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Braille Patterns" Unicode character block.
jaroslav@68: * @since 1.4
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock BRAILLE_PATTERNS =
jaroslav@68: new UnicodeBlock("BRAILLE_PATTERNS",
jaroslav@68: "BRAILLE PATTERNS",
jaroslav@68: "BRAILLEPATTERNS");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "CJK Radicals Supplement" Unicode character block.
jaroslav@68: * @since 1.4
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock CJK_RADICALS_SUPPLEMENT =
jaroslav@68: new UnicodeBlock("CJK_RADICALS_SUPPLEMENT",
jaroslav@68: "CJK RADICALS SUPPLEMENT",
jaroslav@68: "CJKRADICALSSUPPLEMENT");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Kangxi Radicals" Unicode character block.
jaroslav@68: * @since 1.4
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock KANGXI_RADICALS =
jaroslav@68: new UnicodeBlock("KANGXI_RADICALS",
jaroslav@68: "KANGXI RADICALS",
jaroslav@68: "KANGXIRADICALS");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Ideographic Description Characters" Unicode character block.
jaroslav@68: * @since 1.4
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock IDEOGRAPHIC_DESCRIPTION_CHARACTERS =
jaroslav@68: new UnicodeBlock("IDEOGRAPHIC_DESCRIPTION_CHARACTERS",
jaroslav@68: "IDEOGRAPHIC DESCRIPTION CHARACTERS",
jaroslav@68: "IDEOGRAPHICDESCRIPTIONCHARACTERS");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Bopomofo Extended" Unicode character block.
jaroslav@68: * @since 1.4
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock BOPOMOFO_EXTENDED =
jaroslav@68: new UnicodeBlock("BOPOMOFO_EXTENDED",
jaroslav@68: "BOPOMOFO EXTENDED",
jaroslav@68: "BOPOMOFOEXTENDED");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "CJK Unified Ideographs Extension A" Unicode character block.
jaroslav@68: * @since 1.4
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A =
jaroslav@68: new UnicodeBlock("CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A",
jaroslav@68: "CJK UNIFIED IDEOGRAPHS EXTENSION A",
jaroslav@68: "CJKUNIFIEDIDEOGRAPHSEXTENSIONA");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Yi Syllables" Unicode character block.
jaroslav@68: * @since 1.4
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock YI_SYLLABLES =
jaroslav@68: new UnicodeBlock("YI_SYLLABLES",
jaroslav@68: "YI SYLLABLES",
jaroslav@68: "YISYLLABLES");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Yi Radicals" Unicode character block.
jaroslav@68: * @since 1.4
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock YI_RADICALS =
jaroslav@68: new UnicodeBlock("YI_RADICALS",
jaroslav@68: "YI RADICALS",
jaroslav@68: "YIRADICALS");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Cyrillic Supplementary" Unicode character block.
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock CYRILLIC_SUPPLEMENTARY =
jaroslav@68: new UnicodeBlock("CYRILLIC_SUPPLEMENTARY",
jaroslav@68: "CYRILLIC SUPPLEMENTARY",
jaroslav@68: "CYRILLICSUPPLEMENTARY",
jaroslav@68: "CYRILLIC SUPPLEMENT",
jaroslav@68: "CYRILLICSUPPLEMENT");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Tagalog" Unicode character block.
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock TAGALOG =
jaroslav@68: new UnicodeBlock("TAGALOG");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Hanunoo" Unicode character block.
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock HANUNOO =
jaroslav@68: new UnicodeBlock("HANUNOO");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Buhid" Unicode character block.
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock BUHID =
jaroslav@68: new UnicodeBlock("BUHID");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Tagbanwa" Unicode character block.
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock TAGBANWA =
jaroslav@68: new UnicodeBlock("TAGBANWA");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Limbu" Unicode character block.
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock LIMBU =
jaroslav@68: new UnicodeBlock("LIMBU");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Tai Le" Unicode character block.
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock TAI_LE =
jaroslav@68: new UnicodeBlock("TAI_LE",
jaroslav@68: "TAI LE",
jaroslav@68: "TAILE");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Khmer Symbols" Unicode character block.
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock KHMER_SYMBOLS =
jaroslav@68: new UnicodeBlock("KHMER_SYMBOLS",
jaroslav@68: "KHMER SYMBOLS",
jaroslav@68: "KHMERSYMBOLS");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Phonetic Extensions" Unicode character block.
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock PHONETIC_EXTENSIONS =
jaroslav@68: new UnicodeBlock("PHONETIC_EXTENSIONS",
jaroslav@68: "PHONETIC EXTENSIONS",
jaroslav@68: "PHONETICEXTENSIONS");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Miscellaneous Mathematical Symbols-A" Unicode character block.
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A =
jaroslav@68: new UnicodeBlock("MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A",
jaroslav@68: "MISCELLANEOUS MATHEMATICAL SYMBOLS-A",
jaroslav@68: "MISCELLANEOUSMATHEMATICALSYMBOLS-A");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Supplemental Arrows-A" Unicode character block.
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock SUPPLEMENTAL_ARROWS_A =
jaroslav@68: new UnicodeBlock("SUPPLEMENTAL_ARROWS_A",
jaroslav@68: "SUPPLEMENTAL ARROWS-A",
jaroslav@68: "SUPPLEMENTALARROWS-A");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Supplemental Arrows-B" Unicode character block.
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock SUPPLEMENTAL_ARROWS_B =
jaroslav@68: new UnicodeBlock("SUPPLEMENTAL_ARROWS_B",
jaroslav@68: "SUPPLEMENTAL ARROWS-B",
jaroslav@68: "SUPPLEMENTALARROWS-B");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Miscellaneous Mathematical Symbols-B" Unicode
jaroslav@68: * character block.
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B =
jaroslav@68: new UnicodeBlock("MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B",
jaroslav@68: "MISCELLANEOUS MATHEMATICAL SYMBOLS-B",
jaroslav@68: "MISCELLANEOUSMATHEMATICALSYMBOLS-B");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Supplemental Mathematical Operators" Unicode
jaroslav@68: * character block.
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock SUPPLEMENTAL_MATHEMATICAL_OPERATORS =
jaroslav@68: new UnicodeBlock("SUPPLEMENTAL_MATHEMATICAL_OPERATORS",
jaroslav@68: "SUPPLEMENTAL MATHEMATICAL OPERATORS",
jaroslav@68: "SUPPLEMENTALMATHEMATICALOPERATORS");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Miscellaneous Symbols and Arrows" Unicode character
jaroslav@68: * block.
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock MISCELLANEOUS_SYMBOLS_AND_ARROWS =
jaroslav@68: new UnicodeBlock("MISCELLANEOUS_SYMBOLS_AND_ARROWS",
jaroslav@68: "MISCELLANEOUS SYMBOLS AND ARROWS",
jaroslav@68: "MISCELLANEOUSSYMBOLSANDARROWS");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Katakana Phonetic Extensions" Unicode character
jaroslav@68: * block.
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock KATAKANA_PHONETIC_EXTENSIONS =
jaroslav@68: new UnicodeBlock("KATAKANA_PHONETIC_EXTENSIONS",
jaroslav@68: "KATAKANA PHONETIC EXTENSIONS",
jaroslav@68: "KATAKANAPHONETICEXTENSIONS");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Yijing Hexagram Symbols" Unicode character block.
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock YIJING_HEXAGRAM_SYMBOLS =
jaroslav@68: new UnicodeBlock("YIJING_HEXAGRAM_SYMBOLS",
jaroslav@68: "YIJING HEXAGRAM SYMBOLS",
jaroslav@68: "YIJINGHEXAGRAMSYMBOLS");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Variation Selectors" Unicode character block.
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock VARIATION_SELECTORS =
jaroslav@68: new UnicodeBlock("VARIATION_SELECTORS",
jaroslav@68: "VARIATION SELECTORS",
jaroslav@68: "VARIATIONSELECTORS");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Linear B Syllabary" Unicode character block.
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock LINEAR_B_SYLLABARY =
jaroslav@68: new UnicodeBlock("LINEAR_B_SYLLABARY",
jaroslav@68: "LINEAR B SYLLABARY",
jaroslav@68: "LINEARBSYLLABARY");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Linear B Ideograms" Unicode character block.
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock LINEAR_B_IDEOGRAMS =
jaroslav@68: new UnicodeBlock("LINEAR_B_IDEOGRAMS",
jaroslav@68: "LINEAR B IDEOGRAMS",
jaroslav@68: "LINEARBIDEOGRAMS");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Aegean Numbers" Unicode character block.
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock AEGEAN_NUMBERS =
jaroslav@68: new UnicodeBlock("AEGEAN_NUMBERS",
jaroslav@68: "AEGEAN NUMBERS",
jaroslav@68: "AEGEANNUMBERS");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Old Italic" Unicode character block.
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock OLD_ITALIC =
jaroslav@68: new UnicodeBlock("OLD_ITALIC",
jaroslav@68: "OLD ITALIC",
jaroslav@68: "OLDITALIC");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Gothic" Unicode character block.
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock GOTHIC =
jaroslav@68: new UnicodeBlock("GOTHIC");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Ugaritic" Unicode character block.
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock UGARITIC =
jaroslav@68: new UnicodeBlock("UGARITIC");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Deseret" Unicode character block.
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock DESERET =
jaroslav@68: new UnicodeBlock("DESERET");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Shavian" Unicode character block.
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock SHAVIAN =
jaroslav@68: new UnicodeBlock("SHAVIAN");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Osmanya" Unicode character block.
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock OSMANYA =
jaroslav@68: new UnicodeBlock("OSMANYA");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Cypriot Syllabary" Unicode character block.
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock CYPRIOT_SYLLABARY =
jaroslav@68: new UnicodeBlock("CYPRIOT_SYLLABARY",
jaroslav@68: "CYPRIOT SYLLABARY",
jaroslav@68: "CYPRIOTSYLLABARY");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Byzantine Musical Symbols" Unicode character block.
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock BYZANTINE_MUSICAL_SYMBOLS =
jaroslav@68: new UnicodeBlock("BYZANTINE_MUSICAL_SYMBOLS",
jaroslav@68: "BYZANTINE MUSICAL SYMBOLS",
jaroslav@68: "BYZANTINEMUSICALSYMBOLS");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Musical Symbols" Unicode character block.
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock MUSICAL_SYMBOLS =
jaroslav@68: new UnicodeBlock("MUSICAL_SYMBOLS",
jaroslav@68: "MUSICAL SYMBOLS",
jaroslav@68: "MUSICALSYMBOLS");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Tai Xuan Jing Symbols" Unicode character block.
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock TAI_XUAN_JING_SYMBOLS =
jaroslav@68: new UnicodeBlock("TAI_XUAN_JING_SYMBOLS",
jaroslav@68: "TAI XUAN JING SYMBOLS",
jaroslav@68: "TAIXUANJINGSYMBOLS");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Mathematical Alphanumeric Symbols" Unicode
jaroslav@68: * character block.
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock MATHEMATICAL_ALPHANUMERIC_SYMBOLS =
jaroslav@68: new UnicodeBlock("MATHEMATICAL_ALPHANUMERIC_SYMBOLS",
jaroslav@68: "MATHEMATICAL ALPHANUMERIC SYMBOLS",
jaroslav@68: "MATHEMATICALALPHANUMERICSYMBOLS");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "CJK Unified Ideographs Extension B" Unicode
jaroslav@68: * character block.
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B =
jaroslav@68: new UnicodeBlock("CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B",
jaroslav@68: "CJK UNIFIED IDEOGRAPHS EXTENSION B",
jaroslav@68: "CJKUNIFIEDIDEOGRAPHSEXTENSIONB");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "CJK Compatibility Ideographs Supplement" Unicode character block.
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT =
jaroslav@68: new UnicodeBlock("CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT",
jaroslav@68: "CJK COMPATIBILITY IDEOGRAPHS SUPPLEMENT",
jaroslav@68: "CJKCOMPATIBILITYIDEOGRAPHSSUPPLEMENT");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Tags" Unicode character block.
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock TAGS =
jaroslav@68: new UnicodeBlock("TAGS");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Variation Selectors Supplement" Unicode character
jaroslav@68: * block.
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock VARIATION_SELECTORS_SUPPLEMENT =
jaroslav@68: new UnicodeBlock("VARIATION_SELECTORS_SUPPLEMENT",
jaroslav@68: "VARIATION SELECTORS SUPPLEMENT",
jaroslav@68: "VARIATIONSELECTORSSUPPLEMENT");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Supplementary Private Use Area-A" Unicode character
jaroslav@68: * block.
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock SUPPLEMENTARY_PRIVATE_USE_AREA_A =
jaroslav@68: new UnicodeBlock("SUPPLEMENTARY_PRIVATE_USE_AREA_A",
jaroslav@68: "SUPPLEMENTARY PRIVATE USE AREA-A",
jaroslav@68: "SUPPLEMENTARYPRIVATEUSEAREA-A");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Supplementary Private Use Area-B" Unicode character
jaroslav@68: * block.
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock SUPPLEMENTARY_PRIVATE_USE_AREA_B =
jaroslav@68: new UnicodeBlock("SUPPLEMENTARY_PRIVATE_USE_AREA_B",
jaroslav@68: "SUPPLEMENTARY PRIVATE USE AREA-B",
jaroslav@68: "SUPPLEMENTARYPRIVATEUSEAREA-B");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "High Surrogates" Unicode character block.
jaroslav@68: * This block represents codepoint values in the high surrogate
jaroslav@68: * range: U+D800 through U+DB7F
jaroslav@68: *
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock HIGH_SURROGATES =
jaroslav@68: new UnicodeBlock("HIGH_SURROGATES",
jaroslav@68: "HIGH SURROGATES",
jaroslav@68: "HIGHSURROGATES");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "High Private Use Surrogates" Unicode character
jaroslav@68: * block.
jaroslav@68: * This block represents codepoint values in the private use high
jaroslav@68: * surrogate range: U+DB80 through U+DBFF
jaroslav@68: *
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock HIGH_PRIVATE_USE_SURROGATES =
jaroslav@68: new UnicodeBlock("HIGH_PRIVATE_USE_SURROGATES",
jaroslav@68: "HIGH PRIVATE USE SURROGATES",
jaroslav@68: "HIGHPRIVATEUSESURROGATES");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Low Surrogates" Unicode character block.
jaroslav@68: * This block represents codepoint values in the low surrogate
jaroslav@68: * range: U+DC00 through U+DFFF
jaroslav@68: *
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock LOW_SURROGATES =
jaroslav@68: new UnicodeBlock("LOW_SURROGATES",
jaroslav@68: "LOW SURROGATES",
jaroslav@68: "LOWSURROGATES");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Arabic Supplement" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock ARABIC_SUPPLEMENT =
jaroslav@68: new UnicodeBlock("ARABIC_SUPPLEMENT",
jaroslav@68: "ARABIC SUPPLEMENT",
jaroslav@68: "ARABICSUPPLEMENT");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "NKo" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock NKO =
jaroslav@68: new UnicodeBlock("NKO");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Samaritan" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock SAMARITAN =
jaroslav@68: new UnicodeBlock("SAMARITAN");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Mandaic" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock MANDAIC =
jaroslav@68: new UnicodeBlock("MANDAIC");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Ethiopic Supplement" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock ETHIOPIC_SUPPLEMENT =
jaroslav@68: new UnicodeBlock("ETHIOPIC_SUPPLEMENT",
jaroslav@68: "ETHIOPIC SUPPLEMENT",
jaroslav@68: "ETHIOPICSUPPLEMENT");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Unified Canadian Aboriginal Syllabics Extended"
jaroslav@68: * Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS_EXTENDED =
jaroslav@68: new UnicodeBlock("UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS_EXTENDED",
jaroslav@68: "UNIFIED CANADIAN ABORIGINAL SYLLABICS EXTENDED",
jaroslav@68: "UNIFIEDCANADIANABORIGINALSYLLABICSEXTENDED");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "New Tai Lue" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock NEW_TAI_LUE =
jaroslav@68: new UnicodeBlock("NEW_TAI_LUE",
jaroslav@68: "NEW TAI LUE",
jaroslav@68: "NEWTAILUE");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Buginese" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock BUGINESE =
jaroslav@68: new UnicodeBlock("BUGINESE");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Tai Tham" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock TAI_THAM =
jaroslav@68: new UnicodeBlock("TAI_THAM",
jaroslav@68: "TAI THAM",
jaroslav@68: "TAITHAM");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Balinese" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock BALINESE =
jaroslav@68: new UnicodeBlock("BALINESE");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Sundanese" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock SUNDANESE =
jaroslav@68: new UnicodeBlock("SUNDANESE");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Batak" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock BATAK =
jaroslav@68: new UnicodeBlock("BATAK");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Lepcha" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock LEPCHA =
jaroslav@68: new UnicodeBlock("LEPCHA");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Ol Chiki" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock OL_CHIKI =
jaroslav@68: new UnicodeBlock("OL_CHIKI",
jaroslav@68: "OL CHIKI",
jaroslav@68: "OLCHIKI");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Vedic Extensions" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock VEDIC_EXTENSIONS =
jaroslav@68: new UnicodeBlock("VEDIC_EXTENSIONS",
jaroslav@68: "VEDIC EXTENSIONS",
jaroslav@68: "VEDICEXTENSIONS");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Phonetic Extensions Supplement" Unicode character
jaroslav@68: * block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock PHONETIC_EXTENSIONS_SUPPLEMENT =
jaroslav@68: new UnicodeBlock("PHONETIC_EXTENSIONS_SUPPLEMENT",
jaroslav@68: "PHONETIC EXTENSIONS SUPPLEMENT",
jaroslav@68: "PHONETICEXTENSIONSSUPPLEMENT");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Combining Diacritical Marks Supplement" Unicode
jaroslav@68: * character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock COMBINING_DIACRITICAL_MARKS_SUPPLEMENT =
jaroslav@68: new UnicodeBlock("COMBINING_DIACRITICAL_MARKS_SUPPLEMENT",
jaroslav@68: "COMBINING DIACRITICAL MARKS SUPPLEMENT",
jaroslav@68: "COMBININGDIACRITICALMARKSSUPPLEMENT");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Glagolitic" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock GLAGOLITIC =
jaroslav@68: new UnicodeBlock("GLAGOLITIC");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Latin Extended-C" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock LATIN_EXTENDED_C =
jaroslav@68: new UnicodeBlock("LATIN_EXTENDED_C",
jaroslav@68: "LATIN EXTENDED-C",
jaroslav@68: "LATINEXTENDED-C");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Coptic" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock COPTIC =
jaroslav@68: new UnicodeBlock("COPTIC");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Georgian Supplement" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock GEORGIAN_SUPPLEMENT =
jaroslav@68: new UnicodeBlock("GEORGIAN_SUPPLEMENT",
jaroslav@68: "GEORGIAN SUPPLEMENT",
jaroslav@68: "GEORGIANSUPPLEMENT");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Tifinagh" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock TIFINAGH =
jaroslav@68: new UnicodeBlock("TIFINAGH");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Ethiopic Extended" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock ETHIOPIC_EXTENDED =
jaroslav@68: new UnicodeBlock("ETHIOPIC_EXTENDED",
jaroslav@68: "ETHIOPIC EXTENDED",
jaroslav@68: "ETHIOPICEXTENDED");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Cyrillic Extended-A" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock CYRILLIC_EXTENDED_A =
jaroslav@68: new UnicodeBlock("CYRILLIC_EXTENDED_A",
jaroslav@68: "CYRILLIC EXTENDED-A",
jaroslav@68: "CYRILLICEXTENDED-A");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Supplemental Punctuation" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock SUPPLEMENTAL_PUNCTUATION =
jaroslav@68: new UnicodeBlock("SUPPLEMENTAL_PUNCTUATION",
jaroslav@68: "SUPPLEMENTAL PUNCTUATION",
jaroslav@68: "SUPPLEMENTALPUNCTUATION");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "CJK Strokes" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock CJK_STROKES =
jaroslav@68: new UnicodeBlock("CJK_STROKES",
jaroslav@68: "CJK STROKES",
jaroslav@68: "CJKSTROKES");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Lisu" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock LISU =
jaroslav@68: new UnicodeBlock("LISU");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Vai" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock VAI =
jaroslav@68: new UnicodeBlock("VAI");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Cyrillic Extended-B" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock CYRILLIC_EXTENDED_B =
jaroslav@68: new UnicodeBlock("CYRILLIC_EXTENDED_B",
jaroslav@68: "CYRILLIC EXTENDED-B",
jaroslav@68: "CYRILLICEXTENDED-B");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Bamum" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock BAMUM =
jaroslav@68: new UnicodeBlock("BAMUM");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Modifier Tone Letters" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock MODIFIER_TONE_LETTERS =
jaroslav@68: new UnicodeBlock("MODIFIER_TONE_LETTERS",
jaroslav@68: "MODIFIER TONE LETTERS",
jaroslav@68: "MODIFIERTONELETTERS");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Latin Extended-D" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock LATIN_EXTENDED_D =
jaroslav@68: new UnicodeBlock("LATIN_EXTENDED_D",
jaroslav@68: "LATIN EXTENDED-D",
jaroslav@68: "LATINEXTENDED-D");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Syloti Nagri" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock SYLOTI_NAGRI =
jaroslav@68: new UnicodeBlock("SYLOTI_NAGRI",
jaroslav@68: "SYLOTI NAGRI",
jaroslav@68: "SYLOTINAGRI");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Common Indic Number Forms" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock COMMON_INDIC_NUMBER_FORMS =
jaroslav@68: new UnicodeBlock("COMMON_INDIC_NUMBER_FORMS",
jaroslav@68: "COMMON INDIC NUMBER FORMS",
jaroslav@68: "COMMONINDICNUMBERFORMS");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Phags-pa" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock PHAGS_PA =
jaroslav@68: new UnicodeBlock("PHAGS_PA",
jaroslav@68: "PHAGS-PA");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Saurashtra" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock SAURASHTRA =
jaroslav@68: new UnicodeBlock("SAURASHTRA");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Devanagari Extended" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock DEVANAGARI_EXTENDED =
jaroslav@68: new UnicodeBlock("DEVANAGARI_EXTENDED",
jaroslav@68: "DEVANAGARI EXTENDED",
jaroslav@68: "DEVANAGARIEXTENDED");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Kayah Li" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock KAYAH_LI =
jaroslav@68: new UnicodeBlock("KAYAH_LI",
jaroslav@68: "KAYAH LI",
jaroslav@68: "KAYAHLI");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Rejang" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock REJANG =
jaroslav@68: new UnicodeBlock("REJANG");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Hangul Jamo Extended-A" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock HANGUL_JAMO_EXTENDED_A =
jaroslav@68: new UnicodeBlock("HANGUL_JAMO_EXTENDED_A",
jaroslav@68: "HANGUL JAMO EXTENDED-A",
jaroslav@68: "HANGULJAMOEXTENDED-A");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Javanese" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock JAVANESE =
jaroslav@68: new UnicodeBlock("JAVANESE");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Cham" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock CHAM =
jaroslav@68: new UnicodeBlock("CHAM");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Myanmar Extended-A" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock MYANMAR_EXTENDED_A =
jaroslav@68: new UnicodeBlock("MYANMAR_EXTENDED_A",
jaroslav@68: "MYANMAR EXTENDED-A",
jaroslav@68: "MYANMAREXTENDED-A");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Tai Viet" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock TAI_VIET =
jaroslav@68: new UnicodeBlock("TAI_VIET",
jaroslav@68: "TAI VIET",
jaroslav@68: "TAIVIET");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Ethiopic Extended-A" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock ETHIOPIC_EXTENDED_A =
jaroslav@68: new UnicodeBlock("ETHIOPIC_EXTENDED_A",
jaroslav@68: "ETHIOPIC EXTENDED-A",
jaroslav@68: "ETHIOPICEXTENDED-A");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Meetei Mayek" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock MEETEI_MAYEK =
jaroslav@68: new UnicodeBlock("MEETEI_MAYEK",
jaroslav@68: "MEETEI MAYEK",
jaroslav@68: "MEETEIMAYEK");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Hangul Jamo Extended-B" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock HANGUL_JAMO_EXTENDED_B =
jaroslav@68: new UnicodeBlock("HANGUL_JAMO_EXTENDED_B",
jaroslav@68: "HANGUL JAMO EXTENDED-B",
jaroslav@68: "HANGULJAMOEXTENDED-B");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Vertical Forms" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock VERTICAL_FORMS =
jaroslav@68: new UnicodeBlock("VERTICAL_FORMS",
jaroslav@68: "VERTICAL FORMS",
jaroslav@68: "VERTICALFORMS");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Ancient Greek Numbers" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock ANCIENT_GREEK_NUMBERS =
jaroslav@68: new UnicodeBlock("ANCIENT_GREEK_NUMBERS",
jaroslav@68: "ANCIENT GREEK NUMBERS",
jaroslav@68: "ANCIENTGREEKNUMBERS");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Ancient Symbols" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock ANCIENT_SYMBOLS =
jaroslav@68: new UnicodeBlock("ANCIENT_SYMBOLS",
jaroslav@68: "ANCIENT SYMBOLS",
jaroslav@68: "ANCIENTSYMBOLS");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Phaistos Disc" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock PHAISTOS_DISC =
jaroslav@68: new UnicodeBlock("PHAISTOS_DISC",
jaroslav@68: "PHAISTOS DISC",
jaroslav@68: "PHAISTOSDISC");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Lycian" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock LYCIAN =
jaroslav@68: new UnicodeBlock("LYCIAN");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Carian" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock CARIAN =
jaroslav@68: new UnicodeBlock("CARIAN");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Old Persian" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock OLD_PERSIAN =
jaroslav@68: new UnicodeBlock("OLD_PERSIAN",
jaroslav@68: "OLD PERSIAN",
jaroslav@68: "OLDPERSIAN");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Imperial Aramaic" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock IMPERIAL_ARAMAIC =
jaroslav@68: new UnicodeBlock("IMPERIAL_ARAMAIC",
jaroslav@68: "IMPERIAL ARAMAIC",
jaroslav@68: "IMPERIALARAMAIC");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Phoenician" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock PHOENICIAN =
jaroslav@68: new UnicodeBlock("PHOENICIAN");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Lydian" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock LYDIAN =
jaroslav@68: new UnicodeBlock("LYDIAN");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Kharoshthi" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock KHAROSHTHI =
jaroslav@68: new UnicodeBlock("KHAROSHTHI");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Old South Arabian" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock OLD_SOUTH_ARABIAN =
jaroslav@68: new UnicodeBlock("OLD_SOUTH_ARABIAN",
jaroslav@68: "OLD SOUTH ARABIAN",
jaroslav@68: "OLDSOUTHARABIAN");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Avestan" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock AVESTAN =
jaroslav@68: new UnicodeBlock("AVESTAN");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Inscriptional Parthian" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock INSCRIPTIONAL_PARTHIAN =
jaroslav@68: new UnicodeBlock("INSCRIPTIONAL_PARTHIAN",
jaroslav@68: "INSCRIPTIONAL PARTHIAN",
jaroslav@68: "INSCRIPTIONALPARTHIAN");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Inscriptional Pahlavi" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock INSCRIPTIONAL_PAHLAVI =
jaroslav@68: new UnicodeBlock("INSCRIPTIONAL_PAHLAVI",
jaroslav@68: "INSCRIPTIONAL PAHLAVI",
jaroslav@68: "INSCRIPTIONALPAHLAVI");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Old Turkic" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock OLD_TURKIC =
jaroslav@68: new UnicodeBlock("OLD_TURKIC",
jaroslav@68: "OLD TURKIC",
jaroslav@68: "OLDTURKIC");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Rumi Numeral Symbols" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock RUMI_NUMERAL_SYMBOLS =
jaroslav@68: new UnicodeBlock("RUMI_NUMERAL_SYMBOLS",
jaroslav@68: "RUMI NUMERAL SYMBOLS",
jaroslav@68: "RUMINUMERALSYMBOLS");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Brahmi" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock BRAHMI =
jaroslav@68: new UnicodeBlock("BRAHMI");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Kaithi" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock KAITHI =
jaroslav@68: new UnicodeBlock("KAITHI");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Cuneiform" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock CUNEIFORM =
jaroslav@68: new UnicodeBlock("CUNEIFORM");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Cuneiform Numbers and Punctuation" Unicode
jaroslav@68: * character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock CUNEIFORM_NUMBERS_AND_PUNCTUATION =
jaroslav@68: new UnicodeBlock("CUNEIFORM_NUMBERS_AND_PUNCTUATION",
jaroslav@68: "CUNEIFORM NUMBERS AND PUNCTUATION",
jaroslav@68: "CUNEIFORMNUMBERSANDPUNCTUATION");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Egyptian Hieroglyphs" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock EGYPTIAN_HIEROGLYPHS =
jaroslav@68: new UnicodeBlock("EGYPTIAN_HIEROGLYPHS",
jaroslav@68: "EGYPTIAN HIEROGLYPHS",
jaroslav@68: "EGYPTIANHIEROGLYPHS");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Bamum Supplement" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock BAMUM_SUPPLEMENT =
jaroslav@68: new UnicodeBlock("BAMUM_SUPPLEMENT",
jaroslav@68: "BAMUM SUPPLEMENT",
jaroslav@68: "BAMUMSUPPLEMENT");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Kana Supplement" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock KANA_SUPPLEMENT =
jaroslav@68: new UnicodeBlock("KANA_SUPPLEMENT",
jaroslav@68: "KANA SUPPLEMENT",
jaroslav@68: "KANASUPPLEMENT");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Ancient Greek Musical Notation" Unicode character
jaroslav@68: * block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock ANCIENT_GREEK_MUSICAL_NOTATION =
jaroslav@68: new UnicodeBlock("ANCIENT_GREEK_MUSICAL_NOTATION",
jaroslav@68: "ANCIENT GREEK MUSICAL NOTATION",
jaroslav@68: "ANCIENTGREEKMUSICALNOTATION");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Counting Rod Numerals" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock COUNTING_ROD_NUMERALS =
jaroslav@68: new UnicodeBlock("COUNTING_ROD_NUMERALS",
jaroslav@68: "COUNTING ROD NUMERALS",
jaroslav@68: "COUNTINGRODNUMERALS");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Mahjong Tiles" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock MAHJONG_TILES =
jaroslav@68: new UnicodeBlock("MAHJONG_TILES",
jaroslav@68: "MAHJONG TILES",
jaroslav@68: "MAHJONGTILES");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Domino Tiles" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock DOMINO_TILES =
jaroslav@68: new UnicodeBlock("DOMINO_TILES",
jaroslav@68: "DOMINO TILES",
jaroslav@68: "DOMINOTILES");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Playing Cards" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock PLAYING_CARDS =
jaroslav@68: new UnicodeBlock("PLAYING_CARDS",
jaroslav@68: "PLAYING CARDS",
jaroslav@68: "PLAYINGCARDS");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Enclosed Alphanumeric Supplement" Unicode character
jaroslav@68: * block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock ENCLOSED_ALPHANUMERIC_SUPPLEMENT =
jaroslav@68: new UnicodeBlock("ENCLOSED_ALPHANUMERIC_SUPPLEMENT",
jaroslav@68: "ENCLOSED ALPHANUMERIC SUPPLEMENT",
jaroslav@68: "ENCLOSEDALPHANUMERICSUPPLEMENT");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Enclosed Ideographic Supplement" Unicode character
jaroslav@68: * block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock ENCLOSED_IDEOGRAPHIC_SUPPLEMENT =
jaroslav@68: new UnicodeBlock("ENCLOSED_IDEOGRAPHIC_SUPPLEMENT",
jaroslav@68: "ENCLOSED IDEOGRAPHIC SUPPLEMENT",
jaroslav@68: "ENCLOSEDIDEOGRAPHICSUPPLEMENT");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Miscellaneous Symbols And Pictographs" Unicode
jaroslav@68: * character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock MISCELLANEOUS_SYMBOLS_AND_PICTOGRAPHS =
jaroslav@68: new UnicodeBlock("MISCELLANEOUS_SYMBOLS_AND_PICTOGRAPHS",
jaroslav@68: "MISCELLANEOUS SYMBOLS AND PICTOGRAPHS",
jaroslav@68: "MISCELLANEOUSSYMBOLSANDPICTOGRAPHS");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Emoticons" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock EMOTICONS =
jaroslav@68: new UnicodeBlock("EMOTICONS");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Transport And Map Symbols" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock TRANSPORT_AND_MAP_SYMBOLS =
jaroslav@68: new UnicodeBlock("TRANSPORT_AND_MAP_SYMBOLS",
jaroslav@68: "TRANSPORT AND MAP SYMBOLS",
jaroslav@68: "TRANSPORTANDMAPSYMBOLS");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "Alchemical Symbols" Unicode character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock ALCHEMICAL_SYMBOLS =
jaroslav@68: new UnicodeBlock("ALCHEMICAL_SYMBOLS",
jaroslav@68: "ALCHEMICAL SYMBOLS",
jaroslav@68: "ALCHEMICALSYMBOLS");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "CJK Unified Ideographs Extension C" Unicode
jaroslav@68: * character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock CJK_UNIFIED_IDEOGRAPHS_EXTENSION_C =
jaroslav@68: new UnicodeBlock("CJK_UNIFIED_IDEOGRAPHS_EXTENSION_C",
jaroslav@68: "CJK UNIFIED IDEOGRAPHS EXTENSION C",
jaroslav@68: "CJKUNIFIEDIDEOGRAPHSEXTENSIONC");
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constant for the "CJK Unified Ideographs Extension D" Unicode
jaroslav@68: * character block.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock CJK_UNIFIED_IDEOGRAPHS_EXTENSION_D =
jaroslav@68: new UnicodeBlock("CJK_UNIFIED_IDEOGRAPHS_EXTENSION_D",
jaroslav@68: "CJK UNIFIED IDEOGRAPHS EXTENSION D",
jaroslav@68: "CJKUNIFIEDIDEOGRAPHSEXTENSIOND");
jaroslav@68:
jaroslav@68: private static final int blockStarts[] = {
jaroslav@68: 0x0000, // 0000..007F; Basic Latin
jaroslav@68: 0x0080, // 0080..00FF; Latin-1 Supplement
jaroslav@68: 0x0100, // 0100..017F; Latin Extended-A
jaroslav@68: 0x0180, // 0180..024F; Latin Extended-B
jaroslav@68: 0x0250, // 0250..02AF; IPA Extensions
jaroslav@68: 0x02B0, // 02B0..02FF; Spacing Modifier Letters
jaroslav@68: 0x0300, // 0300..036F; Combining Diacritical Marks
jaroslav@68: 0x0370, // 0370..03FF; Greek and Coptic
jaroslav@68: 0x0400, // 0400..04FF; Cyrillic
jaroslav@68: 0x0500, // 0500..052F; Cyrillic Supplement
jaroslav@68: 0x0530, // 0530..058F; Armenian
jaroslav@68: 0x0590, // 0590..05FF; Hebrew
jaroslav@68: 0x0600, // 0600..06FF; Arabic
jaroslav@68: 0x0700, // 0700..074F; Syriac
jaroslav@68: 0x0750, // 0750..077F; Arabic Supplement
jaroslav@68: 0x0780, // 0780..07BF; Thaana
jaroslav@68: 0x07C0, // 07C0..07FF; NKo
jaroslav@68: 0x0800, // 0800..083F; Samaritan
jaroslav@68: 0x0840, // 0840..085F; Mandaic
jaroslav@68: 0x0860, // unassigned
jaroslav@68: 0x0900, // 0900..097F; Devanagari
jaroslav@68: 0x0980, // 0980..09FF; Bengali
jaroslav@68: 0x0A00, // 0A00..0A7F; Gurmukhi
jaroslav@68: 0x0A80, // 0A80..0AFF; Gujarati
jaroslav@68: 0x0B00, // 0B00..0B7F; Oriya
jaroslav@68: 0x0B80, // 0B80..0BFF; Tamil
jaroslav@68: 0x0C00, // 0C00..0C7F; Telugu
jaroslav@68: 0x0C80, // 0C80..0CFF; Kannada
jaroslav@68: 0x0D00, // 0D00..0D7F; Malayalam
jaroslav@68: 0x0D80, // 0D80..0DFF; Sinhala
jaroslav@68: 0x0E00, // 0E00..0E7F; Thai
jaroslav@68: 0x0E80, // 0E80..0EFF; Lao
jaroslav@68: 0x0F00, // 0F00..0FFF; Tibetan
jaroslav@68: 0x1000, // 1000..109F; Myanmar
jaroslav@68: 0x10A0, // 10A0..10FF; Georgian
jaroslav@68: 0x1100, // 1100..11FF; Hangul Jamo
jaroslav@68: 0x1200, // 1200..137F; Ethiopic
jaroslav@68: 0x1380, // 1380..139F; Ethiopic Supplement
jaroslav@68: 0x13A0, // 13A0..13FF; Cherokee
jaroslav@68: 0x1400, // 1400..167F; Unified Canadian Aboriginal Syllabics
jaroslav@68: 0x1680, // 1680..169F; Ogham
jaroslav@68: 0x16A0, // 16A0..16FF; Runic
jaroslav@68: 0x1700, // 1700..171F; Tagalog
jaroslav@68: 0x1720, // 1720..173F; Hanunoo
jaroslav@68: 0x1740, // 1740..175F; Buhid
jaroslav@68: 0x1760, // 1760..177F; Tagbanwa
jaroslav@68: 0x1780, // 1780..17FF; Khmer
jaroslav@68: 0x1800, // 1800..18AF; Mongolian
jaroslav@68: 0x18B0, // 18B0..18FF; Unified Canadian Aboriginal Syllabics Extended
jaroslav@68: 0x1900, // 1900..194F; Limbu
jaroslav@68: 0x1950, // 1950..197F; Tai Le
jaroslav@68: 0x1980, // 1980..19DF; New Tai Lue
jaroslav@68: 0x19E0, // 19E0..19FF; Khmer Symbols
jaroslav@68: 0x1A00, // 1A00..1A1F; Buginese
jaroslav@68: 0x1A20, // 1A20..1AAF; Tai Tham
jaroslav@68: 0x1AB0, // unassigned
jaroslav@68: 0x1B00, // 1B00..1B7F; Balinese
jaroslav@68: 0x1B80, // 1B80..1BBF; Sundanese
jaroslav@68: 0x1BC0, // 1BC0..1BFF; Batak
jaroslav@68: 0x1C00, // 1C00..1C4F; Lepcha
jaroslav@68: 0x1C50, // 1C50..1C7F; Ol Chiki
jaroslav@68: 0x1C80, // unassigned
jaroslav@68: 0x1CD0, // 1CD0..1CFF; Vedic Extensions
jaroslav@68: 0x1D00, // 1D00..1D7F; Phonetic Extensions
jaroslav@68: 0x1D80, // 1D80..1DBF; Phonetic Extensions Supplement
jaroslav@68: 0x1DC0, // 1DC0..1DFF; Combining Diacritical Marks Supplement
jaroslav@68: 0x1E00, // 1E00..1EFF; Latin Extended Additional
jaroslav@68: 0x1F00, // 1F00..1FFF; Greek Extended
jaroslav@68: 0x2000, // 2000..206F; General Punctuation
jaroslav@68: 0x2070, // 2070..209F; Superscripts and Subscripts
jaroslav@68: 0x20A0, // 20A0..20CF; Currency Symbols
jaroslav@68: 0x20D0, // 20D0..20FF; Combining Diacritical Marks for Symbols
jaroslav@68: 0x2100, // 2100..214F; Letterlike Symbols
jaroslav@68: 0x2150, // 2150..218F; Number Forms
jaroslav@68: 0x2190, // 2190..21FF; Arrows
jaroslav@68: 0x2200, // 2200..22FF; Mathematical Operators
jaroslav@68: 0x2300, // 2300..23FF; Miscellaneous Technical
jaroslav@68: 0x2400, // 2400..243F; Control Pictures
jaroslav@68: 0x2440, // 2440..245F; Optical Character Recognition
jaroslav@68: 0x2460, // 2460..24FF; Enclosed Alphanumerics
jaroslav@68: 0x2500, // 2500..257F; Box Drawing
jaroslav@68: 0x2580, // 2580..259F; Block Elements
jaroslav@68: 0x25A0, // 25A0..25FF; Geometric Shapes
jaroslav@68: 0x2600, // 2600..26FF; Miscellaneous Symbols
jaroslav@68: 0x2700, // 2700..27BF; Dingbats
jaroslav@68: 0x27C0, // 27C0..27EF; Miscellaneous Mathematical Symbols-A
jaroslav@68: 0x27F0, // 27F0..27FF; Supplemental Arrows-A
jaroslav@68: 0x2800, // 2800..28FF; Braille Patterns
jaroslav@68: 0x2900, // 2900..297F; Supplemental Arrows-B
jaroslav@68: 0x2980, // 2980..29FF; Miscellaneous Mathematical Symbols-B
jaroslav@68: 0x2A00, // 2A00..2AFF; Supplemental Mathematical Operators
jaroslav@68: 0x2B00, // 2B00..2BFF; Miscellaneous Symbols and Arrows
jaroslav@68: 0x2C00, // 2C00..2C5F; Glagolitic
jaroslav@68: 0x2C60, // 2C60..2C7F; Latin Extended-C
jaroslav@68: 0x2C80, // 2C80..2CFF; Coptic
jaroslav@68: 0x2D00, // 2D00..2D2F; Georgian Supplement
jaroslav@68: 0x2D30, // 2D30..2D7F; Tifinagh
jaroslav@68: 0x2D80, // 2D80..2DDF; Ethiopic Extended
jaroslav@68: 0x2DE0, // 2DE0..2DFF; Cyrillic Extended-A
jaroslav@68: 0x2E00, // 2E00..2E7F; Supplemental Punctuation
jaroslav@68: 0x2E80, // 2E80..2EFF; CJK Radicals Supplement
jaroslav@68: 0x2F00, // 2F00..2FDF; Kangxi Radicals
jaroslav@68: 0x2FE0, // unassigned
jaroslav@68: 0x2FF0, // 2FF0..2FFF; Ideographic Description Characters
jaroslav@68: 0x3000, // 3000..303F; CJK Symbols and Punctuation
jaroslav@68: 0x3040, // 3040..309F; Hiragana
jaroslav@68: 0x30A0, // 30A0..30FF; Katakana
jaroslav@68: 0x3100, // 3100..312F; Bopomofo
jaroslav@68: 0x3130, // 3130..318F; Hangul Compatibility Jamo
jaroslav@68: 0x3190, // 3190..319F; Kanbun
jaroslav@68: 0x31A0, // 31A0..31BF; Bopomofo Extended
jaroslav@68: 0x31C0, // 31C0..31EF; CJK Strokes
jaroslav@68: 0x31F0, // 31F0..31FF; Katakana Phonetic Extensions
jaroslav@68: 0x3200, // 3200..32FF; Enclosed CJK Letters and Months
jaroslav@68: 0x3300, // 3300..33FF; CJK Compatibility
jaroslav@68: 0x3400, // 3400..4DBF; CJK Unified Ideographs Extension A
jaroslav@68: 0x4DC0, // 4DC0..4DFF; Yijing Hexagram Symbols
jaroslav@68: 0x4E00, // 4E00..9FFF; CJK Unified Ideographs
jaroslav@68: 0xA000, // A000..A48F; Yi Syllables
jaroslav@68: 0xA490, // A490..A4CF; Yi Radicals
jaroslav@68: 0xA4D0, // A4D0..A4FF; Lisu
jaroslav@68: 0xA500, // A500..A63F; Vai
jaroslav@68: 0xA640, // A640..A69F; Cyrillic Extended-B
jaroslav@68: 0xA6A0, // A6A0..A6FF; Bamum
jaroslav@68: 0xA700, // A700..A71F; Modifier Tone Letters
jaroslav@68: 0xA720, // A720..A7FF; Latin Extended-D
jaroslav@68: 0xA800, // A800..A82F; Syloti Nagri
jaroslav@68: 0xA830, // A830..A83F; Common Indic Number Forms
jaroslav@68: 0xA840, // A840..A87F; Phags-pa
jaroslav@68: 0xA880, // A880..A8DF; Saurashtra
jaroslav@68: 0xA8E0, // A8E0..A8FF; Devanagari Extended
jaroslav@68: 0xA900, // A900..A92F; Kayah Li
jaroslav@68: 0xA930, // A930..A95F; Rejang
jaroslav@68: 0xA960, // A960..A97F; Hangul Jamo Extended-A
jaroslav@68: 0xA980, // A980..A9DF; Javanese
jaroslav@68: 0xA9E0, // unassigned
jaroslav@68: 0xAA00, // AA00..AA5F; Cham
jaroslav@68: 0xAA60, // AA60..AA7F; Myanmar Extended-A
jaroslav@68: 0xAA80, // AA80..AADF; Tai Viet
jaroslav@68: 0xAAE0, // unassigned
jaroslav@68: 0xAB00, // AB00..AB2F; Ethiopic Extended-A
jaroslav@68: 0xAB30, // unassigned
jaroslav@68: 0xABC0, // ABC0..ABFF; Meetei Mayek
jaroslav@68: 0xAC00, // AC00..D7AF; Hangul Syllables
jaroslav@68: 0xD7B0, // D7B0..D7FF; Hangul Jamo Extended-B
jaroslav@68: 0xD800, // D800..DB7F; High Surrogates
jaroslav@68: 0xDB80, // DB80..DBFF; High Private Use Surrogates
jaroslav@68: 0xDC00, // DC00..DFFF; Low Surrogates
jaroslav@68: 0xE000, // E000..F8FF; Private Use Area
jaroslav@68: 0xF900, // F900..FAFF; CJK Compatibility Ideographs
jaroslav@68: 0xFB00, // FB00..FB4F; Alphabetic Presentation Forms
jaroslav@68: 0xFB50, // FB50..FDFF; Arabic Presentation Forms-A
jaroslav@68: 0xFE00, // FE00..FE0F; Variation Selectors
jaroslav@68: 0xFE10, // FE10..FE1F; Vertical Forms
jaroslav@68: 0xFE20, // FE20..FE2F; Combining Half Marks
jaroslav@68: 0xFE30, // FE30..FE4F; CJK Compatibility Forms
jaroslav@68: 0xFE50, // FE50..FE6F; Small Form Variants
jaroslav@68: 0xFE70, // FE70..FEFF; Arabic Presentation Forms-B
jaroslav@68: 0xFF00, // FF00..FFEF; Halfwidth and Fullwidth Forms
jaroslav@68: 0xFFF0, // FFF0..FFFF; Specials
jaroslav@68: 0x10000, // 10000..1007F; Linear B Syllabary
jaroslav@68: 0x10080, // 10080..100FF; Linear B Ideograms
jaroslav@68: 0x10100, // 10100..1013F; Aegean Numbers
jaroslav@68: 0x10140, // 10140..1018F; Ancient Greek Numbers
jaroslav@68: 0x10190, // 10190..101CF; Ancient Symbols
jaroslav@68: 0x101D0, // 101D0..101FF; Phaistos Disc
jaroslav@68: 0x10200, // unassigned
jaroslav@68: 0x10280, // 10280..1029F; Lycian
jaroslav@68: 0x102A0, // 102A0..102DF; Carian
jaroslav@68: 0x102E0, // unassigned
jaroslav@68: 0x10300, // 10300..1032F; Old Italic
jaroslav@68: 0x10330, // 10330..1034F; Gothic
jaroslav@68: 0x10350, // unassigned
jaroslav@68: 0x10380, // 10380..1039F; Ugaritic
jaroslav@68: 0x103A0, // 103A0..103DF; Old Persian
jaroslav@68: 0x103E0, // unassigned
jaroslav@68: 0x10400, // 10400..1044F; Deseret
jaroslav@68: 0x10450, // 10450..1047F; Shavian
jaroslav@68: 0x10480, // 10480..104AF; Osmanya
jaroslav@68: 0x104B0, // unassigned
jaroslav@68: 0x10800, // 10800..1083F; Cypriot Syllabary
jaroslav@68: 0x10840, // 10840..1085F; Imperial Aramaic
jaroslav@68: 0x10860, // unassigned
jaroslav@68: 0x10900, // 10900..1091F; Phoenician
jaroslav@68: 0x10920, // 10920..1093F; Lydian
jaroslav@68: 0x10940, // unassigned
jaroslav@68: 0x10A00, // 10A00..10A5F; Kharoshthi
jaroslav@68: 0x10A60, // 10A60..10A7F; Old South Arabian
jaroslav@68: 0x10A80, // unassigned
jaroslav@68: 0x10B00, // 10B00..10B3F; Avestan
jaroslav@68: 0x10B40, // 10B40..10B5F; Inscriptional Parthian
jaroslav@68: 0x10B60, // 10B60..10B7F; Inscriptional Pahlavi
jaroslav@68: 0x10B80, // unassigned
jaroslav@68: 0x10C00, // 10C00..10C4F; Old Turkic
jaroslav@68: 0x10C50, // unassigned
jaroslav@68: 0x10E60, // 10E60..10E7F; Rumi Numeral Symbols
jaroslav@68: 0x10E80, // unassigned
jaroslav@68: 0x11000, // 11000..1107F; Brahmi
jaroslav@68: 0x11080, // 11080..110CF; Kaithi
jaroslav@68: 0x110D0, // unassigned
jaroslav@68: 0x12000, // 12000..123FF; Cuneiform
jaroslav@68: 0x12400, // 12400..1247F; Cuneiform Numbers and Punctuation
jaroslav@68: 0x12480, // unassigned
jaroslav@68: 0x13000, // 13000..1342F; Egyptian Hieroglyphs
jaroslav@68: 0x13430, // unassigned
jaroslav@68: 0x16800, // 16800..16A3F; Bamum Supplement
jaroslav@68: 0x16A40, // unassigned
jaroslav@68: 0x1B000, // 1B000..1B0FF; Kana Supplement
jaroslav@68: 0x1B100, // unassigned
jaroslav@68: 0x1D000, // 1D000..1D0FF; Byzantine Musical Symbols
jaroslav@68: 0x1D100, // 1D100..1D1FF; Musical Symbols
jaroslav@68: 0x1D200, // 1D200..1D24F; Ancient Greek Musical Notation
jaroslav@68: 0x1D250, // unassigned
jaroslav@68: 0x1D300, // 1D300..1D35F; Tai Xuan Jing Symbols
jaroslav@68: 0x1D360, // 1D360..1D37F; Counting Rod Numerals
jaroslav@68: 0x1D380, // unassigned
jaroslav@68: 0x1D400, // 1D400..1D7FF; Mathematical Alphanumeric Symbols
jaroslav@68: 0x1D800, // unassigned
jaroslav@68: 0x1F000, // 1F000..1F02F; Mahjong Tiles
jaroslav@68: 0x1F030, // 1F030..1F09F; Domino Tiles
jaroslav@68: 0x1F0A0, // 1F0A0..1F0FF; Playing Cards
jaroslav@68: 0x1F100, // 1F100..1F1FF; Enclosed Alphanumeric Supplement
jaroslav@68: 0x1F200, // 1F200..1F2FF; Enclosed Ideographic Supplement
jaroslav@68: 0x1F300, // 1F300..1F5FF; Miscellaneous Symbols And Pictographs
jaroslav@68: 0x1F600, // 1F600..1F64F; Emoticons
jaroslav@68: 0x1F650, // unassigned
jaroslav@68: 0x1F680, // 1F680..1F6FF; Transport And Map Symbols
jaroslav@68: 0x1F700, // 1F700..1F77F; Alchemical Symbols
jaroslav@68: 0x1F780, // unassigned
jaroslav@68: 0x20000, // 20000..2A6DF; CJK Unified Ideographs Extension B
jaroslav@68: 0x2A6E0, // unassigned
jaroslav@68: 0x2A700, // 2A700..2B73F; CJK Unified Ideographs Extension C
jaroslav@68: 0x2B740, // 2B740..2B81F; CJK Unified Ideographs Extension D
jaroslav@68: 0x2B820, // unassigned
jaroslav@68: 0x2F800, // 2F800..2FA1F; CJK Compatibility Ideographs Supplement
jaroslav@68: 0x2FA20, // unassigned
jaroslav@68: 0xE0000, // E0000..E007F; Tags
jaroslav@68: 0xE0080, // unassigned
jaroslav@68: 0xE0100, // E0100..E01EF; Variation Selectors Supplement
jaroslav@68: 0xE01F0, // unassigned
jaroslav@68: 0xF0000, // F0000..FFFFF; Supplementary Private Use Area-A
jaroslav@68: 0x100000 // 100000..10FFFF; Supplementary Private Use Area-B
jaroslav@68: };
jaroslav@68:
jaroslav@68: private static final UnicodeBlock[] blocks = {
jaroslav@68: BASIC_LATIN,
jaroslav@68: LATIN_1_SUPPLEMENT,
jaroslav@68: LATIN_EXTENDED_A,
jaroslav@68: LATIN_EXTENDED_B,
jaroslav@68: IPA_EXTENSIONS,
jaroslav@68: SPACING_MODIFIER_LETTERS,
jaroslav@68: COMBINING_DIACRITICAL_MARKS,
jaroslav@68: GREEK,
jaroslav@68: CYRILLIC,
jaroslav@68: CYRILLIC_SUPPLEMENTARY,
jaroslav@68: ARMENIAN,
jaroslav@68: HEBREW,
jaroslav@68: ARABIC,
jaroslav@68: SYRIAC,
jaroslav@68: ARABIC_SUPPLEMENT,
jaroslav@68: THAANA,
jaroslav@68: NKO,
jaroslav@68: SAMARITAN,
jaroslav@68: MANDAIC,
jaroslav@68: null,
jaroslav@68: DEVANAGARI,
jaroslav@68: BENGALI,
jaroslav@68: GURMUKHI,
jaroslav@68: GUJARATI,
jaroslav@68: ORIYA,
jaroslav@68: TAMIL,
jaroslav@68: TELUGU,
jaroslav@68: KANNADA,
jaroslav@68: MALAYALAM,
jaroslav@68: SINHALA,
jaroslav@68: THAI,
jaroslav@68: LAO,
jaroslav@68: TIBETAN,
jaroslav@68: MYANMAR,
jaroslav@68: GEORGIAN,
jaroslav@68: HANGUL_JAMO,
jaroslav@68: ETHIOPIC,
jaroslav@68: ETHIOPIC_SUPPLEMENT,
jaroslav@68: CHEROKEE,
jaroslav@68: UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS,
jaroslav@68: OGHAM,
jaroslav@68: RUNIC,
jaroslav@68: TAGALOG,
jaroslav@68: HANUNOO,
jaroslav@68: BUHID,
jaroslav@68: TAGBANWA,
jaroslav@68: KHMER,
jaroslav@68: MONGOLIAN,
jaroslav@68: UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS_EXTENDED,
jaroslav@68: LIMBU,
jaroslav@68: TAI_LE,
jaroslav@68: NEW_TAI_LUE,
jaroslav@68: KHMER_SYMBOLS,
jaroslav@68: BUGINESE,
jaroslav@68: TAI_THAM,
jaroslav@68: null,
jaroslav@68: BALINESE,
jaroslav@68: SUNDANESE,
jaroslav@68: BATAK,
jaroslav@68: LEPCHA,
jaroslav@68: OL_CHIKI,
jaroslav@68: null,
jaroslav@68: VEDIC_EXTENSIONS,
jaroslav@68: PHONETIC_EXTENSIONS,
jaroslav@68: PHONETIC_EXTENSIONS_SUPPLEMENT,
jaroslav@68: COMBINING_DIACRITICAL_MARKS_SUPPLEMENT,
jaroslav@68: LATIN_EXTENDED_ADDITIONAL,
jaroslav@68: GREEK_EXTENDED,
jaroslav@68: GENERAL_PUNCTUATION,
jaroslav@68: SUPERSCRIPTS_AND_SUBSCRIPTS,
jaroslav@68: CURRENCY_SYMBOLS,
jaroslav@68: COMBINING_MARKS_FOR_SYMBOLS,
jaroslav@68: LETTERLIKE_SYMBOLS,
jaroslav@68: NUMBER_FORMS,
jaroslav@68: ARROWS,
jaroslav@68: MATHEMATICAL_OPERATORS,
jaroslav@68: MISCELLANEOUS_TECHNICAL,
jaroslav@68: CONTROL_PICTURES,
jaroslav@68: OPTICAL_CHARACTER_RECOGNITION,
jaroslav@68: ENCLOSED_ALPHANUMERICS,
jaroslav@68: BOX_DRAWING,
jaroslav@68: BLOCK_ELEMENTS,
jaroslav@68: GEOMETRIC_SHAPES,
jaroslav@68: MISCELLANEOUS_SYMBOLS,
jaroslav@68: DINGBATS,
jaroslav@68: MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A,
jaroslav@68: SUPPLEMENTAL_ARROWS_A,
jaroslav@68: BRAILLE_PATTERNS,
jaroslav@68: SUPPLEMENTAL_ARROWS_B,
jaroslav@68: MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B,
jaroslav@68: SUPPLEMENTAL_MATHEMATICAL_OPERATORS,
jaroslav@68: MISCELLANEOUS_SYMBOLS_AND_ARROWS,
jaroslav@68: GLAGOLITIC,
jaroslav@68: LATIN_EXTENDED_C,
jaroslav@68: COPTIC,
jaroslav@68: GEORGIAN_SUPPLEMENT,
jaroslav@68: TIFINAGH,
jaroslav@68: ETHIOPIC_EXTENDED,
jaroslav@68: CYRILLIC_EXTENDED_A,
jaroslav@68: SUPPLEMENTAL_PUNCTUATION,
jaroslav@68: CJK_RADICALS_SUPPLEMENT,
jaroslav@68: KANGXI_RADICALS,
jaroslav@68: null,
jaroslav@68: IDEOGRAPHIC_DESCRIPTION_CHARACTERS,
jaroslav@68: CJK_SYMBOLS_AND_PUNCTUATION,
jaroslav@68: HIRAGANA,
jaroslav@68: KATAKANA,
jaroslav@68: BOPOMOFO,
jaroslav@68: HANGUL_COMPATIBILITY_JAMO,
jaroslav@68: KANBUN,
jaroslav@68: BOPOMOFO_EXTENDED,
jaroslav@68: CJK_STROKES,
jaroslav@68: KATAKANA_PHONETIC_EXTENSIONS,
jaroslav@68: ENCLOSED_CJK_LETTERS_AND_MONTHS,
jaroslav@68: CJK_COMPATIBILITY,
jaroslav@68: CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A,
jaroslav@68: YIJING_HEXAGRAM_SYMBOLS,
jaroslav@68: CJK_UNIFIED_IDEOGRAPHS,
jaroslav@68: YI_SYLLABLES,
jaroslav@68: YI_RADICALS,
jaroslav@68: LISU,
jaroslav@68: VAI,
jaroslav@68: CYRILLIC_EXTENDED_B,
jaroslav@68: BAMUM,
jaroslav@68: MODIFIER_TONE_LETTERS,
jaroslav@68: LATIN_EXTENDED_D,
jaroslav@68: SYLOTI_NAGRI,
jaroslav@68: COMMON_INDIC_NUMBER_FORMS,
jaroslav@68: PHAGS_PA,
jaroslav@68: SAURASHTRA,
jaroslav@68: DEVANAGARI_EXTENDED,
jaroslav@68: KAYAH_LI,
jaroslav@68: REJANG,
jaroslav@68: HANGUL_JAMO_EXTENDED_A,
jaroslav@68: JAVANESE,
jaroslav@68: null,
jaroslav@68: CHAM,
jaroslav@68: MYANMAR_EXTENDED_A,
jaroslav@68: TAI_VIET,
jaroslav@68: null,
jaroslav@68: ETHIOPIC_EXTENDED_A,
jaroslav@68: null,
jaroslav@68: MEETEI_MAYEK,
jaroslav@68: HANGUL_SYLLABLES,
jaroslav@68: HANGUL_JAMO_EXTENDED_B,
jaroslav@68: HIGH_SURROGATES,
jaroslav@68: HIGH_PRIVATE_USE_SURROGATES,
jaroslav@68: LOW_SURROGATES,
jaroslav@68: PRIVATE_USE_AREA,
jaroslav@68: CJK_COMPATIBILITY_IDEOGRAPHS,
jaroslav@68: ALPHABETIC_PRESENTATION_FORMS,
jaroslav@68: ARABIC_PRESENTATION_FORMS_A,
jaroslav@68: VARIATION_SELECTORS,
jaroslav@68: VERTICAL_FORMS,
jaroslav@68: COMBINING_HALF_MARKS,
jaroslav@68: CJK_COMPATIBILITY_FORMS,
jaroslav@68: SMALL_FORM_VARIANTS,
jaroslav@68: ARABIC_PRESENTATION_FORMS_B,
jaroslav@68: HALFWIDTH_AND_FULLWIDTH_FORMS,
jaroslav@68: SPECIALS,
jaroslav@68: LINEAR_B_SYLLABARY,
jaroslav@68: LINEAR_B_IDEOGRAMS,
jaroslav@68: AEGEAN_NUMBERS,
jaroslav@68: ANCIENT_GREEK_NUMBERS,
jaroslav@68: ANCIENT_SYMBOLS,
jaroslav@68: PHAISTOS_DISC,
jaroslav@68: null,
jaroslav@68: LYCIAN,
jaroslav@68: CARIAN,
jaroslav@68: null,
jaroslav@68: OLD_ITALIC,
jaroslav@68: GOTHIC,
jaroslav@68: null,
jaroslav@68: UGARITIC,
jaroslav@68: OLD_PERSIAN,
jaroslav@68: null,
jaroslav@68: DESERET,
jaroslav@68: SHAVIAN,
jaroslav@68: OSMANYA,
jaroslav@68: null,
jaroslav@68: CYPRIOT_SYLLABARY,
jaroslav@68: IMPERIAL_ARAMAIC,
jaroslav@68: null,
jaroslav@68: PHOENICIAN,
jaroslav@68: LYDIAN,
jaroslav@68: null,
jaroslav@68: KHAROSHTHI,
jaroslav@68: OLD_SOUTH_ARABIAN,
jaroslav@68: null,
jaroslav@68: AVESTAN,
jaroslav@68: INSCRIPTIONAL_PARTHIAN,
jaroslav@68: INSCRIPTIONAL_PAHLAVI,
jaroslav@68: null,
jaroslav@68: OLD_TURKIC,
jaroslav@68: null,
jaroslav@68: RUMI_NUMERAL_SYMBOLS,
jaroslav@68: null,
jaroslav@68: BRAHMI,
jaroslav@68: KAITHI,
jaroslav@68: null,
jaroslav@68: CUNEIFORM,
jaroslav@68: CUNEIFORM_NUMBERS_AND_PUNCTUATION,
jaroslav@68: null,
jaroslav@68: EGYPTIAN_HIEROGLYPHS,
jaroslav@68: null,
jaroslav@68: BAMUM_SUPPLEMENT,
jaroslav@68: null,
jaroslav@68: KANA_SUPPLEMENT,
jaroslav@68: null,
jaroslav@68: BYZANTINE_MUSICAL_SYMBOLS,
jaroslav@68: MUSICAL_SYMBOLS,
jaroslav@68: ANCIENT_GREEK_MUSICAL_NOTATION,
jaroslav@68: null,
jaroslav@68: TAI_XUAN_JING_SYMBOLS,
jaroslav@68: COUNTING_ROD_NUMERALS,
jaroslav@68: null,
jaroslav@68: MATHEMATICAL_ALPHANUMERIC_SYMBOLS,
jaroslav@68: null,
jaroslav@68: MAHJONG_TILES,
jaroslav@68: DOMINO_TILES,
jaroslav@68: PLAYING_CARDS,
jaroslav@68: ENCLOSED_ALPHANUMERIC_SUPPLEMENT,
jaroslav@68: ENCLOSED_IDEOGRAPHIC_SUPPLEMENT,
jaroslav@68: MISCELLANEOUS_SYMBOLS_AND_PICTOGRAPHS,
jaroslav@68: EMOTICONS,
jaroslav@68: null,
jaroslav@68: TRANSPORT_AND_MAP_SYMBOLS,
jaroslav@68: ALCHEMICAL_SYMBOLS,
jaroslav@68: null,
jaroslav@68: CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B,
jaroslav@68: null,
jaroslav@68: CJK_UNIFIED_IDEOGRAPHS_EXTENSION_C,
jaroslav@68: CJK_UNIFIED_IDEOGRAPHS_EXTENSION_D,
jaroslav@68: null,
jaroslav@68: CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT,
jaroslav@68: null,
jaroslav@68: TAGS,
jaroslav@68: null,
jaroslav@68: VARIATION_SELECTORS_SUPPLEMENT,
jaroslav@68: null,
jaroslav@68: SUPPLEMENTARY_PRIVATE_USE_AREA_A,
jaroslav@68: SUPPLEMENTARY_PRIVATE_USE_AREA_B
jaroslav@68: };
jaroslav@68:
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Returns the object representing the Unicode block containing the
jaroslav@68: * given character, or {@code null} if the character is not a
jaroslav@68: * member of a defined block.
jaroslav@68: *
jaroslav@68: * Note: This method cannot handle
jaroslav@68: * supplementary
jaroslav@68: * characters. To support all Unicode characters, including
jaroslav@68: * supplementary characters, use the {@link #of(int)} method.
jaroslav@68: *
jaroslav@68: * @param c The character in question
jaroslav@68: * @return The {@code UnicodeBlock} instance representing the
jaroslav@68: * Unicode block of which this character is a member, or
jaroslav@68: * {@code null} if the character is not a member of any
jaroslav@68: * Unicode block
jaroslav@68: */
jaroslav@68: public static UnicodeBlock of(char c) {
jaroslav@68: return of((int)c);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Returns the object representing the Unicode block
jaroslav@68: * containing the given character (Unicode code point), or
jaroslav@68: * {@code null} if the character is not a member of a
jaroslav@68: * defined block.
jaroslav@68: *
jaroslav@68: * @param codePoint the character (Unicode code point) in question.
jaroslav@68: * @return The {@code UnicodeBlock} instance representing the
jaroslav@68: * Unicode block of which this character is a member, or
jaroslav@68: * {@code null} if the character is not a member of any
jaroslav@68: * Unicode block
jaroslav@68: * @exception IllegalArgumentException if the specified
jaroslav@68: * {@code codePoint} is an invalid Unicode code point.
jaroslav@68: * @see Character#isValidCodePoint(int)
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static UnicodeBlock of(int codePoint) {
jaroslav@68: if (!isValidCodePoint(codePoint)) {
jaroslav@68: throw new IllegalArgumentException();
jaroslav@68: }
jaroslav@68:
jaroslav@68: int top, bottom, current;
jaroslav@68: bottom = 0;
jaroslav@68: top = blockStarts.length;
jaroslav@68: current = top/2;
jaroslav@68:
jaroslav@68: // invariant: top > current >= bottom && codePoint >= unicodeBlockStarts[bottom]
jaroslav@68: while (top - bottom > 1) {
jaroslav@68: if (codePoint >= blockStarts[current]) {
jaroslav@68: bottom = current;
jaroslav@68: } else {
jaroslav@68: top = current;
jaroslav@68: }
jaroslav@68: current = (top + bottom) / 2;
jaroslav@68: }
jaroslav@68: return blocks[current];
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Returns the UnicodeBlock with the given name. Block
jaroslav@68: * names are determined by The Unicode Standard. The file
jaroslav@68: * Blocks-<version>.txt defines blocks for a particular
jaroslav@68: * version of the standard. The {@link Character} class specifies
jaroslav@68: * the version of the standard that it supports.
jaroslav@68: *
jaroslav@68: * This method accepts block names in the following forms:
jaroslav@68: *
jaroslav@68: * If the Unicode Standard changes block names, both the previous and
jaroslav@68: * current names will be accepted.
jaroslav@68: *
jaroslav@68: * @param blockName A {@code UnicodeBlock} name.
jaroslav@68: * @return The {@code UnicodeBlock} instance identified
jaroslav@68: * by {@code blockName}
jaroslav@68: * @throws IllegalArgumentException if {@code blockName} is an
jaroslav@68: * invalid name
jaroslav@68: * @throws NullPointerException if {@code blockName} is null
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static final UnicodeBlock forName(String blockName) {
jaroslav@68: UnicodeBlock block = map.get(blockName.toUpperCase(Locale.US));
jaroslav@68: if (block == null) {
jaroslav@68: throw new IllegalArgumentException();
jaroslav@68: }
jaroslav@68: return block;
jaroslav@68: }
jaroslav@68: }
jaroslav@68:
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * A family of character subsets representing the character scripts
jaroslav@68: * defined in the
jaroslav@68: * Unicode Standard Annex #24: Script Names. Every Unicode
jaroslav@68: * character is assigned to a single Unicode script, either a specific
jaroslav@68: * script, such as {@link Character.UnicodeScript#LATIN Latin}, or
jaroslav@68: * one of the following three special values,
jaroslav@68: * {@link Character.UnicodeScript#INHERITED Inherited},
jaroslav@68: * {@link Character.UnicodeScript#COMMON Common} or
jaroslav@68: * {@link Character.UnicodeScript#UNKNOWN Unknown}.
jaroslav@68: *
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static enum UnicodeScript {
jaroslav@68: /**
jaroslav@68: * Unicode script "Common".
jaroslav@68: */
jaroslav@68: COMMON,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Latin".
jaroslav@68: */
jaroslav@68: LATIN,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Greek".
jaroslav@68: */
jaroslav@68: GREEK,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Cyrillic".
jaroslav@68: */
jaroslav@68: CYRILLIC,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Armenian".
jaroslav@68: */
jaroslav@68: ARMENIAN,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Hebrew".
jaroslav@68: */
jaroslav@68: HEBREW,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Arabic".
jaroslav@68: */
jaroslav@68: ARABIC,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Syriac".
jaroslav@68: */
jaroslav@68: SYRIAC,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Thaana".
jaroslav@68: */
jaroslav@68: THAANA,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Devanagari".
jaroslav@68: */
jaroslav@68: DEVANAGARI,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Bengali".
jaroslav@68: */
jaroslav@68: BENGALI,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Gurmukhi".
jaroslav@68: */
jaroslav@68: GURMUKHI,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Gujarati".
jaroslav@68: */
jaroslav@68: GUJARATI,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Oriya".
jaroslav@68: */
jaroslav@68: ORIYA,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Tamil".
jaroslav@68: */
jaroslav@68: TAMIL,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Telugu".
jaroslav@68: */
jaroslav@68: TELUGU,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Kannada".
jaroslav@68: */
jaroslav@68: KANNADA,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Malayalam".
jaroslav@68: */
jaroslav@68: MALAYALAM,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Sinhala".
jaroslav@68: */
jaroslav@68: SINHALA,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Thai".
jaroslav@68: */
jaroslav@68: THAI,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Lao".
jaroslav@68: */
jaroslav@68: LAO,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Tibetan".
jaroslav@68: */
jaroslav@68: TIBETAN,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Myanmar".
jaroslav@68: */
jaroslav@68: MYANMAR,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Georgian".
jaroslav@68: */
jaroslav@68: GEORGIAN,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Hangul".
jaroslav@68: */
jaroslav@68: HANGUL,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Ethiopic".
jaroslav@68: */
jaroslav@68: ETHIOPIC,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Cherokee".
jaroslav@68: */
jaroslav@68: CHEROKEE,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Canadian_Aboriginal".
jaroslav@68: */
jaroslav@68: CANADIAN_ABORIGINAL,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Ogham".
jaroslav@68: */
jaroslav@68: OGHAM,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Runic".
jaroslav@68: */
jaroslav@68: RUNIC,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Khmer".
jaroslav@68: */
jaroslav@68: KHMER,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Mongolian".
jaroslav@68: */
jaroslav@68: MONGOLIAN,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Hiragana".
jaroslav@68: */
jaroslav@68: HIRAGANA,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Katakana".
jaroslav@68: */
jaroslav@68: KATAKANA,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Bopomofo".
jaroslav@68: */
jaroslav@68: BOPOMOFO,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Han".
jaroslav@68: */
jaroslav@68: HAN,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Yi".
jaroslav@68: */
jaroslav@68: YI,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Old_Italic".
jaroslav@68: */
jaroslav@68: OLD_ITALIC,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Gothic".
jaroslav@68: */
jaroslav@68: GOTHIC,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Deseret".
jaroslav@68: */
jaroslav@68: DESERET,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Inherited".
jaroslav@68: */
jaroslav@68: INHERITED,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Tagalog".
jaroslav@68: */
jaroslav@68: TAGALOG,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Hanunoo".
jaroslav@68: */
jaroslav@68: HANUNOO,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Buhid".
jaroslav@68: */
jaroslav@68: BUHID,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Tagbanwa".
jaroslav@68: */
jaroslav@68: TAGBANWA,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Limbu".
jaroslav@68: */
jaroslav@68: LIMBU,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Tai_Le".
jaroslav@68: */
jaroslav@68: TAI_LE,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Linear_B".
jaroslav@68: */
jaroslav@68: LINEAR_B,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Ugaritic".
jaroslav@68: */
jaroslav@68: UGARITIC,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Shavian".
jaroslav@68: */
jaroslav@68: SHAVIAN,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Osmanya".
jaroslav@68: */
jaroslav@68: OSMANYA,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Cypriot".
jaroslav@68: */
jaroslav@68: CYPRIOT,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Braille".
jaroslav@68: */
jaroslav@68: BRAILLE,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Buginese".
jaroslav@68: */
jaroslav@68: BUGINESE,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Coptic".
jaroslav@68: */
jaroslav@68: COPTIC,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "New_Tai_Lue".
jaroslav@68: */
jaroslav@68: NEW_TAI_LUE,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Glagolitic".
jaroslav@68: */
jaroslav@68: GLAGOLITIC,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Tifinagh".
jaroslav@68: */
jaroslav@68: TIFINAGH,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Syloti_Nagri".
jaroslav@68: */
jaroslav@68: SYLOTI_NAGRI,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Old_Persian".
jaroslav@68: */
jaroslav@68: OLD_PERSIAN,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Kharoshthi".
jaroslav@68: */
jaroslav@68: KHAROSHTHI,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Balinese".
jaroslav@68: */
jaroslav@68: BALINESE,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Cuneiform".
jaroslav@68: */
jaroslav@68: CUNEIFORM,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Phoenician".
jaroslav@68: */
jaroslav@68: PHOENICIAN,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Phags_Pa".
jaroslav@68: */
jaroslav@68: PHAGS_PA,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Nko".
jaroslav@68: */
jaroslav@68: NKO,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Sundanese".
jaroslav@68: */
jaroslav@68: SUNDANESE,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Batak".
jaroslav@68: */
jaroslav@68: BATAK,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Lepcha".
jaroslav@68: */
jaroslav@68: LEPCHA,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Ol_Chiki".
jaroslav@68: */
jaroslav@68: OL_CHIKI,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Vai".
jaroslav@68: */
jaroslav@68: VAI,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Saurashtra".
jaroslav@68: */
jaroslav@68: SAURASHTRA,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Kayah_Li".
jaroslav@68: */
jaroslav@68: KAYAH_LI,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Rejang".
jaroslav@68: */
jaroslav@68: REJANG,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Lycian".
jaroslav@68: */
jaroslav@68: LYCIAN,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Carian".
jaroslav@68: */
jaroslav@68: CARIAN,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Lydian".
jaroslav@68: */
jaroslav@68: LYDIAN,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Cham".
jaroslav@68: */
jaroslav@68: CHAM,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Tai_Tham".
jaroslav@68: */
jaroslav@68: TAI_THAM,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Tai_Viet".
jaroslav@68: */
jaroslav@68: TAI_VIET,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Avestan".
jaroslav@68: */
jaroslav@68: AVESTAN,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Egyptian_Hieroglyphs".
jaroslav@68: */
jaroslav@68: EGYPTIAN_HIEROGLYPHS,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Samaritan".
jaroslav@68: */
jaroslav@68: SAMARITAN,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Mandaic".
jaroslav@68: */
jaroslav@68: MANDAIC,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Lisu".
jaroslav@68: */
jaroslav@68: LISU,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Bamum".
jaroslav@68: */
jaroslav@68: BAMUM,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Javanese".
jaroslav@68: */
jaroslav@68: JAVANESE,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Meetei_Mayek".
jaroslav@68: */
jaroslav@68: MEETEI_MAYEK,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Imperial_Aramaic".
jaroslav@68: */
jaroslav@68: IMPERIAL_ARAMAIC,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Old_South_Arabian".
jaroslav@68: */
jaroslav@68: OLD_SOUTH_ARABIAN,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Inscriptional_Parthian".
jaroslav@68: */
jaroslav@68: INSCRIPTIONAL_PARTHIAN,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Inscriptional_Pahlavi".
jaroslav@68: */
jaroslav@68: INSCRIPTIONAL_PAHLAVI,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Old_Turkic".
jaroslav@68: */
jaroslav@68: OLD_TURKIC,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Brahmi".
jaroslav@68: */
jaroslav@68: BRAHMI,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Kaithi".
jaroslav@68: */
jaroslav@68: KAITHI,
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Unicode script "Unknown".
jaroslav@68: */
jaroslav@68: UNKNOWN;
jaroslav@68:
jaroslav@68: private static final int[] scriptStarts = {
jaroslav@68: 0x0000, // 0000..0040; COMMON
jaroslav@68: 0x0041, // 0041..005A; LATIN
jaroslav@68: 0x005B, // 005B..0060; COMMON
jaroslav@68: 0x0061, // 0061..007A; LATIN
jaroslav@68: 0x007B, // 007B..00A9; COMMON
jaroslav@68: 0x00AA, // 00AA..00AA; LATIN
jaroslav@68: 0x00AB, // 00AB..00B9; COMMON
jaroslav@68: 0x00BA, // 00BA..00BA; LATIN
jaroslav@68: 0x00BB, // 00BB..00BF; COMMON
jaroslav@68: 0x00C0, // 00C0..00D6; LATIN
jaroslav@68: 0x00D7, // 00D7..00D7; COMMON
jaroslav@68: 0x00D8, // 00D8..00F6; LATIN
jaroslav@68: 0x00F7, // 00F7..00F7; COMMON
jaroslav@68: 0x00F8, // 00F8..02B8; LATIN
jaroslav@68: 0x02B9, // 02B9..02DF; COMMON
jaroslav@68: 0x02E0, // 02E0..02E4; LATIN
jaroslav@68: 0x02E5, // 02E5..02E9; COMMON
jaroslav@68: 0x02EA, // 02EA..02EB; BOPOMOFO
jaroslav@68: 0x02EC, // 02EC..02FF; COMMON
jaroslav@68: 0x0300, // 0300..036F; INHERITED
jaroslav@68: 0x0370, // 0370..0373; GREEK
jaroslav@68: 0x0374, // 0374..0374; COMMON
jaroslav@68: 0x0375, // 0375..037D; GREEK
jaroslav@68: 0x037E, // 037E..0383; COMMON
jaroslav@68: 0x0384, // 0384..0384; GREEK
jaroslav@68: 0x0385, // 0385..0385; COMMON
jaroslav@68: 0x0386, // 0386..0386; GREEK
jaroslav@68: 0x0387, // 0387..0387; COMMON
jaroslav@68: 0x0388, // 0388..03E1; GREEK
jaroslav@68: 0x03E2, // 03E2..03EF; COPTIC
jaroslav@68: 0x03F0, // 03F0..03FF; GREEK
jaroslav@68: 0x0400, // 0400..0484; CYRILLIC
jaroslav@68: 0x0485, // 0485..0486; INHERITED
jaroslav@68: 0x0487, // 0487..0530; CYRILLIC
jaroslav@68: 0x0531, // 0531..0588; ARMENIAN
jaroslav@68: 0x0589, // 0589..0589; COMMON
jaroslav@68: 0x058A, // 058A..0590; ARMENIAN
jaroslav@68: 0x0591, // 0591..05FF; HEBREW
jaroslav@68: 0x0600, // 0600..060B; ARABIC
jaroslav@68: 0x060C, // 060C..060C; COMMON
jaroslav@68: 0x060D, // 060D..061A; ARABIC
jaroslav@68: 0x061B, // 061B..061D; COMMON
jaroslav@68: 0x061E, // 061E..061E; ARABIC
jaroslav@68: 0x061F, // 061F..061F; COMMON
jaroslav@68: 0x0620, // 0620..063F; ARABIC
jaroslav@68: 0x0640, // 0640..0640; COMMON
jaroslav@68: 0x0641, // 0641..064A; ARABIC
jaroslav@68: 0x064B, // 064B..0655; INHERITED
jaroslav@68: 0x0656, // 0656..065E; ARABIC
jaroslav@68: 0x065F, // 065F..065F; INHERITED
jaroslav@68: 0x0660, // 0660..0669; COMMON
jaroslav@68: 0x066A, // 066A..066F; ARABIC
jaroslav@68: 0x0670, // 0670..0670; INHERITED
jaroslav@68: 0x0671, // 0671..06DC; ARABIC
jaroslav@68: 0x06DD, // 06DD..06DD; COMMON
jaroslav@68: 0x06DE, // 06DE..06FF; ARABIC
jaroslav@68: 0x0700, // 0700..074F; SYRIAC
jaroslav@68: 0x0750, // 0750..077F; ARABIC
jaroslav@68: 0x0780, // 0780..07BF; THAANA
jaroslav@68: 0x07C0, // 07C0..07FF; NKO
jaroslav@68: 0x0800, // 0800..083F; SAMARITAN
jaroslav@68: 0x0840, // 0840..08FF; MANDAIC
jaroslav@68: 0x0900, // 0900..0950; DEVANAGARI
jaroslav@68: 0x0951, // 0951..0952; INHERITED
jaroslav@68: 0x0953, // 0953..0963; DEVANAGARI
jaroslav@68: 0x0964, // 0964..0965; COMMON
jaroslav@68: 0x0966, // 0966..096F; DEVANAGARI
jaroslav@68: 0x0970, // 0970..0970; COMMON
jaroslav@68: 0x0971, // 0971..0980; DEVANAGARI
jaroslav@68: 0x0981, // 0981..0A00; BENGALI
jaroslav@68: 0x0A01, // 0A01..0A80; GURMUKHI
jaroslav@68: 0x0A81, // 0A81..0B00; GUJARATI
jaroslav@68: 0x0B01, // 0B01..0B81; ORIYA
jaroslav@68: 0x0B82, // 0B82..0C00; TAMIL
jaroslav@68: 0x0C01, // 0C01..0C81; TELUGU
jaroslav@68: 0x0C82, // 0C82..0CF0; KANNADA
jaroslav@68: 0x0D02, // 0D02..0D81; MALAYALAM
jaroslav@68: 0x0D82, // 0D82..0E00; SINHALA
jaroslav@68: 0x0E01, // 0E01..0E3E; THAI
jaroslav@68: 0x0E3F, // 0E3F..0E3F; COMMON
jaroslav@68: 0x0E40, // 0E40..0E80; THAI
jaroslav@68: 0x0E81, // 0E81..0EFF; LAO
jaroslav@68: 0x0F00, // 0F00..0FD4; TIBETAN
jaroslav@68: 0x0FD5, // 0FD5..0FD8; COMMON
jaroslav@68: 0x0FD9, // 0FD9..0FFF; TIBETAN
jaroslav@68: 0x1000, // 1000..109F; MYANMAR
jaroslav@68: 0x10A0, // 10A0..10FA; GEORGIAN
jaroslav@68: 0x10FB, // 10FB..10FB; COMMON
jaroslav@68: 0x10FC, // 10FC..10FF; GEORGIAN
jaroslav@68: 0x1100, // 1100..11FF; HANGUL
jaroslav@68: 0x1200, // 1200..139F; ETHIOPIC
jaroslav@68: 0x13A0, // 13A0..13FF; CHEROKEE
jaroslav@68: 0x1400, // 1400..167F; CANADIAN_ABORIGINAL
jaroslav@68: 0x1680, // 1680..169F; OGHAM
jaroslav@68: 0x16A0, // 16A0..16EA; RUNIC
jaroslav@68: 0x16EB, // 16EB..16ED; COMMON
jaroslav@68: 0x16EE, // 16EE..16FF; RUNIC
jaroslav@68: 0x1700, // 1700..171F; TAGALOG
jaroslav@68: 0x1720, // 1720..1734; HANUNOO
jaroslav@68: 0x1735, // 1735..173F; COMMON
jaroslav@68: 0x1740, // 1740..175F; BUHID
jaroslav@68: 0x1760, // 1760..177F; TAGBANWA
jaroslav@68: 0x1780, // 1780..17FF; KHMER
jaroslav@68: 0x1800, // 1800..1801; MONGOLIAN
jaroslav@68: 0x1802, // 1802..1803; COMMON
jaroslav@68: 0x1804, // 1804..1804; MONGOLIAN
jaroslav@68: 0x1805, // 1805..1805; COMMON
jaroslav@68: 0x1806, // 1806..18AF; MONGOLIAN
jaroslav@68: 0x18B0, // 18B0..18FF; CANADIAN_ABORIGINAL
jaroslav@68: 0x1900, // 1900..194F; LIMBU
jaroslav@68: 0x1950, // 1950..197F; TAI_LE
jaroslav@68: 0x1980, // 1980..19DF; NEW_TAI_LUE
jaroslav@68: 0x19E0, // 19E0..19FF; KHMER
jaroslav@68: 0x1A00, // 1A00..1A1F; BUGINESE
jaroslav@68: 0x1A20, // 1A20..1AFF; TAI_THAM
jaroslav@68: 0x1B00, // 1B00..1B7F; BALINESE
jaroslav@68: 0x1B80, // 1B80..1BBF; SUNDANESE
jaroslav@68: 0x1BC0, // 1BC0..1BFF; BATAK
jaroslav@68: 0x1C00, // 1C00..1C4F; LEPCHA
jaroslav@68: 0x1C50, // 1C50..1CCF; OL_CHIKI
jaroslav@68: 0x1CD0, // 1CD0..1CD2; INHERITED
jaroslav@68: 0x1CD3, // 1CD3..1CD3; COMMON
jaroslav@68: 0x1CD4, // 1CD4..1CE0; INHERITED
jaroslav@68: 0x1CE1, // 1CE1..1CE1; COMMON
jaroslav@68: 0x1CE2, // 1CE2..1CE8; INHERITED
jaroslav@68: 0x1CE9, // 1CE9..1CEC; COMMON
jaroslav@68: 0x1CED, // 1CED..1CED; INHERITED
jaroslav@68: 0x1CEE, // 1CEE..1CFF; COMMON
jaroslav@68: 0x1D00, // 1D00..1D25; LATIN
jaroslav@68: 0x1D26, // 1D26..1D2A; GREEK
jaroslav@68: 0x1D2B, // 1D2B..1D2B; CYRILLIC
jaroslav@68: 0x1D2C, // 1D2C..1D5C; LATIN
jaroslav@68: 0x1D5D, // 1D5D..1D61; GREEK
jaroslav@68: 0x1D62, // 1D62..1D65; LATIN
jaroslav@68: 0x1D66, // 1D66..1D6A; GREEK
jaroslav@68: 0x1D6B, // 1D6B..1D77; LATIN
jaroslav@68: 0x1D78, // 1D78..1D78; CYRILLIC
jaroslav@68: 0x1D79, // 1D79..1DBE; LATIN
jaroslav@68: 0x1DBF, // 1DBF..1DBF; GREEK
jaroslav@68: 0x1DC0, // 1DC0..1DFF; INHERITED
jaroslav@68: 0x1E00, // 1E00..1EFF; LATIN
jaroslav@68: 0x1F00, // 1F00..1FFF; GREEK
jaroslav@68: 0x2000, // 2000..200B; COMMON
jaroslav@68: 0x200C, // 200C..200D; INHERITED
jaroslav@68: 0x200E, // 200E..2070; COMMON
jaroslav@68: 0x2071, // 2071..2073; LATIN
jaroslav@68: 0x2074, // 2074..207E; COMMON
jaroslav@68: 0x207F, // 207F..207F; LATIN
jaroslav@68: 0x2080, // 2080..208F; COMMON
jaroslav@68: 0x2090, // 2090..209F; LATIN
jaroslav@68: 0x20A0, // 20A0..20CF; COMMON
jaroslav@68: 0x20D0, // 20D0..20FF; INHERITED
jaroslav@68: 0x2100, // 2100..2125; COMMON
jaroslav@68: 0x2126, // 2126..2126; GREEK
jaroslav@68: 0x2127, // 2127..2129; COMMON
jaroslav@68: 0x212A, // 212A..212B; LATIN
jaroslav@68: 0x212C, // 212C..2131; COMMON
jaroslav@68: 0x2132, // 2132..2132; LATIN
jaroslav@68: 0x2133, // 2133..214D; COMMON
jaroslav@68: 0x214E, // 214E..214E; LATIN
jaroslav@68: 0x214F, // 214F..215F; COMMON
jaroslav@68: 0x2160, // 2160..2188; LATIN
jaroslav@68: 0x2189, // 2189..27FF; COMMON
jaroslav@68: 0x2800, // 2800..28FF; BRAILLE
jaroslav@68: 0x2900, // 2900..2BFF; COMMON
jaroslav@68: 0x2C00, // 2C00..2C5F; GLAGOLITIC
jaroslav@68: 0x2C60, // 2C60..2C7F; LATIN
jaroslav@68: 0x2C80, // 2C80..2CFF; COPTIC
jaroslav@68: 0x2D00, // 2D00..2D2F; GEORGIAN
jaroslav@68: 0x2D30, // 2D30..2D7F; TIFINAGH
jaroslav@68: 0x2D80, // 2D80..2DDF; ETHIOPIC
jaroslav@68: 0x2DE0, // 2DE0..2DFF; CYRILLIC
jaroslav@68: 0x2E00, // 2E00..2E7F; COMMON
jaroslav@68: 0x2E80, // 2E80..2FEF; HAN
jaroslav@68: 0x2FF0, // 2FF0..3004; COMMON
jaroslav@68: 0x3005, // 3005..3005; HAN
jaroslav@68: 0x3006, // 3006..3006; COMMON
jaroslav@68: 0x3007, // 3007..3007; HAN
jaroslav@68: 0x3008, // 3008..3020; COMMON
jaroslav@68: 0x3021, // 3021..3029; HAN
jaroslav@68: 0x302A, // 302A..302D; INHERITED
jaroslav@68: 0x302E, // 302E..302F; HANGUL
jaroslav@68: 0x3030, // 3030..3037; COMMON
jaroslav@68: 0x3038, // 3038..303B; HAN
jaroslav@68: 0x303C, // 303C..3040; COMMON
jaroslav@68: 0x3041, // 3041..3098; HIRAGANA
jaroslav@68: 0x3099, // 3099..309A; INHERITED
jaroslav@68: 0x309B, // 309B..309C; COMMON
jaroslav@68: 0x309D, // 309D..309F; HIRAGANA
jaroslav@68: 0x30A0, // 30A0..30A0; COMMON
jaroslav@68: 0x30A1, // 30A1..30FA; KATAKANA
jaroslav@68: 0x30FB, // 30FB..30FC; COMMON
jaroslav@68: 0x30FD, // 30FD..3104; KATAKANA
jaroslav@68: 0x3105, // 3105..3130; BOPOMOFO
jaroslav@68: 0x3131, // 3131..318F; HANGUL
jaroslav@68: 0x3190, // 3190..319F; COMMON
jaroslav@68: 0x31A0, // 31A0..31BF; BOPOMOFO
jaroslav@68: 0x31C0, // 31C0..31EF; COMMON
jaroslav@68: 0x31F0, // 31F0..31FF; KATAKANA
jaroslav@68: 0x3200, // 3200..321F; HANGUL
jaroslav@68: 0x3220, // 3220..325F; COMMON
jaroslav@68: 0x3260, // 3260..327E; HANGUL
jaroslav@68: 0x327F, // 327F..32CF; COMMON
jaroslav@68: 0x32D0, // 32D0..3357; KATAKANA
jaroslav@68: 0x3358, // 3358..33FF; COMMON
jaroslav@68: 0x3400, // 3400..4DBF; HAN
jaroslav@68: 0x4DC0, // 4DC0..4DFF; COMMON
jaroslav@68: 0x4E00, // 4E00..9FFF; HAN
jaroslav@68: 0xA000, // A000..A4CF; YI
jaroslav@68: 0xA4D0, // A4D0..A4FF; LISU
jaroslav@68: 0xA500, // A500..A63F; VAI
jaroslav@68: 0xA640, // A640..A69F; CYRILLIC
jaroslav@68: 0xA6A0, // A6A0..A6FF; BAMUM
jaroslav@68: 0xA700, // A700..A721; COMMON
jaroslav@68: 0xA722, // A722..A787; LATIN
jaroslav@68: 0xA788, // A788..A78A; COMMON
jaroslav@68: 0xA78B, // A78B..A7FF; LATIN
jaroslav@68: 0xA800, // A800..A82F; SYLOTI_NAGRI
jaroslav@68: 0xA830, // A830..A83F; COMMON
jaroslav@68: 0xA840, // A840..A87F; PHAGS_PA
jaroslav@68: 0xA880, // A880..A8DF; SAURASHTRA
jaroslav@68: 0xA8E0, // A8E0..A8FF; DEVANAGARI
jaroslav@68: 0xA900, // A900..A92F; KAYAH_LI
jaroslav@68: 0xA930, // A930..A95F; REJANG
jaroslav@68: 0xA960, // A960..A97F; HANGUL
jaroslav@68: 0xA980, // A980..A9FF; JAVANESE
jaroslav@68: 0xAA00, // AA00..AA5F; CHAM
jaroslav@68: 0xAA60, // AA60..AA7F; MYANMAR
jaroslav@68: 0xAA80, // AA80..AB00; TAI_VIET
jaroslav@68: 0xAB01, // AB01..ABBF; ETHIOPIC
jaroslav@68: 0xABC0, // ABC0..ABFF; MEETEI_MAYEK
jaroslav@68: 0xAC00, // AC00..D7FB; HANGUL
jaroslav@68: 0xD7FC, // D7FC..F8FF; UNKNOWN
jaroslav@68: 0xF900, // F900..FAFF; HAN
jaroslav@68: 0xFB00, // FB00..FB12; LATIN
jaroslav@68: 0xFB13, // FB13..FB1C; ARMENIAN
jaroslav@68: 0xFB1D, // FB1D..FB4F; HEBREW
jaroslav@68: 0xFB50, // FB50..FD3D; ARABIC
jaroslav@68: 0xFD3E, // FD3E..FD4F; COMMON
jaroslav@68: 0xFD50, // FD50..FDFC; ARABIC
jaroslav@68: 0xFDFD, // FDFD..FDFF; COMMON
jaroslav@68: 0xFE00, // FE00..FE0F; INHERITED
jaroslav@68: 0xFE10, // FE10..FE1F; COMMON
jaroslav@68: 0xFE20, // FE20..FE2F; INHERITED
jaroslav@68: 0xFE30, // FE30..FE6F; COMMON
jaroslav@68: 0xFE70, // FE70..FEFE; ARABIC
jaroslav@68: 0xFEFF, // FEFF..FF20; COMMON
jaroslav@68: 0xFF21, // FF21..FF3A; LATIN
jaroslav@68: 0xFF3B, // FF3B..FF40; COMMON
jaroslav@68: 0xFF41, // FF41..FF5A; LATIN
jaroslav@68: 0xFF5B, // FF5B..FF65; COMMON
jaroslav@68: 0xFF66, // FF66..FF6F; KATAKANA
jaroslav@68: 0xFF70, // FF70..FF70; COMMON
jaroslav@68: 0xFF71, // FF71..FF9D; KATAKANA
jaroslav@68: 0xFF9E, // FF9E..FF9F; COMMON
jaroslav@68: 0xFFA0, // FFA0..FFDF; HANGUL
jaroslav@68: 0xFFE0, // FFE0..FFFF; COMMON
jaroslav@68: 0x10000, // 10000..100FF; LINEAR_B
jaroslav@68: 0x10100, // 10100..1013F; COMMON
jaroslav@68: 0x10140, // 10140..1018F; GREEK
jaroslav@68: 0x10190, // 10190..101FC; COMMON
jaroslav@68: 0x101FD, // 101FD..1027F; INHERITED
jaroslav@68: 0x10280, // 10280..1029F; LYCIAN
jaroslav@68: 0x102A0, // 102A0..102FF; CARIAN
jaroslav@68: 0x10300, // 10300..1032F; OLD_ITALIC
jaroslav@68: 0x10330, // 10330..1037F; GOTHIC
jaroslav@68: 0x10380, // 10380..1039F; UGARITIC
jaroslav@68: 0x103A0, // 103A0..103FF; OLD_PERSIAN
jaroslav@68: 0x10400, // 10400..1044F; DESERET
jaroslav@68: 0x10450, // 10450..1047F; SHAVIAN
jaroslav@68: 0x10480, // 10480..107FF; OSMANYA
jaroslav@68: 0x10800, // 10800..1083F; CYPRIOT
jaroslav@68: 0x10840, // 10840..108FF; IMPERIAL_ARAMAIC
jaroslav@68: 0x10900, // 10900..1091F; PHOENICIAN
jaroslav@68: 0x10920, // 10920..109FF; LYDIAN
jaroslav@68: 0x10A00, // 10A00..10A5F; KHAROSHTHI
jaroslav@68: 0x10A60, // 10A60..10AFF; OLD_SOUTH_ARABIAN
jaroslav@68: 0x10B00, // 10B00..10B3F; AVESTAN
jaroslav@68: 0x10B40, // 10B40..10B5F; INSCRIPTIONAL_PARTHIAN
jaroslav@68: 0x10B60, // 10B60..10BFF; INSCRIPTIONAL_PAHLAVI
jaroslav@68: 0x10C00, // 10C00..10E5F; OLD_TURKIC
jaroslav@68: 0x10E60, // 10E60..10FFF; ARABIC
jaroslav@68: 0x11000, // 11000..1107F; BRAHMI
jaroslav@68: 0x11080, // 11080..11FFF; KAITHI
jaroslav@68: 0x12000, // 12000..12FFF; CUNEIFORM
jaroslav@68: 0x13000, // 13000..167FF; EGYPTIAN_HIEROGLYPHS
jaroslav@68: 0x16800, // 16800..16A38; BAMUM
jaroslav@68: 0x1B000, // 1B000..1B000; KATAKANA
jaroslav@68: 0x1B001, // 1B001..1CFFF; HIRAGANA
jaroslav@68: 0x1D000, // 1D000..1D166; COMMON
jaroslav@68: 0x1D167, // 1D167..1D169; INHERITED
jaroslav@68: 0x1D16A, // 1D16A..1D17A; COMMON
jaroslav@68: 0x1D17B, // 1D17B..1D182; INHERITED
jaroslav@68: 0x1D183, // 1D183..1D184; COMMON
jaroslav@68: 0x1D185, // 1D185..1D18B; INHERITED
jaroslav@68: 0x1D18C, // 1D18C..1D1A9; COMMON
jaroslav@68: 0x1D1AA, // 1D1AA..1D1AD; INHERITED
jaroslav@68: 0x1D1AE, // 1D1AE..1D1FF; COMMON
jaroslav@68: 0x1D200, // 1D200..1D2FF; GREEK
jaroslav@68: 0x1D300, // 1D300..1F1FF; COMMON
jaroslav@68: 0x1F200, // 1F200..1F200; HIRAGANA
jaroslav@68: 0x1F201, // 1F210..1FFFF; COMMON
jaroslav@68: 0x20000, // 20000..E0000; HAN
jaroslav@68: 0xE0001, // E0001..E00FF; COMMON
jaroslav@68: 0xE0100, // E0100..E01EF; INHERITED
jaroslav@68: 0xE01F0 // E01F0..10FFFF; UNKNOWN
jaroslav@68:
jaroslav@68: };
jaroslav@68:
jaroslav@68: private static final UnicodeScript[] scripts = {
jaroslav@68: COMMON,
jaroslav@68: LATIN,
jaroslav@68: COMMON,
jaroslav@68: LATIN,
jaroslav@68: COMMON,
jaroslav@68: LATIN,
jaroslav@68: COMMON,
jaroslav@68: LATIN,
jaroslav@68: COMMON,
jaroslav@68: LATIN,
jaroslav@68: COMMON,
jaroslav@68: LATIN,
jaroslav@68: COMMON,
jaroslav@68: LATIN,
jaroslav@68: COMMON,
jaroslav@68: LATIN,
jaroslav@68: COMMON,
jaroslav@68: BOPOMOFO,
jaroslav@68: COMMON,
jaroslav@68: INHERITED,
jaroslav@68: GREEK,
jaroslav@68: COMMON,
jaroslav@68: GREEK,
jaroslav@68: COMMON,
jaroslav@68: GREEK,
jaroslav@68: COMMON,
jaroslav@68: GREEK,
jaroslav@68: COMMON,
jaroslav@68: GREEK,
jaroslav@68: COPTIC,
jaroslav@68: GREEK,
jaroslav@68: CYRILLIC,
jaroslav@68: INHERITED,
jaroslav@68: CYRILLIC,
jaroslav@68: ARMENIAN,
jaroslav@68: COMMON,
jaroslav@68: ARMENIAN,
jaroslav@68: HEBREW,
jaroslav@68: ARABIC,
jaroslav@68: COMMON,
jaroslav@68: ARABIC,
jaroslav@68: COMMON,
jaroslav@68: ARABIC,
jaroslav@68: COMMON,
jaroslav@68: ARABIC,
jaroslav@68: COMMON,
jaroslav@68: ARABIC,
jaroslav@68: INHERITED,
jaroslav@68: ARABIC,
jaroslav@68: INHERITED,
jaroslav@68: COMMON,
jaroslav@68: ARABIC,
jaroslav@68: INHERITED,
jaroslav@68: ARABIC,
jaroslav@68: COMMON,
jaroslav@68: ARABIC,
jaroslav@68: SYRIAC,
jaroslav@68: ARABIC,
jaroslav@68: THAANA,
jaroslav@68: NKO,
jaroslav@68: SAMARITAN,
jaroslav@68: MANDAIC,
jaroslav@68: DEVANAGARI,
jaroslav@68: INHERITED,
jaroslav@68: DEVANAGARI,
jaroslav@68: COMMON,
jaroslav@68: DEVANAGARI,
jaroslav@68: COMMON,
jaroslav@68: DEVANAGARI,
jaroslav@68: BENGALI,
jaroslav@68: GURMUKHI,
jaroslav@68: GUJARATI,
jaroslav@68: ORIYA,
jaroslav@68: TAMIL,
jaroslav@68: TELUGU,
jaroslav@68: KANNADA,
jaroslav@68: MALAYALAM,
jaroslav@68: SINHALA,
jaroslav@68: THAI,
jaroslav@68: COMMON,
jaroslav@68: THAI,
jaroslav@68: LAO,
jaroslav@68: TIBETAN,
jaroslav@68: COMMON,
jaroslav@68: TIBETAN,
jaroslav@68: MYANMAR,
jaroslav@68: GEORGIAN,
jaroslav@68: COMMON,
jaroslav@68: GEORGIAN,
jaroslav@68: HANGUL,
jaroslav@68: ETHIOPIC,
jaroslav@68: CHEROKEE,
jaroslav@68: CANADIAN_ABORIGINAL,
jaroslav@68: OGHAM,
jaroslav@68: RUNIC,
jaroslav@68: COMMON,
jaroslav@68: RUNIC,
jaroslav@68: TAGALOG,
jaroslav@68: HANUNOO,
jaroslav@68: COMMON,
jaroslav@68: BUHID,
jaroslav@68: TAGBANWA,
jaroslav@68: KHMER,
jaroslav@68: MONGOLIAN,
jaroslav@68: COMMON,
jaroslav@68: MONGOLIAN,
jaroslav@68: COMMON,
jaroslav@68: MONGOLIAN,
jaroslav@68: CANADIAN_ABORIGINAL,
jaroslav@68: LIMBU,
jaroslav@68: TAI_LE,
jaroslav@68: NEW_TAI_LUE,
jaroslav@68: KHMER,
jaroslav@68: BUGINESE,
jaroslav@68: TAI_THAM,
jaroslav@68: BALINESE,
jaroslav@68: SUNDANESE,
jaroslav@68: BATAK,
jaroslav@68: LEPCHA,
jaroslav@68: OL_CHIKI,
jaroslav@68: INHERITED,
jaroslav@68: COMMON,
jaroslav@68: INHERITED,
jaroslav@68: COMMON,
jaroslav@68: INHERITED,
jaroslav@68: COMMON,
jaroslav@68: INHERITED,
jaroslav@68: COMMON,
jaroslav@68: LATIN,
jaroslav@68: GREEK,
jaroslav@68: CYRILLIC,
jaroslav@68: LATIN,
jaroslav@68: GREEK,
jaroslav@68: LATIN,
jaroslav@68: GREEK,
jaroslav@68: LATIN,
jaroslav@68: CYRILLIC,
jaroslav@68: LATIN,
jaroslav@68: GREEK,
jaroslav@68: INHERITED,
jaroslav@68: LATIN,
jaroslav@68: GREEK,
jaroslav@68: COMMON,
jaroslav@68: INHERITED,
jaroslav@68: COMMON,
jaroslav@68: LATIN,
jaroslav@68: COMMON,
jaroslav@68: LATIN,
jaroslav@68: COMMON,
jaroslav@68: LATIN,
jaroslav@68: COMMON,
jaroslav@68: INHERITED,
jaroslav@68: COMMON,
jaroslav@68: GREEK,
jaroslav@68: COMMON,
jaroslav@68: LATIN,
jaroslav@68: COMMON,
jaroslav@68: LATIN,
jaroslav@68: COMMON,
jaroslav@68: LATIN,
jaroslav@68: COMMON,
jaroslav@68: LATIN,
jaroslav@68: COMMON,
jaroslav@68: BRAILLE,
jaroslav@68: COMMON,
jaroslav@68: GLAGOLITIC,
jaroslav@68: LATIN,
jaroslav@68: COPTIC,
jaroslav@68: GEORGIAN,
jaroslav@68: TIFINAGH,
jaroslav@68: ETHIOPIC,
jaroslav@68: CYRILLIC,
jaroslav@68: COMMON,
jaroslav@68: HAN,
jaroslav@68: COMMON,
jaroslav@68: HAN,
jaroslav@68: COMMON,
jaroslav@68: HAN,
jaroslav@68: COMMON,
jaroslav@68: HAN,
jaroslav@68: INHERITED,
jaroslav@68: HANGUL,
jaroslav@68: COMMON,
jaroslav@68: HAN,
jaroslav@68: COMMON,
jaroslav@68: HIRAGANA,
jaroslav@68: INHERITED,
jaroslav@68: COMMON,
jaroslav@68: HIRAGANA,
jaroslav@68: COMMON,
jaroslav@68: KATAKANA,
jaroslav@68: COMMON,
jaroslav@68: KATAKANA,
jaroslav@68: BOPOMOFO,
jaroslav@68: HANGUL,
jaroslav@68: COMMON,
jaroslav@68: BOPOMOFO,
jaroslav@68: COMMON,
jaroslav@68: KATAKANA,
jaroslav@68: HANGUL,
jaroslav@68: COMMON,
jaroslav@68: HANGUL,
jaroslav@68: COMMON,
jaroslav@68: KATAKANA,
jaroslav@68: COMMON,
jaroslav@68: HAN,
jaroslav@68: COMMON,
jaroslav@68: HAN,
jaroslav@68: YI,
jaroslav@68: LISU,
jaroslav@68: VAI,
jaroslav@68: CYRILLIC,
jaroslav@68: BAMUM,
jaroslav@68: COMMON,
jaroslav@68: LATIN,
jaroslav@68: COMMON,
jaroslav@68: LATIN,
jaroslav@68: SYLOTI_NAGRI,
jaroslav@68: COMMON,
jaroslav@68: PHAGS_PA,
jaroslav@68: SAURASHTRA,
jaroslav@68: DEVANAGARI,
jaroslav@68: KAYAH_LI,
jaroslav@68: REJANG,
jaroslav@68: HANGUL,
jaroslav@68: JAVANESE,
jaroslav@68: CHAM,
jaroslav@68: MYANMAR,
jaroslav@68: TAI_VIET,
jaroslav@68: ETHIOPIC,
jaroslav@68: MEETEI_MAYEK,
jaroslav@68: HANGUL,
jaroslav@68: UNKNOWN,
jaroslav@68: HAN,
jaroslav@68: LATIN,
jaroslav@68: ARMENIAN,
jaroslav@68: HEBREW,
jaroslav@68: ARABIC,
jaroslav@68: COMMON,
jaroslav@68: ARABIC,
jaroslav@68: COMMON,
jaroslav@68: INHERITED,
jaroslav@68: COMMON,
jaroslav@68: INHERITED,
jaroslav@68: COMMON,
jaroslav@68: ARABIC,
jaroslav@68: COMMON,
jaroslav@68: LATIN,
jaroslav@68: COMMON,
jaroslav@68: LATIN,
jaroslav@68: COMMON,
jaroslav@68: KATAKANA,
jaroslav@68: COMMON,
jaroslav@68: KATAKANA,
jaroslav@68: COMMON,
jaroslav@68: HANGUL,
jaroslav@68: COMMON,
jaroslav@68: LINEAR_B,
jaroslav@68: COMMON,
jaroslav@68: GREEK,
jaroslav@68: COMMON,
jaroslav@68: INHERITED,
jaroslav@68: LYCIAN,
jaroslav@68: CARIAN,
jaroslav@68: OLD_ITALIC,
jaroslav@68: GOTHIC,
jaroslav@68: UGARITIC,
jaroslav@68: OLD_PERSIAN,
jaroslav@68: DESERET,
jaroslav@68: SHAVIAN,
jaroslav@68: OSMANYA,
jaroslav@68: CYPRIOT,
jaroslav@68: IMPERIAL_ARAMAIC,
jaroslav@68: PHOENICIAN,
jaroslav@68: LYDIAN,
jaroslav@68: KHAROSHTHI,
jaroslav@68: OLD_SOUTH_ARABIAN,
jaroslav@68: AVESTAN,
jaroslav@68: INSCRIPTIONAL_PARTHIAN,
jaroslav@68: INSCRIPTIONAL_PAHLAVI,
jaroslav@68: OLD_TURKIC,
jaroslav@68: ARABIC,
jaroslav@68: BRAHMI,
jaroslav@68: KAITHI,
jaroslav@68: CUNEIFORM,
jaroslav@68: EGYPTIAN_HIEROGLYPHS,
jaroslav@68: BAMUM,
jaroslav@68: KATAKANA,
jaroslav@68: HIRAGANA,
jaroslav@68: COMMON,
jaroslav@68: INHERITED,
jaroslav@68: COMMON,
jaroslav@68: INHERITED,
jaroslav@68: COMMON,
jaroslav@68: INHERITED,
jaroslav@68: COMMON,
jaroslav@68: INHERITED,
jaroslav@68: COMMON,
jaroslav@68: GREEK,
jaroslav@68: COMMON,
jaroslav@68: HIRAGANA,
jaroslav@68: COMMON,
jaroslav@68: HAN,
jaroslav@68: COMMON,
jaroslav@68: INHERITED,
jaroslav@68: UNKNOWN
jaroslav@68: };
jaroslav@68:
jaroslav@68: private static HashMap
jaroslav@68: * Character case is ignored for all of the valid script names.
jaroslav@68: * The en_US locale's case mapping rules are used to provide
jaroslav@68: * case-insensitive string comparisons for script name validation.
jaroslav@68: *
jaroslav@68: *
jaroslav@68: * @param scriptName A {@code UnicodeScript} name.
jaroslav@68: * @return The {@code UnicodeScript} constant identified
jaroslav@68: * by {@code scriptName}
jaroslav@68: * @throws IllegalArgumentException if {@code scriptName} is an
jaroslav@68: * invalid name
jaroslav@68: * @throws NullPointerException if {@code scriptName} is null
jaroslav@68: */
jaroslav@68: public static final UnicodeScript forName(String scriptName) {
jaroslav@68: scriptName = scriptName.toUpperCase(Locale.ENGLISH);
jaroslav@68: //.replace(' ', '_'));
jaroslav@68: UnicodeScript sc = aliases.get(scriptName);
jaroslav@68: if (sc != null)
jaroslav@68: return sc;
jaroslav@68: return valueOf(scriptName);
jaroslav@68: }
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * The value of the {@code Character}.
jaroslav@68: *
jaroslav@68: * @serial
jaroslav@68: */
jaroslav@68: private final char value;
jaroslav@68:
jaroslav@68: /** use serialVersionUID from JDK 1.0.2 for interoperability */
jaroslav@68: private static final long serialVersionUID = 3786198910865385080L;
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Constructs a newly allocated {@code Character} object that
jaroslav@68: * represents the specified {@code char} value.
jaroslav@68: *
jaroslav@68: * @param value the value to be represented by the
jaroslav@68: * {@code Character} object.
jaroslav@68: */
jaroslav@68: public Character(char value) {
jaroslav@68: this.value = value;
jaroslav@68: }
jaroslav@68:
jaroslav@68: private static class CharacterCache {
jaroslav@68: private CharacterCache(){}
jaroslav@68:
jaroslav@68: static final Character cache[] = new Character[127 + 1];
jaroslav@68:
jaroslav@68: static {
jaroslav@68: for (int i = 0; i < cache.length; i++)
jaroslav@68: cache[i] = new Character((char)i);
jaroslav@68: }
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Returns a Character instance representing the specified
jaroslav@68: * char value.
jaroslav@68: * If a new Character instance is not required, this method
jaroslav@68: * should generally be used in preference to the constructor
jaroslav@68: * {@link #Character(char)}, as this method is likely to yield
jaroslav@68: * significantly better space and time performance by caching
jaroslav@68: * frequently requested values.
jaroslav@68: *
jaroslav@68: * This method will always cache values in the range {@code
jaroslav@68: * '\u005Cu0000'} to {@code '\u005Cu007F'}, inclusive, and may
jaroslav@68: * cache other values outside of this range.
jaroslav@68: *
jaroslav@68: * @param c a char value.
jaroslav@68: * @return a Character instance representing c.
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static Character valueOf(char c) {
jaroslav@68: if (c <= 127) { // must cache
jaroslav@68: return CharacterCache.cache[(int)c];
jaroslav@68: }
jaroslav@68: return new Character(c);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Returns the value of this {@code Character} object.
jaroslav@68: * @return the primitive {@code char} value represented by
jaroslav@68: * this object.
jaroslav@68: */
jaroslav@68: public char charValue() {
jaroslav@68: return value;
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Returns a hash code for this {@code Character}; equal to the result
jaroslav@68: * of invoking {@code charValue()}.
jaroslav@68: *
jaroslav@68: * @return a hash code value for this {@code Character}
jaroslav@68: */
jaroslav@68: public int hashCode() {
jaroslav@68: return (int)value;
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Compares this object against the specified object.
jaroslav@68: * The result is {@code true} if and only if the argument is not
jaroslav@68: * {@code null} and is a {@code Character} object that
jaroslav@68: * represents the same {@code char} value as this object.
jaroslav@68: *
jaroslav@68: * @param obj the object to compare with.
jaroslav@68: * @return {@code true} if the objects are the same;
jaroslav@68: * {@code false} otherwise.
jaroslav@68: */
jaroslav@68: public boolean equals(Object obj) {
jaroslav@68: if (obj instanceof Character) {
jaroslav@68: return value == ((Character)obj).charValue();
jaroslav@68: }
jaroslav@68: return false;
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Returns a {@code String} object representing this
jaroslav@68: * {@code Character}'s value. The result is a string of
jaroslav@68: * length 1 whose sole component is the primitive
jaroslav@68: * {@code char} value represented by this
jaroslav@68: * {@code Character} object.
jaroslav@68: *
jaroslav@68: * @return a string representation of this object.
jaroslav@68: */
jaroslav@68: public String toString() {
jaroslav@68: char buf[] = {value};
jaroslav@68: return String.valueOf(buf);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Returns a {@code String} object representing the
jaroslav@68: * specified {@code char}. The result is a string of length
jaroslav@68: * 1 consisting solely of the specified {@code char}.
jaroslav@68: *
jaroslav@68: * @param c the {@code char} to be converted
jaroslav@68: * @return the string representation of the specified {@code char}
jaroslav@68: * @since 1.4
jaroslav@68: */
jaroslav@68: public static String toString(char c) {
jaroslav@68: return String.valueOf(c);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Determines whether the specified code point is a valid
jaroslav@68: *
jaroslav@68: * Unicode code point value.
jaroslav@68: *
jaroslav@68: * @param codePoint the Unicode code point to be tested
jaroslav@68: * @return {@code true} if the specified code point value is between
jaroslav@68: * {@link #MIN_CODE_POINT} and
jaroslav@68: * {@link #MAX_CODE_POINT} inclusive;
jaroslav@68: * {@code false} otherwise.
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static boolean isValidCodePoint(int codePoint) {
jaroslav@68: // Optimized form of:
jaroslav@68: // codePoint >= MIN_CODE_POINT && codePoint <= MAX_CODE_POINT
jaroslav@68: int plane = codePoint >>> 16;
jaroslav@68: return plane < ((MAX_CODE_POINT + 1) >>> 16);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Determines whether the specified character (Unicode code point)
jaroslav@68: * is in the Basic Multilingual Plane (BMP).
jaroslav@68: * Such code points can be represented using a single {@code char}.
jaroslav@68: *
jaroslav@68: * @param codePoint the character (Unicode code point) to be tested
jaroslav@68: * @return {@code true} if the specified code point is between
jaroslav@68: * {@link #MIN_VALUE} and {@link #MAX_VALUE} inclusive;
jaroslav@68: * {@code false} otherwise.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static boolean isBmpCodePoint(int codePoint) {
jaroslav@68: return codePoint >>> 16 == 0;
jaroslav@68: // Optimized form of:
jaroslav@68: // codePoint >= MIN_VALUE && codePoint <= MAX_VALUE
jaroslav@68: // We consistently use logical shift (>>>) to facilitate
jaroslav@68: // additional runtime optimizations.
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Determines whether the specified character (Unicode code point)
jaroslav@68: * is in the supplementary character range.
jaroslav@68: *
jaroslav@68: * @param codePoint the character (Unicode code point) to be tested
jaroslav@68: * @return {@code true} if the specified code point is between
jaroslav@68: * {@link #MIN_SUPPLEMENTARY_CODE_POINT} and
jaroslav@68: * {@link #MAX_CODE_POINT} inclusive;
jaroslav@68: * {@code false} otherwise.
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static boolean isSupplementaryCodePoint(int codePoint) {
jaroslav@68: return codePoint >= MIN_SUPPLEMENTARY_CODE_POINT
jaroslav@68: && codePoint < MAX_CODE_POINT + 1;
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Determines if the given {@code char} value is a
jaroslav@68: *
jaroslav@68: * Unicode high-surrogate code unit
jaroslav@68: * (also known as leading-surrogate code unit).
jaroslav@68: *
jaroslav@68: * Such values do not represent characters by themselves,
jaroslav@68: * but are used in the representation of
jaroslav@68: * supplementary characters
jaroslav@68: * in the UTF-16 encoding.
jaroslav@68: *
jaroslav@68: * @param ch the {@code char} value to be tested.
jaroslav@68: * @return {@code true} if the {@code char} value is between
jaroslav@68: * {@link #MIN_HIGH_SURROGATE} and
jaroslav@68: * {@link #MAX_HIGH_SURROGATE} inclusive;
jaroslav@68: * {@code false} otherwise.
jaroslav@68: * @see Character#isLowSurrogate(char)
jaroslav@68: * @see Character.UnicodeBlock#of(int)
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static boolean isHighSurrogate(char ch) {
jaroslav@68: // Help VM constant-fold; MAX_HIGH_SURROGATE + 1 == MIN_LOW_SURROGATE
jaroslav@68: return ch >= MIN_HIGH_SURROGATE && ch < (MAX_HIGH_SURROGATE + 1);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Determines if the given {@code char} value is a
jaroslav@68: *
jaroslav@68: * Unicode low-surrogate code unit
jaroslav@68: * (also known as trailing-surrogate code unit).
jaroslav@68: *
jaroslav@68: * Such values do not represent characters by themselves,
jaroslav@68: * but are used in the representation of
jaroslav@68: * supplementary characters
jaroslav@68: * in the UTF-16 encoding.
jaroslav@68: *
jaroslav@68: * @param ch the {@code char} value to be tested.
jaroslav@68: * @return {@code true} if the {@code char} value is between
jaroslav@68: * {@link #MIN_LOW_SURROGATE} and
jaroslav@68: * {@link #MAX_LOW_SURROGATE} inclusive;
jaroslav@68: * {@code false} otherwise.
jaroslav@68: * @see Character#isHighSurrogate(char)
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static boolean isLowSurrogate(char ch) {
jaroslav@68: return ch >= MIN_LOW_SURROGATE && ch < (MAX_LOW_SURROGATE + 1);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Determines if the given {@code char} value is a Unicode
jaroslav@68: * surrogate code unit.
jaroslav@68: *
jaroslav@68: * Such values do not represent characters by themselves,
jaroslav@68: * but are used in the representation of
jaroslav@68: * supplementary characters
jaroslav@68: * in the UTF-16 encoding.
jaroslav@68: *
jaroslav@68: * A char value is a surrogate code unit if and only if it is either
jaroslav@68: * a {@linkplain #isLowSurrogate(char) low-surrogate code unit} or
jaroslav@68: * a {@linkplain #isHighSurrogate(char) high-surrogate code unit}.
jaroslav@68: *
jaroslav@68: * @param ch the {@code char} value to be tested.
jaroslav@68: * @return {@code true} if the {@code char} value is between
jaroslav@68: * {@link #MIN_SURROGATE} and
jaroslav@68: * {@link #MAX_SURROGATE} inclusive;
jaroslav@68: * {@code false} otherwise.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static boolean isSurrogate(char ch) {
jaroslav@68: return ch >= MIN_SURROGATE && ch < (MAX_SURROGATE + 1);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Determines whether the specified pair of {@code char}
jaroslav@68: * values is a valid
jaroslav@68: *
jaroslav@68: * Unicode surrogate pair.
jaroslav@68:
jaroslav@68: * This method is equivalent to the expression:
jaroslav@68: * This method doesn't validate the specified character to be a
jaroslav@68: * valid Unicode code point. The caller must validate the
jaroslav@68: * character value using {@link #isValidCodePoint(int) isValidCodePoint}
jaroslav@68: * if necessary.
jaroslav@68: *
jaroslav@68: * @param codePoint the character (Unicode code point) to be tested.
jaroslav@68: * @return 2 if the character is a valid supplementary character; 1 otherwise.
jaroslav@68: * @see Character#isSupplementaryCodePoint(int)
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static int charCount(int codePoint) {
jaroslav@68: return codePoint >= MIN_SUPPLEMENTARY_CODE_POINT ? 2 : 1;
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Converts the specified surrogate pair to its supplementary code
jaroslav@68: * point value. This method does not validate the specified
jaroslav@68: * surrogate pair. The caller must validate it using {@link
jaroslav@68: * #isSurrogatePair(char, char) isSurrogatePair} if necessary.
jaroslav@68: *
jaroslav@68: * @param high the high-surrogate code unit
jaroslav@68: * @param low the low-surrogate code unit
jaroslav@68: * @return the supplementary code point composed from the
jaroslav@68: * specified surrogate pair.
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static int toCodePoint(char high, char low) {
jaroslav@68: // Optimized form of:
jaroslav@68: // return ((high - MIN_HIGH_SURROGATE) << 10)
jaroslav@68: // + (low - MIN_LOW_SURROGATE)
jaroslav@68: // + MIN_SUPPLEMENTARY_CODE_POINT;
jaroslav@68: return ((high << 10) + low) + (MIN_SUPPLEMENTARY_CODE_POINT
jaroslav@68: - (MIN_HIGH_SURROGATE << 10)
jaroslav@68: - MIN_LOW_SURROGATE);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Returns the code point at the given index of the
jaroslav@68: * {@code CharSequence}. If the {@code char} value at
jaroslav@68: * the given index in the {@code CharSequence} is in the
jaroslav@68: * high-surrogate range, the following index is less than the
jaroslav@68: * length of the {@code CharSequence}, and the
jaroslav@68: * {@code char} value at the following index is in the
jaroslav@68: * low-surrogate range, then the supplementary code point
jaroslav@68: * corresponding to this surrogate pair is returned. Otherwise,
jaroslav@68: * the {@code char} value at the given index is returned.
jaroslav@68: *
jaroslav@68: * @param seq a sequence of {@code char} values (Unicode code
jaroslav@68: * units)
jaroslav@68: * @param index the index to the {@code char} values (Unicode
jaroslav@68: * code units) in {@code seq} to be converted
jaroslav@68: * @return the Unicode code point at the given index
jaroslav@68: * @exception NullPointerException if {@code seq} is null.
jaroslav@68: * @exception IndexOutOfBoundsException if the value
jaroslav@68: * {@code index} is negative or not less than
jaroslav@68: * {@link CharSequence#length() seq.length()}.
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static int codePointAt(CharSequence seq, int index) {
jaroslav@68: char c1 = seq.charAt(index++);
jaroslav@68: if (isHighSurrogate(c1)) {
jaroslav@68: if (index < seq.length()) {
jaroslav@68: char c2 = seq.charAt(index);
jaroslav@68: if (isLowSurrogate(c2)) {
jaroslav@68: return toCodePoint(c1, c2);
jaroslav@68: }
jaroslav@68: }
jaroslav@68: }
jaroslav@68: return c1;
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Returns the code point at the given index of the
jaroslav@68: * {@code char} array. If the {@code char} value at
jaroslav@68: * the given index in the {@code char} array is in the
jaroslav@68: * high-surrogate range, the following index is less than the
jaroslav@68: * length of the {@code char} array, and the
jaroslav@68: * {@code char} value at the following index is in the
jaroslav@68: * low-surrogate range, then the supplementary code point
jaroslav@68: * corresponding to this surrogate pair is returned. Otherwise,
jaroslav@68: * the {@code char} value at the given index is returned.
jaroslav@68: *
jaroslav@68: * @param a the {@code char} array
jaroslav@68: * @param index the index to the {@code char} values (Unicode
jaroslav@68: * code units) in the {@code char} array to be converted
jaroslav@68: * @return the Unicode code point at the given index
jaroslav@68: * @exception NullPointerException if {@code a} is null.
jaroslav@68: * @exception IndexOutOfBoundsException if the value
jaroslav@68: * {@code index} is negative or not less than
jaroslav@68: * the length of the {@code char} array.
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static int codePointAt(char[] a, int index) {
jaroslav@68: return codePointAtImpl(a, index, a.length);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Returns the code point at the given index of the
jaroslav@68: * {@code char} array, where only array elements with
jaroslav@68: * {@code index} less than {@code limit} can be used. If
jaroslav@68: * the {@code char} value at the given index in the
jaroslav@68: * {@code char} array is in the high-surrogate range, the
jaroslav@68: * following index is less than the {@code limit}, and the
jaroslav@68: * {@code char} value at the following index is in the
jaroslav@68: * low-surrogate range, then the supplementary code point
jaroslav@68: * corresponding to this surrogate pair is returned. Otherwise,
jaroslav@68: * the {@code char} value at the given index is returned.
jaroslav@68: *
jaroslav@68: * @param a the {@code char} array
jaroslav@68: * @param index the index to the {@code char} values (Unicode
jaroslav@68: * code units) in the {@code char} array to be converted
jaroslav@68: * @param limit the index after the last array element that
jaroslav@68: * can be used in the {@code char} array
jaroslav@68: * @return the Unicode code point at the given index
jaroslav@68: * @exception NullPointerException if {@code a} is null.
jaroslav@68: * @exception IndexOutOfBoundsException if the {@code index}
jaroslav@68: * argument is negative or not less than the {@code limit}
jaroslav@68: * argument, or if the {@code limit} argument is negative or
jaroslav@68: * greater than the length of the {@code char} array.
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static int codePointAt(char[] a, int index, int limit) {
jaroslav@68: if (index >= limit || limit < 0 || limit > a.length) {
jaroslav@68: throw new IndexOutOfBoundsException();
jaroslav@68: }
jaroslav@68: return codePointAtImpl(a, index, limit);
jaroslav@68: }
jaroslav@68:
jaroslav@68: // throws ArrayIndexOutofBoundsException if index out of bounds
jaroslav@68: static int codePointAtImpl(char[] a, int index, int limit) {
jaroslav@68: char c1 = a[index++];
jaroslav@68: if (isHighSurrogate(c1)) {
jaroslav@68: if (index < limit) {
jaroslav@68: char c2 = a[index];
jaroslav@68: if (isLowSurrogate(c2)) {
jaroslav@68: return toCodePoint(c1, c2);
jaroslav@68: }
jaroslav@68: }
jaroslav@68: }
jaroslav@68: return c1;
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Returns the code point preceding the given index of the
jaroslav@68: * {@code CharSequence}. If the {@code char} value at
jaroslav@68: * {@code (index - 1)} in the {@code CharSequence} is in
jaroslav@68: * the low-surrogate range, {@code (index - 2)} is not
jaroslav@68: * negative, and the {@code char} value at {@code (index - 2)}
jaroslav@68: * in the {@code CharSequence} is in the
jaroslav@68: * high-surrogate range, then the supplementary code point
jaroslav@68: * corresponding to this surrogate pair is returned. Otherwise,
jaroslav@68: * the {@code char} value at {@code (index - 1)} is
jaroslav@68: * returned.
jaroslav@68: *
jaroslav@68: * @param seq the {@code CharSequence} instance
jaroslav@68: * @param index the index following the code point that should be returned
jaroslav@68: * @return the Unicode code point value before the given index.
jaroslav@68: * @exception NullPointerException if {@code seq} is null.
jaroslav@68: * @exception IndexOutOfBoundsException if the {@code index}
jaroslav@68: * argument is less than 1 or greater than {@link
jaroslav@68: * CharSequence#length() seq.length()}.
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static int codePointBefore(CharSequence seq, int index) {
jaroslav@68: char c2 = seq.charAt(--index);
jaroslav@68: if (isLowSurrogate(c2)) {
jaroslav@68: if (index > 0) {
jaroslav@68: char c1 = seq.charAt(--index);
jaroslav@68: if (isHighSurrogate(c1)) {
jaroslav@68: return toCodePoint(c1, c2);
jaroslav@68: }
jaroslav@68: }
jaroslav@68: }
jaroslav@68: return c2;
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Returns the code point preceding the given index of the
jaroslav@68: * {@code char} array. If the {@code char} value at
jaroslav@68: * {@code (index - 1)} in the {@code char} array is in
jaroslav@68: * the low-surrogate range, {@code (index - 2)} is not
jaroslav@68: * negative, and the {@code char} value at {@code (index - 2)}
jaroslav@68: * in the {@code char} array is in the
jaroslav@68: * high-surrogate range, then the supplementary code point
jaroslav@68: * corresponding to this surrogate pair is returned. Otherwise,
jaroslav@68: * the {@code char} value at {@code (index - 1)} is
jaroslav@68: * returned.
jaroslav@68: *
jaroslav@68: * @param a the {@code char} array
jaroslav@68: * @param index the index following the code point that should be returned
jaroslav@68: * @return the Unicode code point value before the given index.
jaroslav@68: * @exception NullPointerException if {@code a} is null.
jaroslav@68: * @exception IndexOutOfBoundsException if the {@code index}
jaroslav@68: * argument is less than 1 or greater than the length of the
jaroslav@68: * {@code char} array
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static int codePointBefore(char[] a, int index) {
jaroslav@68: return codePointBeforeImpl(a, index, 0);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Returns the code point preceding the given index of the
jaroslav@68: * {@code char} array, where only array elements with
jaroslav@68: * {@code index} greater than or equal to {@code start}
jaroslav@68: * can be used. If the {@code char} value at {@code (index - 1)}
jaroslav@68: * in the {@code char} array is in the
jaroslav@68: * low-surrogate range, {@code (index - 2)} is not less than
jaroslav@68: * {@code start}, and the {@code char} value at
jaroslav@68: * {@code (index - 2)} in the {@code char} array is in
jaroslav@68: * the high-surrogate range, then the supplementary code point
jaroslav@68: * corresponding to this surrogate pair is returned. Otherwise,
jaroslav@68: * the {@code char} value at {@code (index - 1)} is
jaroslav@68: * returned.
jaroslav@68: *
jaroslav@68: * @param a the {@code char} array
jaroslav@68: * @param index the index following the code point that should be returned
jaroslav@68: * @param start the index of the first array element in the
jaroslav@68: * {@code char} array
jaroslav@68: * @return the Unicode code point value before the given index.
jaroslav@68: * @exception NullPointerException if {@code a} is null.
jaroslav@68: * @exception IndexOutOfBoundsException if the {@code index}
jaroslav@68: * argument is not greater than the {@code start} argument or
jaroslav@68: * is greater than the length of the {@code char} array, or
jaroslav@68: * if the {@code start} argument is negative or not less than
jaroslav@68: * the length of the {@code char} array.
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static int codePointBefore(char[] a, int index, int start) {
jaroslav@68: if (index <= start || start < 0 || start >= a.length) {
jaroslav@68: throw new IndexOutOfBoundsException();
jaroslav@68: }
jaroslav@68: return codePointBeforeImpl(a, index, start);
jaroslav@68: }
jaroslav@68:
jaroslav@68: // throws ArrayIndexOutofBoundsException if index-1 out of bounds
jaroslav@68: static int codePointBeforeImpl(char[] a, int index, int start) {
jaroslav@68: char c2 = a[--index];
jaroslav@68: if (isLowSurrogate(c2)) {
jaroslav@68: if (index > start) {
jaroslav@68: char c1 = a[--index];
jaroslav@68: if (isHighSurrogate(c1)) {
jaroslav@68: return toCodePoint(c1, c2);
jaroslav@68: }
jaroslav@68: }
jaroslav@68: }
jaroslav@68: return c2;
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Returns the leading surrogate (a
jaroslav@68: *
jaroslav@68: * high surrogate code unit) of the
jaroslav@68: *
jaroslav@68: * surrogate pair
jaroslav@68: * representing the specified supplementary character (Unicode
jaroslav@68: * code point) in the UTF-16 encoding. If the specified character
jaroslav@68: * is not a
jaroslav@68: * supplementary character,
jaroslav@68: * an unspecified {@code char} is returned.
jaroslav@68: *
jaroslav@68: * If
jaroslav@68: * {@link #isSupplementaryCodePoint isSupplementaryCodePoint(x)}
jaroslav@68: * is {@code true}, then
jaroslav@68: * {@link #isHighSurrogate isHighSurrogate}{@code (highSurrogate(x))} and
jaroslav@68: * {@link #toCodePoint toCodePoint}{@code (highSurrogate(x), }{@link #lowSurrogate lowSurrogate}{@code (x)) == x}
jaroslav@68: * are also always {@code true}.
jaroslav@68: *
jaroslav@68: * @param codePoint a supplementary character (Unicode code point)
jaroslav@68: * @return the leading surrogate code unit used to represent the
jaroslav@68: * character in the UTF-16 encoding
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static char highSurrogate(int codePoint) {
jaroslav@68: return (char) ((codePoint >>> 10)
jaroslav@68: + (MIN_HIGH_SURROGATE - (MIN_SUPPLEMENTARY_CODE_POINT >>> 10)));
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Returns the trailing surrogate (a
jaroslav@68: *
jaroslav@68: * low surrogate code unit) of the
jaroslav@68: *
jaroslav@68: * surrogate pair
jaroslav@68: * representing the specified supplementary character (Unicode
jaroslav@68: * code point) in the UTF-16 encoding. If the specified character
jaroslav@68: * is not a
jaroslav@68: * supplementary character,
jaroslav@68: * an unspecified {@code char} is returned.
jaroslav@68: *
jaroslav@68: * If
jaroslav@68: * {@link #isSupplementaryCodePoint isSupplementaryCodePoint(x)}
jaroslav@68: * is {@code true}, then
jaroslav@68: * {@link #isLowSurrogate isLowSurrogate}{@code (lowSurrogate(x))} and
jaroslav@68: * {@link #toCodePoint toCodePoint}{@code (}{@link #highSurrogate highSurrogate}{@code (x), lowSurrogate(x)) == x}
jaroslav@68: * are also always {@code true}.
jaroslav@68: *
jaroslav@68: * @param codePoint a supplementary character (Unicode code point)
jaroslav@68: * @return the trailing surrogate code unit used to represent the
jaroslav@68: * character in the UTF-16 encoding
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static char lowSurrogate(int codePoint) {
jaroslav@68: return (char) ((codePoint & 0x3ff) + MIN_LOW_SURROGATE);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Converts the specified character (Unicode code point) to its
jaroslav@68: * UTF-16 representation. If the specified code point is a BMP
jaroslav@68: * (Basic Multilingual Plane or Plane 0) value, the same value is
jaroslav@68: * stored in {@code dst[dstIndex]}, and 1 is returned. If the
jaroslav@68: * specified code point is a supplementary character, its
jaroslav@68: * surrogate values are stored in {@code dst[dstIndex]}
jaroslav@68: * (high-surrogate) and {@code dst[dstIndex+1]}
jaroslav@68: * (low-surrogate), and 2 is returned.
jaroslav@68: *
jaroslav@68: * @param codePoint the character (Unicode code point) to be converted.
jaroslav@68: * @param dst an array of {@code char} in which the
jaroslav@68: * {@code codePoint}'s UTF-16 value is stored.
jaroslav@68: * @param dstIndex the start index into the {@code dst}
jaroslav@68: * array where the converted value is stored.
jaroslav@68: * @return 1 if the code point is a BMP code point, 2 if the
jaroslav@68: * code point is a supplementary code point.
jaroslav@68: * @exception IllegalArgumentException if the specified
jaroslav@68: * {@code codePoint} is not a valid Unicode code point.
jaroslav@68: * @exception NullPointerException if the specified {@code dst} is null.
jaroslav@68: * @exception IndexOutOfBoundsException if {@code dstIndex}
jaroslav@68: * is negative or not less than {@code dst.length}, or if
jaroslav@68: * {@code dst} at {@code dstIndex} doesn't have enough
jaroslav@68: * array element(s) to store the resulting {@code char}
jaroslav@68: * value(s). (If {@code dstIndex} is equal to
jaroslav@68: * {@code dst.length-1} and the specified
jaroslav@68: * {@code codePoint} is a supplementary character, the
jaroslav@68: * high-surrogate value is not stored in
jaroslav@68: * {@code dst[dstIndex]}.)
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static int toChars(int codePoint, char[] dst, int dstIndex) {
jaroslav@68: if (isBmpCodePoint(codePoint)) {
jaroslav@68: dst[dstIndex] = (char) codePoint;
jaroslav@68: return 1;
jaroslav@68: } else if (isValidCodePoint(codePoint)) {
jaroslav@68: toSurrogates(codePoint, dst, dstIndex);
jaroslav@68: return 2;
jaroslav@68: } else {
jaroslav@68: throw new IllegalArgumentException();
jaroslav@68: }
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Converts the specified character (Unicode code point) to its
jaroslav@68: * UTF-16 representation stored in a {@code char} array. If
jaroslav@68: * the specified code point is a BMP (Basic Multilingual Plane or
jaroslav@68: * Plane 0) value, the resulting {@code char} array has
jaroslav@68: * the same value as {@code codePoint}. If the specified code
jaroslav@68: * point is a supplementary code point, the resulting
jaroslav@68: * {@code char} array has the corresponding surrogate pair.
jaroslav@68: *
jaroslav@68: * @param codePoint a Unicode code point
jaroslav@68: * @return a {@code char} array having
jaroslav@68: * {@code codePoint}'s UTF-16 representation.
jaroslav@68: * @exception IllegalArgumentException if the specified
jaroslav@68: * {@code codePoint} is not a valid Unicode code point.
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static char[] toChars(int codePoint) {
jaroslav@68: if (isBmpCodePoint(codePoint)) {
jaroslav@68: return new char[] { (char) codePoint };
jaroslav@68: } else if (isValidCodePoint(codePoint)) {
jaroslav@68: char[] result = new char[2];
jaroslav@68: toSurrogates(codePoint, result, 0);
jaroslav@68: return result;
jaroslav@68: } else {
jaroslav@68: throw new IllegalArgumentException();
jaroslav@68: }
jaroslav@68: }
jaroslav@68:
jaroslav@68: static void toSurrogates(int codePoint, char[] dst, int index) {
jaroslav@68: // We write elements "backwards" to guarantee all-or-nothing
jaroslav@68: dst[index+1] = lowSurrogate(codePoint);
jaroslav@68: dst[index] = highSurrogate(codePoint);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Returns the number of Unicode code points in the text range of
jaroslav@68: * the specified char sequence. The text range begins at the
jaroslav@68: * specified {@code beginIndex} and extends to the
jaroslav@68: * {@code char} at index {@code endIndex - 1}. Thus the
jaroslav@68: * length (in {@code char}s) of the text range is
jaroslav@68: * {@code endIndex-beginIndex}. Unpaired surrogates within
jaroslav@68: * the text range count as one code point each.
jaroslav@68: *
jaroslav@68: * @param seq the char sequence
jaroslav@68: * @param beginIndex the index to the first {@code char} of
jaroslav@68: * the text range.
jaroslav@68: * @param endIndex the index after the last {@code char} of
jaroslav@68: * the text range.
jaroslav@68: * @return the number of Unicode code points in the specified text
jaroslav@68: * range
jaroslav@68: * @exception NullPointerException if {@code seq} is null.
jaroslav@68: * @exception IndexOutOfBoundsException if the
jaroslav@68: * {@code beginIndex} is negative, or {@code endIndex}
jaroslav@68: * is larger than the length of the given sequence, or
jaroslav@68: * {@code beginIndex} is larger than {@code endIndex}.
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static int codePointCount(CharSequence seq, int beginIndex, int endIndex) {
jaroslav@68: int length = seq.length();
jaroslav@68: if (beginIndex < 0 || endIndex > length || beginIndex > endIndex) {
jaroslav@68: throw new IndexOutOfBoundsException();
jaroslav@68: }
jaroslav@68: int n = endIndex - beginIndex;
jaroslav@68: for (int i = beginIndex; i < endIndex; ) {
jaroslav@68: if (isHighSurrogate(seq.charAt(i++)) && i < endIndex &&
jaroslav@68: isLowSurrogate(seq.charAt(i))) {
jaroslav@68: n--;
jaroslav@68: i++;
jaroslav@68: }
jaroslav@68: }
jaroslav@68: return n;
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Returns the number of Unicode code points in a subarray of the
jaroslav@68: * {@code char} array argument. The {@code offset}
jaroslav@68: * argument is the index of the first {@code char} of the
jaroslav@68: * subarray and the {@code count} argument specifies the
jaroslav@68: * length of the subarray in {@code char}s. Unpaired
jaroslav@68: * surrogates within the subarray count as one code point each.
jaroslav@68: *
jaroslav@68: * @param a the {@code char} array
jaroslav@68: * @param offset the index of the first {@code char} in the
jaroslav@68: * given {@code char} array
jaroslav@68: * @param count the length of the subarray in {@code char}s
jaroslav@68: * @return the number of Unicode code points in the specified subarray
jaroslav@68: * @exception NullPointerException if {@code a} is null.
jaroslav@68: * @exception IndexOutOfBoundsException if {@code offset} or
jaroslav@68: * {@code count} is negative, or if {@code offset +
jaroslav@68: * count} is larger than the length of the given array.
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static int codePointCount(char[] a, int offset, int count) {
jaroslav@68: if (count > a.length - offset || offset < 0 || count < 0) {
jaroslav@68: throw new IndexOutOfBoundsException();
jaroslav@68: }
jaroslav@68: return codePointCountImpl(a, offset, count);
jaroslav@68: }
jaroslav@68:
jaroslav@68: static int codePointCountImpl(char[] a, int offset, int count) {
jaroslav@68: int endIndex = offset + count;
jaroslav@68: int n = count;
jaroslav@68: for (int i = offset; i < endIndex; ) {
jaroslav@68: if (isHighSurrogate(a[i++]) && i < endIndex &&
jaroslav@68: isLowSurrogate(a[i])) {
jaroslav@68: n--;
jaroslav@68: i++;
jaroslav@68: }
jaroslav@68: }
jaroslav@68: return n;
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Returns the index within the given char sequence that is offset
jaroslav@68: * from the given {@code index} by {@code codePointOffset}
jaroslav@68: * code points. Unpaired surrogates within the text range given by
jaroslav@68: * {@code index} and {@code codePointOffset} count as
jaroslav@68: * one code point each.
jaroslav@68: *
jaroslav@68: * @param seq the char sequence
jaroslav@68: * @param index the index to be offset
jaroslav@68: * @param codePointOffset the offset in code points
jaroslav@68: * @return the index within the char sequence
jaroslav@68: * @exception NullPointerException if {@code seq} is null.
jaroslav@68: * @exception IndexOutOfBoundsException if {@code index}
jaroslav@68: * is negative or larger then the length of the char sequence,
jaroslav@68: * or if {@code codePointOffset} is positive and the
jaroslav@68: * subsequence starting with {@code index} has fewer than
jaroslav@68: * {@code codePointOffset} code points, or if
jaroslav@68: * {@code codePointOffset} is negative and the subsequence
jaroslav@68: * before {@code index} has fewer than the absolute value
jaroslav@68: * of {@code codePointOffset} code points.
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static int offsetByCodePoints(CharSequence seq, int index,
jaroslav@68: int codePointOffset) {
jaroslav@68: int length = seq.length();
jaroslav@68: if (index < 0 || index > length) {
jaroslav@68: throw new IndexOutOfBoundsException();
jaroslav@68: }
jaroslav@68:
jaroslav@68: int x = index;
jaroslav@68: if (codePointOffset >= 0) {
jaroslav@68: int i;
jaroslav@68: for (i = 0; x < length && i < codePointOffset; i++) {
jaroslav@68: if (isHighSurrogate(seq.charAt(x++)) && x < length &&
jaroslav@68: isLowSurrogate(seq.charAt(x))) {
jaroslav@68: x++;
jaroslav@68: }
jaroslav@68: }
jaroslav@68: if (i < codePointOffset) {
jaroslav@68: throw new IndexOutOfBoundsException();
jaroslav@68: }
jaroslav@68: } else {
jaroslav@68: int i;
jaroslav@68: for (i = codePointOffset; x > 0 && i < 0; i++) {
jaroslav@68: if (isLowSurrogate(seq.charAt(--x)) && x > 0 &&
jaroslav@68: isHighSurrogate(seq.charAt(x-1))) {
jaroslav@68: x--;
jaroslav@68: }
jaroslav@68: }
jaroslav@68: if (i < 0) {
jaroslav@68: throw new IndexOutOfBoundsException();
jaroslav@68: }
jaroslav@68: }
jaroslav@68: return x;
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Returns the index within the given {@code char} subarray
jaroslav@68: * that is offset from the given {@code index} by
jaroslav@68: * {@code codePointOffset} code points. The
jaroslav@68: * {@code start} and {@code count} arguments specify a
jaroslav@68: * subarray of the {@code char} array. Unpaired surrogates
jaroslav@68: * within the text range given by {@code index} and
jaroslav@68: * {@code codePointOffset} count as one code point each.
jaroslav@68: *
jaroslav@68: * @param a the {@code char} array
jaroslav@68: * @param start the index of the first {@code char} of the
jaroslav@68: * subarray
jaroslav@68: * @param count the length of the subarray in {@code char}s
jaroslav@68: * @param index the index to be offset
jaroslav@68: * @param codePointOffset the offset in code points
jaroslav@68: * @return the index within the subarray
jaroslav@68: * @exception NullPointerException if {@code a} is null.
jaroslav@68: * @exception IndexOutOfBoundsException
jaroslav@68: * if {@code start} or {@code count} is negative,
jaroslav@68: * or if {@code start + count} is larger than the length of
jaroslav@68: * the given array,
jaroslav@68: * or if {@code index} is less than {@code start} or
jaroslav@68: * larger then {@code start + count},
jaroslav@68: * or if {@code codePointOffset} is positive and the text range
jaroslav@68: * starting with {@code index} and ending with {@code start + count - 1}
jaroslav@68: * has fewer than {@code codePointOffset} code
jaroslav@68: * points,
jaroslav@68: * or if {@code codePointOffset} is negative and the text range
jaroslav@68: * starting with {@code start} and ending with {@code index - 1}
jaroslav@68: * has fewer than the absolute value of
jaroslav@68: * {@code codePointOffset} code points.
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static int offsetByCodePoints(char[] a, int start, int count,
jaroslav@68: int index, int codePointOffset) {
jaroslav@68: if (count > a.length-start || start < 0 || count < 0
jaroslav@68: || index < start || index > start+count) {
jaroslav@68: throw new IndexOutOfBoundsException();
jaroslav@68: }
jaroslav@68: return offsetByCodePointsImpl(a, start, count, index, codePointOffset);
jaroslav@68: }
jaroslav@68:
jaroslav@68: static int offsetByCodePointsImpl(char[]a, int start, int count,
jaroslav@68: int index, int codePointOffset) {
jaroslav@68: int x = index;
jaroslav@68: if (codePointOffset >= 0) {
jaroslav@68: int limit = start + count;
jaroslav@68: int i;
jaroslav@68: for (i = 0; x < limit && i < codePointOffset; i++) {
jaroslav@68: if (isHighSurrogate(a[x++]) && x < limit &&
jaroslav@68: isLowSurrogate(a[x])) {
jaroslav@68: x++;
jaroslav@68: }
jaroslav@68: }
jaroslav@68: if (i < codePointOffset) {
jaroslav@68: throw new IndexOutOfBoundsException();
jaroslav@68: }
jaroslav@68: } else {
jaroslav@68: int i;
jaroslav@68: for (i = codePointOffset; x > start && i < 0; i++) {
jaroslav@68: if (isLowSurrogate(a[--x]) && x > start &&
jaroslav@68: isHighSurrogate(a[x-1])) {
jaroslav@68: x--;
jaroslav@68: }
jaroslav@68: }
jaroslav@68: if (i < 0) {
jaroslav@68: throw new IndexOutOfBoundsException();
jaroslav@68: }
jaroslav@68: }
jaroslav@68: return x;
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Determines if the specified character is a lowercase character.
jaroslav@68: *
jaroslav@68: * A character is lowercase if its general category type, provided
jaroslav@68: * by {@code Character.getType(ch)}, is
jaroslav@68: * {@code LOWERCASE_LETTER}, or it has contributory property
jaroslav@68: * Other_Lowercase as defined by the Unicode Standard.
jaroslav@68: *
jaroslav@68: * The following are examples of lowercase characters:
jaroslav@68: * Many other Unicode characters are lowercase too.
jaroslav@68: *
jaroslav@68: * Note: This method cannot handle supplementary characters. To support
jaroslav@68: * all Unicode characters, including supplementary characters, use
jaroslav@68: * the {@link #isLowerCase(int)} method.
jaroslav@68: *
jaroslav@68: * @param ch the character to be tested.
jaroslav@68: * @return {@code true} if the character is lowercase;
jaroslav@68: * {@code false} otherwise.
jaroslav@68: * @see Character#isLowerCase(char)
jaroslav@68: * @see Character#isTitleCase(char)
jaroslav@68: * @see Character#toLowerCase(char)
jaroslav@68: * @see Character#getType(char)
jaroslav@68: */
jaroslav@68: public static boolean isLowerCase(char ch) {
jaroslav@68: return isLowerCase((int)ch);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Determines if the specified character (Unicode code point) is a
jaroslav@68: * lowercase character.
jaroslav@68: *
jaroslav@68: * A character is lowercase if its general category type, provided
jaroslav@68: * by {@link Character#getType getType(codePoint)}, is
jaroslav@68: * {@code LOWERCASE_LETTER}, or it has contributory property
jaroslav@68: * Other_Lowercase as defined by the Unicode Standard.
jaroslav@68: *
jaroslav@68: * The following are examples of lowercase characters:
jaroslav@68: * Many other Unicode characters are lowercase too.
jaroslav@68: *
jaroslav@68: * @param codePoint the character (Unicode code point) to be tested.
jaroslav@68: * @return {@code true} if the character is lowercase;
jaroslav@68: * {@code false} otherwise.
jaroslav@68: * @see Character#isLowerCase(int)
jaroslav@68: * @see Character#isTitleCase(int)
jaroslav@68: * @see Character#toLowerCase(int)
jaroslav@68: * @see Character#getType(int)
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static boolean isLowerCase(int codePoint) {
jaroslav@68: return getType(codePoint) == Character.LOWERCASE_LETTER ||
jaroslav@68: CharacterData.of(codePoint).isOtherLowercase(codePoint);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Determines if the specified character is an uppercase character.
jaroslav@68: *
jaroslav@68: * A character is uppercase if its general category type, provided by
jaroslav@68: * {@code Character.getType(ch)}, is {@code UPPERCASE_LETTER}.
jaroslav@68: * or it has contributory property Other_Uppercase as defined by the Unicode Standard.
jaroslav@68: *
jaroslav@68: * The following are examples of uppercase characters:
jaroslav@68: * Many other Unicode characters are uppercase too.
jaroslav@68: *
jaroslav@68: * Note: This method cannot handle supplementary characters. To support
jaroslav@68: * all Unicode characters, including supplementary characters, use
jaroslav@68: * the {@link #isUpperCase(int)} method.
jaroslav@68: *
jaroslav@68: * @param ch the character to be tested.
jaroslav@68: * @return {@code true} if the character is uppercase;
jaroslav@68: * {@code false} otherwise.
jaroslav@68: * @see Character#isLowerCase(char)
jaroslav@68: * @see Character#isTitleCase(char)
jaroslav@68: * @see Character#toUpperCase(char)
jaroslav@68: * @see Character#getType(char)
jaroslav@68: * @since 1.0
jaroslav@68: */
jaroslav@68: public static boolean isUpperCase(char ch) {
jaroslav@68: return isUpperCase((int)ch);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Determines if the specified character (Unicode code point) is an uppercase character.
jaroslav@68: *
jaroslav@68: * A character is uppercase if its general category type, provided by
jaroslav@68: * {@link Character#getType(int) getType(codePoint)}, is {@code UPPERCASE_LETTER},
jaroslav@68: * or it has contributory property Other_Uppercase as defined by the Unicode Standard.
jaroslav@68: *
jaroslav@68: * The following are examples of uppercase characters:
jaroslav@68: * Many other Unicode characters are uppercase too.
jaroslav@68: *
jaroslav@68: * @param codePoint the character (Unicode code point) to be tested.
jaroslav@68: * @return {@code true} if the character is uppercase;
jaroslav@68: * {@code false} otherwise.
jaroslav@68: * @see Character#isLowerCase(int)
jaroslav@68: * @see Character#isTitleCase(int)
jaroslav@68: * @see Character#toUpperCase(int)
jaroslav@68: * @see Character#getType(int)
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static boolean isUpperCase(int codePoint) {
jaroslav@68: return getType(codePoint) == Character.UPPERCASE_LETTER ||
jaroslav@68: CharacterData.of(codePoint).isOtherUppercase(codePoint);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Determines if the specified character is a titlecase character.
jaroslav@68: *
jaroslav@68: * A character is a titlecase character if its general
jaroslav@68: * category type, provided by {@code Character.getType(ch)},
jaroslav@68: * is {@code TITLECASE_LETTER}.
jaroslav@68: *
jaroslav@68: * Some characters look like pairs of Latin letters. For example, there
jaroslav@68: * is an uppercase letter that looks like "LJ" and has a corresponding
jaroslav@68: * lowercase letter that looks like "lj". A third form, which looks like "Lj",
jaroslav@68: * is the appropriate form to use when rendering a word in lowercase
jaroslav@68: * with initial capitals, as for a book title.
jaroslav@68: *
jaroslav@68: * These are some of the Unicode characters for which this method returns
jaroslav@68: * {@code true}:
jaroslav@68: * Many other Unicode characters are titlecase too.
jaroslav@68: *
jaroslav@68: * Note: This method cannot handle supplementary characters. To support
jaroslav@68: * all Unicode characters, including supplementary characters, use
jaroslav@68: * the {@link #isTitleCase(int)} method.
jaroslav@68: *
jaroslav@68: * @param ch the character to be tested.
jaroslav@68: * @return {@code true} if the character is titlecase;
jaroslav@68: * {@code false} otherwise.
jaroslav@68: * @see Character#isLowerCase(char)
jaroslav@68: * @see Character#isUpperCase(char)
jaroslav@68: * @see Character#toTitleCase(char)
jaroslav@68: * @see Character#getType(char)
jaroslav@68: * @since 1.0.2
jaroslav@68: */
jaroslav@68: public static boolean isTitleCase(char ch) {
jaroslav@68: return isTitleCase((int)ch);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Determines if the specified character (Unicode code point) is a titlecase character.
jaroslav@68: *
jaroslav@68: * A character is a titlecase character if its general
jaroslav@68: * category type, provided by {@link Character#getType(int) getType(codePoint)},
jaroslav@68: * is {@code TITLECASE_LETTER}.
jaroslav@68: *
jaroslav@68: * Some characters look like pairs of Latin letters. For example, there
jaroslav@68: * is an uppercase letter that looks like "LJ" and has a corresponding
jaroslav@68: * lowercase letter that looks like "lj". A third form, which looks like "Lj",
jaroslav@68: * is the appropriate form to use when rendering a word in lowercase
jaroslav@68: * with initial capitals, as for a book title.
jaroslav@68: *
jaroslav@68: * These are some of the Unicode characters for which this method returns
jaroslav@68: * {@code true}:
jaroslav@68: * Many other Unicode characters are titlecase too.
jaroslav@68: *
jaroslav@68: * @param codePoint the character (Unicode code point) to be tested.
jaroslav@68: * @return {@code true} if the character is titlecase;
jaroslav@68: * {@code false} otherwise.
jaroslav@68: * @see Character#isLowerCase(int)
jaroslav@68: * @see Character#isUpperCase(int)
jaroslav@68: * @see Character#toTitleCase(int)
jaroslav@68: * @see Character#getType(int)
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static boolean isTitleCase(int codePoint) {
jaroslav@68: return getType(codePoint) == Character.TITLECASE_LETTER;
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Determines if the specified character is a digit.
jaroslav@68: *
jaroslav@68: * A character is a digit if its general category type, provided
jaroslav@68: * by {@code Character.getType(ch)}, is
jaroslav@68: * {@code DECIMAL_DIGIT_NUMBER}.
jaroslav@68: *
jaroslav@68: * Some Unicode character ranges that contain digits:
jaroslav@68: * Note: This method cannot handle supplementary characters. To support
jaroslav@68: * all Unicode characters, including supplementary characters, use
jaroslav@68: * the {@link #isDigit(int)} method.
jaroslav@68: *
jaroslav@68: * @param ch the character to be tested.
jaroslav@68: * @return {@code true} if the character is a digit;
jaroslav@68: * {@code false} otherwise.
jaroslav@68: * @see Character#digit(char, int)
jaroslav@68: * @see Character#forDigit(int, int)
jaroslav@68: * @see Character#getType(char)
jaroslav@68: */
jaroslav@68: public static boolean isDigit(char ch) {
jaroslav@68: return isDigit((int)ch);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Determines if the specified character (Unicode code point) is a digit.
jaroslav@68: *
jaroslav@68: * A character is a digit if its general category type, provided
jaroslav@68: * by {@link Character#getType(int) getType(codePoint)}, is
jaroslav@68: * {@code DECIMAL_DIGIT_NUMBER}.
jaroslav@68: *
jaroslav@68: * Some Unicode character ranges that contain digits:
jaroslav@68: *
jaroslav@68: * A character is defined if at least one of the following is true:
jaroslav@68: * Note: This method cannot handle supplementary characters. To support
jaroslav@68: * all Unicode characters, including supplementary characters, use
jaroslav@68: * the {@link #isDefined(int)} method.
jaroslav@68: *
jaroslav@68: * @param ch the character to be tested
jaroslav@68: * @return {@code true} if the character has a defined meaning
jaroslav@68: * in Unicode; {@code false} otherwise.
jaroslav@68: * @see Character#isDigit(char)
jaroslav@68: * @see Character#isLetter(char)
jaroslav@68: * @see Character#isLetterOrDigit(char)
jaroslav@68: * @see Character#isLowerCase(char)
jaroslav@68: * @see Character#isTitleCase(char)
jaroslav@68: * @see Character#isUpperCase(char)
jaroslav@68: * @since 1.0.2
jaroslav@68: */
jaroslav@68: public static boolean isDefined(char ch) {
jaroslav@68: return isDefined((int)ch);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Determines if a character (Unicode code point) is defined in Unicode.
jaroslav@68: *
jaroslav@68: * A character is defined if at least one of the following is true:
jaroslav@68: *
jaroslav@68: * A character is considered to be a letter if its general
jaroslav@68: * category type, provided by {@code Character.getType(ch)},
jaroslav@68: * is any of the following:
jaroslav@68: * Note: This method cannot handle supplementary characters. To support
jaroslav@68: * all Unicode characters, including supplementary characters, use
jaroslav@68: * the {@link #isLetter(int)} method.
jaroslav@68: *
jaroslav@68: * @param ch the character to be tested.
jaroslav@68: * @return {@code true} if the character is a letter;
jaroslav@68: * {@code false} otherwise.
jaroslav@68: * @see Character#isDigit(char)
jaroslav@68: * @see Character#isJavaIdentifierStart(char)
jaroslav@68: * @see Character#isJavaLetter(char)
jaroslav@68: * @see Character#isJavaLetterOrDigit(char)
jaroslav@68: * @see Character#isLetterOrDigit(char)
jaroslav@68: * @see Character#isLowerCase(char)
jaroslav@68: * @see Character#isTitleCase(char)
jaroslav@68: * @see Character#isUnicodeIdentifierStart(char)
jaroslav@68: * @see Character#isUpperCase(char)
jaroslav@68: */
jaroslav@68: public static boolean isLetter(char ch) {
jaroslav@68: return isLetter((int)ch);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Determines if the specified character (Unicode code point) is a letter.
jaroslav@68: *
jaroslav@68: * A character is considered to be a letter if its general
jaroslav@68: * category type, provided by {@link Character#getType(int) getType(codePoint)},
jaroslav@68: * is any of the following:
jaroslav@68: *
jaroslav@68: * A character is considered to be a letter or digit if either
jaroslav@68: * {@code Character.isLetter(char ch)} or
jaroslav@68: * {@code Character.isDigit(char ch)} returns
jaroslav@68: * {@code true} for the character.
jaroslav@68: *
jaroslav@68: * Note: This method cannot handle supplementary characters. To support
jaroslav@68: * all Unicode characters, including supplementary characters, use
jaroslav@68: * the {@link #isLetterOrDigit(int)} method.
jaroslav@68: *
jaroslav@68: * @param ch the character to be tested.
jaroslav@68: * @return {@code true} if the character is a letter or digit;
jaroslav@68: * {@code false} otherwise.
jaroslav@68: * @see Character#isDigit(char)
jaroslav@68: * @see Character#isJavaIdentifierPart(char)
jaroslav@68: * @see Character#isJavaLetter(char)
jaroslav@68: * @see Character#isJavaLetterOrDigit(char)
jaroslav@68: * @see Character#isLetter(char)
jaroslav@68: * @see Character#isUnicodeIdentifierPart(char)
jaroslav@68: * @since 1.0.2
jaroslav@68: */
jaroslav@68: public static boolean isLetterOrDigit(char ch) {
jaroslav@68: return isLetterOrDigit((int)ch);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Determines if the specified character (Unicode code point) is a letter or digit.
jaroslav@68: *
jaroslav@68: * A character is considered to be a letter or digit if either
jaroslav@68: * {@link #isLetter(int) isLetter(codePoint)} or
jaroslav@68: * {@link #isDigit(int) isDigit(codePoint)} returns
jaroslav@68: * {@code true} for the character.
jaroslav@68: *
jaroslav@68: * @param codePoint the character (Unicode code point) to be tested.
jaroslav@68: * @return {@code true} if the character is a letter or digit;
jaroslav@68: * {@code false} otherwise.
jaroslav@68: * @see Character#isDigit(int)
jaroslav@68: * @see Character#isJavaIdentifierPart(int)
jaroslav@68: * @see Character#isLetter(int)
jaroslav@68: * @see Character#isUnicodeIdentifierPart(int)
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static boolean isLetterOrDigit(int codePoint) {
jaroslav@68: return ((((1 << Character.UPPERCASE_LETTER) |
jaroslav@68: (1 << Character.LOWERCASE_LETTER) |
jaroslav@68: (1 << Character.TITLECASE_LETTER) |
jaroslav@68: (1 << Character.MODIFIER_LETTER) |
jaroslav@68: (1 << Character.OTHER_LETTER) |
jaroslav@68: (1 << Character.DECIMAL_DIGIT_NUMBER)) >> getType(codePoint)) & 1)
jaroslav@68: != 0;
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Determines if the specified character is permissible as the first
jaroslav@68: * character in a Java identifier.
jaroslav@68: *
jaroslav@68: * A character may start a Java identifier if and only if
jaroslav@68: * one of the following is true:
jaroslav@68: *
jaroslav@68: * A character may be part of a Java identifier if and only if any
jaroslav@68: * of the following are true:
jaroslav@68: *
jaroslav@68: * A character is considered to be alphabetic if its general category type,
jaroslav@68: * provided by {@link Character#getType(int) getType(codePoint)}, is any of
jaroslav@68: * the following:
jaroslav@68: *
jaroslav@68: * A character may start a Java identifier if and only if
jaroslav@68: * one of the following conditions is true:
jaroslav@68: * Note: This method cannot handle supplementary characters. To support
jaroslav@68: * all Unicode characters, including supplementary characters, use
jaroslav@68: * the {@link #isJavaIdentifierStart(int)} method.
jaroslav@68: *
jaroslav@68: * @param ch the character to be tested.
jaroslav@68: * @return {@code true} if the character may start a Java identifier;
jaroslav@68: * {@code false} otherwise.
jaroslav@68: * @see Character#isJavaIdentifierPart(char)
jaroslav@68: * @see Character#isLetter(char)
jaroslav@68: * @see Character#isUnicodeIdentifierStart(char)
jaroslav@68: * @see javax.lang.model.SourceVersion#isIdentifier(CharSequence)
jaroslav@68: * @since 1.1
jaroslav@68: */
jaroslav@68: public static boolean isJavaIdentifierStart(char ch) {
jaroslav@68: return isJavaIdentifierStart((int)ch);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Determines if the character (Unicode code point) is
jaroslav@68: * permissible as the first character in a Java identifier.
jaroslav@68: *
jaroslav@68: * A character may start a Java identifier if and only if
jaroslav@68: * one of the following conditions is true:
jaroslav@68: *
jaroslav@68: * A character may be part of a Java identifier if any of the following
jaroslav@68: * are true:
jaroslav@68: * Note: This method cannot handle supplementary characters. To support
jaroslav@68: * all Unicode characters, including supplementary characters, use
jaroslav@68: * the {@link #isJavaIdentifierPart(int)} method.
jaroslav@68: *
jaroslav@68: * @param ch the character to be tested.
jaroslav@68: * @return {@code true} if the character may be part of a
jaroslav@68: * Java identifier; {@code false} otherwise.
jaroslav@68: * @see Character#isIdentifierIgnorable(char)
jaroslav@68: * @see Character#isJavaIdentifierStart(char)
jaroslav@68: * @see Character#isLetterOrDigit(char)
jaroslav@68: * @see Character#isUnicodeIdentifierPart(char)
jaroslav@68: * @see javax.lang.model.SourceVersion#isIdentifier(CharSequence)
jaroslav@68: * @since 1.1
jaroslav@68: */
jaroslav@68: public static boolean isJavaIdentifierPart(char ch) {
jaroslav@68: return isJavaIdentifierPart((int)ch);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Determines if the character (Unicode code point) may be part of a Java
jaroslav@68: * identifier as other than the first character.
jaroslav@68: *
jaroslav@68: * A character may be part of a Java identifier if any of the following
jaroslav@68: * are true:
jaroslav@68: *
jaroslav@68: * A character may start a Unicode identifier if and only if
jaroslav@68: * one of the following conditions is true:
jaroslav@68: * Note: This method cannot handle supplementary characters. To support
jaroslav@68: * all Unicode characters, including supplementary characters, use
jaroslav@68: * the {@link #isUnicodeIdentifierStart(int)} method.
jaroslav@68: *
jaroslav@68: * @param ch the character to be tested.
jaroslav@68: * @return {@code true} if the character may start a Unicode
jaroslav@68: * identifier; {@code false} otherwise.
jaroslav@68: * @see Character#isJavaIdentifierStart(char)
jaroslav@68: * @see Character#isLetter(char)
jaroslav@68: * @see Character#isUnicodeIdentifierPart(char)
jaroslav@68: * @since 1.1
jaroslav@68: */
jaroslav@68: public static boolean isUnicodeIdentifierStart(char ch) {
jaroslav@68: return isUnicodeIdentifierStart((int)ch);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Determines if the specified character (Unicode code point) is permissible as the
jaroslav@68: * first character in a Unicode identifier.
jaroslav@68: *
jaroslav@68: * A character may start a Unicode identifier if and only if
jaroslav@68: * one of the following conditions is true:
jaroslav@68: *
jaroslav@68: * A character may be part of a Unicode identifier if and only if
jaroslav@68: * one of the following statements is true:
jaroslav@68: * Note: This method cannot handle supplementary characters. To support
jaroslav@68: * all Unicode characters, including supplementary characters, use
jaroslav@68: * the {@link #isUnicodeIdentifierPart(int)} method.
jaroslav@68: *
jaroslav@68: * @param ch the character to be tested.
jaroslav@68: * @return {@code true} if the character may be part of a
jaroslav@68: * Unicode identifier; {@code false} otherwise.
jaroslav@68: * @see Character#isIdentifierIgnorable(char)
jaroslav@68: * @see Character#isJavaIdentifierPart(char)
jaroslav@68: * @see Character#isLetterOrDigit(char)
jaroslav@68: * @see Character#isUnicodeIdentifierStart(char)
jaroslav@68: * @since 1.1
jaroslav@68: */
jaroslav@68: public static boolean isUnicodeIdentifierPart(char ch) {
jaroslav@68: return isUnicodeIdentifierPart((int)ch);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Determines if the specified character (Unicode code point) may be part of a Unicode
jaroslav@68: * identifier as other than the first character.
jaroslav@68: *
jaroslav@68: * A character may be part of a Unicode identifier if and only if
jaroslav@68: * one of the following statements is true:
jaroslav@68: *
jaroslav@68: * The following Unicode characters are ignorable in a Java identifier
jaroslav@68: * or a Unicode identifier:
jaroslav@68: * Note: This method cannot handle supplementary characters. To support
jaroslav@68: * all Unicode characters, including supplementary characters, use
jaroslav@68: * the {@link #isIdentifierIgnorable(int)} method.
jaroslav@68: *
jaroslav@68: * @param ch the character to be tested.
jaroslav@68: * @return {@code true} if the character is an ignorable control
jaroslav@68: * character that may be part of a Java or Unicode identifier;
jaroslav@68: * {@code false} otherwise.
jaroslav@68: * @see Character#isJavaIdentifierPart(char)
jaroslav@68: * @see Character#isUnicodeIdentifierPart(char)
jaroslav@68: * @since 1.1
jaroslav@68: */
jaroslav@68: public static boolean isIdentifierIgnorable(char ch) {
jaroslav@68: return isIdentifierIgnorable((int)ch);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Determines if the specified character (Unicode code point) should be regarded as
jaroslav@68: * an ignorable character in a Java identifier or a Unicode identifier.
jaroslav@68: *
jaroslav@68: * The following Unicode characters are ignorable in a Java identifier
jaroslav@68: * or a Unicode identifier:
jaroslav@68: *
jaroslav@68: * Note that
jaroslav@68: * {@code Character.isLowerCase(Character.toLowerCase(ch))}
jaroslav@68: * does not always return {@code true} for some ranges of
jaroslav@68: * characters, particularly those that are symbols or ideographs.
jaroslav@68: *
jaroslav@68: * In general, {@link String#toLowerCase()} should be used to map
jaroslav@68: * characters to lowercase. {@code String} case mapping methods
jaroslav@68: * have several benefits over {@code Character} case mapping methods.
jaroslav@68: * {@code String} case mapping methods can perform locale-sensitive
jaroslav@68: * mappings, context-sensitive mappings, and 1:M character mappings, whereas
jaroslav@68: * the {@code Character} case mapping methods cannot.
jaroslav@68: *
jaroslav@68: * Note: This method cannot handle supplementary characters. To support
jaroslav@68: * all Unicode characters, including supplementary characters, use
jaroslav@68: * the {@link #toLowerCase(int)} method.
jaroslav@68: *
jaroslav@68: * @param ch the character to be converted.
jaroslav@68: * @return the lowercase equivalent of the character, if any;
jaroslav@68: * otherwise, the character itself.
jaroslav@68: * @see Character#isLowerCase(char)
jaroslav@68: * @see String#toLowerCase()
jaroslav@68: */
jaroslav@68: public static char toLowerCase(char ch) {
jaroslav@68: return (char)toLowerCase((int)ch);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Converts the character (Unicode code point) argument to
jaroslav@68: * lowercase using case mapping information from the UnicodeData
jaroslav@68: * file.
jaroslav@68: *
jaroslav@68: * Note that
jaroslav@68: * {@code Character.isLowerCase(Character.toLowerCase(codePoint))}
jaroslav@68: * does not always return {@code true} for some ranges of
jaroslav@68: * characters, particularly those that are symbols or ideographs.
jaroslav@68: *
jaroslav@68: * In general, {@link String#toLowerCase()} should be used to map
jaroslav@68: * characters to lowercase. {@code String} case mapping methods
jaroslav@68: * have several benefits over {@code Character} case mapping methods.
jaroslav@68: * {@code String} case mapping methods can perform locale-sensitive
jaroslav@68: * mappings, context-sensitive mappings, and 1:M character mappings, whereas
jaroslav@68: * the {@code Character} case mapping methods cannot.
jaroslav@68: *
jaroslav@68: * @param codePoint the character (Unicode code point) to be converted.
jaroslav@68: * @return the lowercase equivalent of the character (Unicode code
jaroslav@68: * point), if any; otherwise, the character itself.
jaroslav@68: * @see Character#isLowerCase(int)
jaroslav@68: * @see String#toLowerCase()
jaroslav@68: *
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static int toLowerCase(int codePoint) {
jaroslav@68: return CharacterData.of(codePoint).toLowerCase(codePoint);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Converts the character argument to uppercase using case mapping
jaroslav@68: * information from the UnicodeData file.
jaroslav@68: *
jaroslav@68: * Note that
jaroslav@68: * {@code Character.isUpperCase(Character.toUpperCase(ch))}
jaroslav@68: * does not always return {@code true} for some ranges of
jaroslav@68: * characters, particularly those that are symbols or ideographs.
jaroslav@68: *
jaroslav@68: * In general, {@link String#toUpperCase()} should be used to map
jaroslav@68: * characters to uppercase. {@code String} case mapping methods
jaroslav@68: * have several benefits over {@code Character} case mapping methods.
jaroslav@68: * {@code String} case mapping methods can perform locale-sensitive
jaroslav@68: * mappings, context-sensitive mappings, and 1:M character mappings, whereas
jaroslav@68: * the {@code Character} case mapping methods cannot.
jaroslav@68: *
jaroslav@68: * Note: This method cannot handle supplementary characters. To support
jaroslav@68: * all Unicode characters, including supplementary characters, use
jaroslav@68: * the {@link #toUpperCase(int)} method.
jaroslav@68: *
jaroslav@68: * @param ch the character to be converted.
jaroslav@68: * @return the uppercase equivalent of the character, if any;
jaroslav@68: * otherwise, the character itself.
jaroslav@68: * @see Character#isUpperCase(char)
jaroslav@68: * @see String#toUpperCase()
jaroslav@68: */
jaroslav@68: public static char toUpperCase(char ch) {
jaroslav@68: return (char)toUpperCase((int)ch);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Converts the character (Unicode code point) argument to
jaroslav@68: * uppercase using case mapping information from the UnicodeData
jaroslav@68: * file.
jaroslav@68: *
jaroslav@68: * Note that
jaroslav@68: * {@code Character.isUpperCase(Character.toUpperCase(codePoint))}
jaroslav@68: * does not always return {@code true} for some ranges of
jaroslav@68: * characters, particularly those that are symbols or ideographs.
jaroslav@68: *
jaroslav@68: * In general, {@link String#toUpperCase()} should be used to map
jaroslav@68: * characters to uppercase. {@code String} case mapping methods
jaroslav@68: * have several benefits over {@code Character} case mapping methods.
jaroslav@68: * {@code String} case mapping methods can perform locale-sensitive
jaroslav@68: * mappings, context-sensitive mappings, and 1:M character mappings, whereas
jaroslav@68: * the {@code Character} case mapping methods cannot.
jaroslav@68: *
jaroslav@68: * @param codePoint the character (Unicode code point) to be converted.
jaroslav@68: * @return the uppercase equivalent of the character, if any;
jaroslav@68: * otherwise, the character itself.
jaroslav@68: * @see Character#isUpperCase(int)
jaroslav@68: * @see String#toUpperCase()
jaroslav@68: *
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static int toUpperCase(int codePoint) {
jaroslav@68: return CharacterData.of(codePoint).toUpperCase(codePoint);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Converts the character argument to titlecase using case mapping
jaroslav@68: * information from the UnicodeData file. If a character has no
jaroslav@68: * explicit titlecase mapping and is not itself a titlecase char
jaroslav@68: * according to UnicodeData, then the uppercase mapping is
jaroslav@68: * returned as an equivalent titlecase mapping. If the
jaroslav@68: * {@code char} argument is already a titlecase
jaroslav@68: * {@code char}, the same {@code char} value will be
jaroslav@68: * returned.
jaroslav@68: *
jaroslav@68: * Note that
jaroslav@68: * {@code Character.isTitleCase(Character.toTitleCase(ch))}
jaroslav@68: * does not always return {@code true} for some ranges of
jaroslav@68: * characters.
jaroslav@68: *
jaroslav@68: * Note: This method cannot handle supplementary characters. To support
jaroslav@68: * all Unicode characters, including supplementary characters, use
jaroslav@68: * the {@link #toTitleCase(int)} method.
jaroslav@68: *
jaroslav@68: * @param ch the character to be converted.
jaroslav@68: * @return the titlecase equivalent of the character, if any;
jaroslav@68: * otherwise, the character itself.
jaroslav@68: * @see Character#isTitleCase(char)
jaroslav@68: * @see Character#toLowerCase(char)
jaroslav@68: * @see Character#toUpperCase(char)
jaroslav@68: * @since 1.0.2
jaroslav@68: */
jaroslav@68: public static char toTitleCase(char ch) {
jaroslav@68: return (char)toTitleCase((int)ch);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Converts the character (Unicode code point) argument to titlecase using case mapping
jaroslav@68: * information from the UnicodeData file. If a character has no
jaroslav@68: * explicit titlecase mapping and is not itself a titlecase char
jaroslav@68: * according to UnicodeData, then the uppercase mapping is
jaroslav@68: * returned as an equivalent titlecase mapping. If the
jaroslav@68: * character argument is already a titlecase
jaroslav@68: * character, the same character value will be
jaroslav@68: * returned.
jaroslav@68: *
jaroslav@68: * Note that
jaroslav@68: * {@code Character.isTitleCase(Character.toTitleCase(codePoint))}
jaroslav@68: * does not always return {@code true} for some ranges of
jaroslav@68: * characters.
jaroslav@68: *
jaroslav@68: * @param codePoint the character (Unicode code point) to be converted.
jaroslav@68: * @return the titlecase equivalent of the character, if any;
jaroslav@68: * otherwise, the character itself.
jaroslav@68: * @see Character#isTitleCase(int)
jaroslav@68: * @see Character#toLowerCase(int)
jaroslav@68: * @see Character#toUpperCase(int)
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static int toTitleCase(int codePoint) {
jaroslav@68: return CharacterData.of(codePoint).toTitleCase(codePoint);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Returns the numeric value of the character {@code ch} in the
jaroslav@68: * specified radix.
jaroslav@68: *
jaroslav@68: * If the radix is not in the range {@code MIN_RADIX} ≤
jaroslav@68: * {@code radix} ≤ {@code MAX_RADIX} or if the
jaroslav@68: * value of {@code ch} is not a valid digit in the specified
jaroslav@68: * radix, {@code -1} is returned. A character is a valid digit
jaroslav@68: * if at least one of the following is true:
jaroslav@68: * Note: This method cannot handle supplementary characters. To support
jaroslav@68: * all Unicode characters, including supplementary characters, use
jaroslav@68: * the {@link #digit(int, int)} method.
jaroslav@68: *
jaroslav@68: * @param ch the character to be converted.
jaroslav@68: * @param radix the radix.
jaroslav@68: * @return the numeric value represented by the character in the
jaroslav@68: * specified radix.
jaroslav@68: * @see Character#forDigit(int, int)
jaroslav@68: * @see Character#isDigit(char)
jaroslav@68: */
jaroslav@68: public static int digit(char ch, int radix) {
jaroslav@68: return digit((int)ch, radix);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Returns the numeric value of the specified character (Unicode
jaroslav@68: * code point) in the specified radix.
jaroslav@68: *
jaroslav@68: * If the radix is not in the range {@code MIN_RADIX} ≤
jaroslav@68: * {@code radix} ≤ {@code MAX_RADIX} or if the
jaroslav@68: * character is not a valid digit in the specified
jaroslav@68: * radix, {@code -1} is returned. A character is a valid digit
jaroslav@68: * if at least one of the following is true:
jaroslav@68: *
jaroslav@68: * The letters A-Z in their uppercase ({@code '\u005Cu0041'} through
jaroslav@68: * {@code '\u005Cu005A'}), lowercase
jaroslav@68: * ({@code '\u005Cu0061'} through {@code '\u005Cu007A'}), and
jaroslav@68: * full width variant ({@code '\u005CuFF21'} through
jaroslav@68: * {@code '\u005CuFF3A'} and {@code '\u005CuFF41'} through
jaroslav@68: * {@code '\u005CuFF5A'}) forms have numeric values from 10
jaroslav@68: * through 35. This is independent of the Unicode specification,
jaroslav@68: * which does not assign numeric values to these {@code char}
jaroslav@68: * values.
jaroslav@68: *
jaroslav@68: * If the character does not have a numeric value, then -1 is returned.
jaroslav@68: * If the character has a numeric value that cannot be represented as a
jaroslav@68: * nonnegative integer (for example, a fractional value), then -2
jaroslav@68: * is returned.
jaroslav@68: *
jaroslav@68: * Note: This method cannot handle supplementary characters. To support
jaroslav@68: * all Unicode characters, including supplementary characters, use
jaroslav@68: * the {@link #getNumericValue(int)} method.
jaroslav@68: *
jaroslav@68: * @param ch the character to be converted.
jaroslav@68: * @return the numeric value of the character, as a nonnegative {@code int}
jaroslav@68: * value; -2 if the character has a numeric value that is not a
jaroslav@68: * nonnegative integer; -1 if the character has no numeric value.
jaroslav@68: * @see Character#forDigit(int, int)
jaroslav@68: * @see Character#isDigit(char)
jaroslav@68: * @since 1.1
jaroslav@68: */
jaroslav@68: public static int getNumericValue(char ch) {
jaroslav@68: return getNumericValue((int)ch);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Returns the {@code int} value that the specified
jaroslav@68: * character (Unicode code point) represents. For example, the character
jaroslav@68: * {@code '\u005Cu216C'} (the Roman numeral fifty) will return
jaroslav@68: * an {@code int} with a value of 50.
jaroslav@68: *
jaroslav@68: * The letters A-Z in their uppercase ({@code '\u005Cu0041'} through
jaroslav@68: * {@code '\u005Cu005A'}), lowercase
jaroslav@68: * ({@code '\u005Cu0061'} through {@code '\u005Cu007A'}), and
jaroslav@68: * full width variant ({@code '\u005CuFF21'} through
jaroslav@68: * {@code '\u005CuFF3A'} and {@code '\u005CuFF41'} through
jaroslav@68: * {@code '\u005CuFF5A'}) forms have numeric values from 10
jaroslav@68: * through 35. This is independent of the Unicode specification,
jaroslav@68: * which does not assign numeric values to these {@code char}
jaroslav@68: * values.
jaroslav@68: *
jaroslav@68: * If the character does not have a numeric value, then -1 is returned.
jaroslav@68: * If the character has a numeric value that cannot be represented as a
jaroslav@68: * nonnegative integer (for example, a fractional value), then -2
jaroslav@68: * is returned.
jaroslav@68: *
jaroslav@68: * @param codePoint the character (Unicode code point) to be converted.
jaroslav@68: * @return the numeric value of the character, as a nonnegative {@code int}
jaroslav@68: * value; -2 if the character has a numeric value that is not a
jaroslav@68: * nonnegative integer; -1 if the character has no numeric value.
jaroslav@68: * @see Character#forDigit(int, int)
jaroslav@68: * @see Character#isDigit(int)
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static int getNumericValue(int codePoint) {
jaroslav@68: return CharacterData.of(codePoint).getNumericValue(codePoint);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Determines if the specified character is ISO-LATIN-1 white space.
jaroslav@68: * This method returns {@code true} for the following five
jaroslav@68: * characters only:
jaroslav@68: * Note: This method cannot handle supplementary characters. To support
jaroslav@68: * all Unicode characters, including supplementary characters, use
jaroslav@68: * the {@link #isSpaceChar(int)} method.
jaroslav@68: *
jaroslav@68: * @param ch the character to be tested.
jaroslav@68: * @return {@code true} if the character is a space character;
jaroslav@68: * {@code false} otherwise.
jaroslav@68: * @see Character#isWhitespace(char)
jaroslav@68: * @since 1.1
jaroslav@68: */
jaroslav@68: public static boolean isSpaceChar(char ch) {
jaroslav@68: return isSpaceChar((int)ch);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Determines if the specified character (Unicode code point) is a
jaroslav@68: * Unicode space character. A character is considered to be a
jaroslav@68: * space character if and only if it is specified to be a space
jaroslav@68: * character by the Unicode Standard. This method returns true if
jaroslav@68: * the character's general category type is any of the following:
jaroslav@68: *
jaroslav@68: * Note: This method cannot handle supplementary characters. To support
jaroslav@68: * all Unicode characters, including supplementary characters, use
jaroslav@68: * the {@link #isWhitespace(int)} method.
jaroslav@68: *
jaroslav@68: * @param ch the character to be tested.
jaroslav@68: * @return {@code true} if the character is a Java whitespace
jaroslav@68: * character; {@code false} otherwise.
jaroslav@68: * @see Character#isSpaceChar(char)
jaroslav@68: * @since 1.1
jaroslav@68: */
jaroslav@68: public static boolean isWhitespace(char ch) {
jaroslav@68: return isWhitespace((int)ch);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Determines if the specified character (Unicode code point) is
jaroslav@68: * white space according to Java. A character is a Java
jaroslav@68: * whitespace character if and only if it satisfies one of the
jaroslav@68: * following criteria:
jaroslav@68: *
jaroslav@68: *
jaroslav@68: * @param codePoint the character (Unicode code point) to be tested.
jaroslav@68: * @return {@code true} if the character is a Java whitespace
jaroslav@68: * character; {@code false} otherwise.
jaroslav@68: * @see Character#isSpaceChar(int)
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static boolean isWhitespace(int codePoint) {
jaroslav@68: return CharacterData.of(codePoint).isWhitespace(codePoint);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Determines if the specified character is an ISO control
jaroslav@68: * character. A character is considered to be an ISO control
jaroslav@68: * character if its code is in the range {@code '\u005Cu0000'}
jaroslav@68: * through {@code '\u005Cu001F'} or in the range
jaroslav@68: * {@code '\u005Cu007F'} through {@code '\u005Cu009F'}.
jaroslav@68: *
jaroslav@68: * Note: This method cannot handle supplementary characters. To support
jaroslav@68: * all Unicode characters, including supplementary characters, use
jaroslav@68: * the {@link #isISOControl(int)} method.
jaroslav@68: *
jaroslav@68: * @param ch the character to be tested.
jaroslav@68: * @return {@code true} if the character is an ISO control character;
jaroslav@68: * {@code false} otherwise.
jaroslav@68: *
jaroslav@68: * @see Character#isSpaceChar(char)
jaroslav@68: * @see Character#isWhitespace(char)
jaroslav@68: * @since 1.1
jaroslav@68: */
jaroslav@68: public static boolean isISOControl(char ch) {
jaroslav@68: return isISOControl((int)ch);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Determines if the referenced character (Unicode code point) is an ISO control
jaroslav@68: * character. A character is considered to be an ISO control
jaroslav@68: * character if its code is in the range {@code '\u005Cu0000'}
jaroslav@68: * through {@code '\u005Cu001F'} or in the range
jaroslav@68: * {@code '\u005Cu007F'} through {@code '\u005Cu009F'}.
jaroslav@68: *
jaroslav@68: * @param codePoint the character (Unicode code point) to be tested.
jaroslav@68: * @return {@code true} if the character is an ISO control character;
jaroslav@68: * {@code false} otherwise.
jaroslav@68: * @see Character#isSpaceChar(int)
jaroslav@68: * @see Character#isWhitespace(int)
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static boolean isISOControl(int codePoint) {
jaroslav@68: // Optimized form of:
jaroslav@68: // (codePoint >= 0x00 && codePoint <= 0x1F) ||
jaroslav@68: // (codePoint >= 0x7F && codePoint <= 0x9F);
jaroslav@68: return codePoint <= 0x9F &&
jaroslav@68: (codePoint >= 0x7F || (codePoint >>> 5 == 0));
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Returns a value indicating a character's general category.
jaroslav@68: *
jaroslav@68: * Note: This method cannot handle supplementary characters. To support
jaroslav@68: * all Unicode characters, including supplementary characters, use
jaroslav@68: * the {@link #getType(int)} method.
jaroslav@68: *
jaroslav@68: * @param ch the character to be tested.
jaroslav@68: * @return a value of type {@code int} representing the
jaroslav@68: * character's general category.
jaroslav@68: * @see Character#COMBINING_SPACING_MARK
jaroslav@68: * @see Character#CONNECTOR_PUNCTUATION
jaroslav@68: * @see Character#CONTROL
jaroslav@68: * @see Character#CURRENCY_SYMBOL
jaroslav@68: * @see Character#DASH_PUNCTUATION
jaroslav@68: * @see Character#DECIMAL_DIGIT_NUMBER
jaroslav@68: * @see Character#ENCLOSING_MARK
jaroslav@68: * @see Character#END_PUNCTUATION
jaroslav@68: * @see Character#FINAL_QUOTE_PUNCTUATION
jaroslav@68: * @see Character#FORMAT
jaroslav@68: * @see Character#INITIAL_QUOTE_PUNCTUATION
jaroslav@68: * @see Character#LETTER_NUMBER
jaroslav@68: * @see Character#LINE_SEPARATOR
jaroslav@68: * @see Character#LOWERCASE_LETTER
jaroslav@68: * @see Character#MATH_SYMBOL
jaroslav@68: * @see Character#MODIFIER_LETTER
jaroslav@68: * @see Character#MODIFIER_SYMBOL
jaroslav@68: * @see Character#NON_SPACING_MARK
jaroslav@68: * @see Character#OTHER_LETTER
jaroslav@68: * @see Character#OTHER_NUMBER
jaroslav@68: * @see Character#OTHER_PUNCTUATION
jaroslav@68: * @see Character#OTHER_SYMBOL
jaroslav@68: * @see Character#PARAGRAPH_SEPARATOR
jaroslav@68: * @see Character#PRIVATE_USE
jaroslav@68: * @see Character#SPACE_SEPARATOR
jaroslav@68: * @see Character#START_PUNCTUATION
jaroslav@68: * @see Character#SURROGATE
jaroslav@68: * @see Character#TITLECASE_LETTER
jaroslav@68: * @see Character#UNASSIGNED
jaroslav@68: * @see Character#UPPERCASE_LETTER
jaroslav@68: * @since 1.1
jaroslav@68: */
jaroslav@68: public static int getType(char ch) {
jaroslav@68: return getType((int)ch);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Returns a value indicating a character's general category.
jaroslav@68: *
jaroslav@68: * @param codePoint the character (Unicode code point) to be tested.
jaroslav@68: * @return a value of type {@code int} representing the
jaroslav@68: * character's general category.
jaroslav@68: * @see Character#COMBINING_SPACING_MARK COMBINING_SPACING_MARK
jaroslav@68: * @see Character#CONNECTOR_PUNCTUATION CONNECTOR_PUNCTUATION
jaroslav@68: * @see Character#CONTROL CONTROL
jaroslav@68: * @see Character#CURRENCY_SYMBOL CURRENCY_SYMBOL
jaroslav@68: * @see Character#DASH_PUNCTUATION DASH_PUNCTUATION
jaroslav@68: * @see Character#DECIMAL_DIGIT_NUMBER DECIMAL_DIGIT_NUMBER
jaroslav@68: * @see Character#ENCLOSING_MARK ENCLOSING_MARK
jaroslav@68: * @see Character#END_PUNCTUATION END_PUNCTUATION
jaroslav@68: * @see Character#FINAL_QUOTE_PUNCTUATION FINAL_QUOTE_PUNCTUATION
jaroslav@68: * @see Character#FORMAT FORMAT
jaroslav@68: * @see Character#INITIAL_QUOTE_PUNCTUATION INITIAL_QUOTE_PUNCTUATION
jaroslav@68: * @see Character#LETTER_NUMBER LETTER_NUMBER
jaroslav@68: * @see Character#LINE_SEPARATOR LINE_SEPARATOR
jaroslav@68: * @see Character#LOWERCASE_LETTER LOWERCASE_LETTER
jaroslav@68: * @see Character#MATH_SYMBOL MATH_SYMBOL
jaroslav@68: * @see Character#MODIFIER_LETTER MODIFIER_LETTER
jaroslav@68: * @see Character#MODIFIER_SYMBOL MODIFIER_SYMBOL
jaroslav@68: * @see Character#NON_SPACING_MARK NON_SPACING_MARK
jaroslav@68: * @see Character#OTHER_LETTER OTHER_LETTER
jaroslav@68: * @see Character#OTHER_NUMBER OTHER_NUMBER
jaroslav@68: * @see Character#OTHER_PUNCTUATION OTHER_PUNCTUATION
jaroslav@68: * @see Character#OTHER_SYMBOL OTHER_SYMBOL
jaroslav@68: * @see Character#PARAGRAPH_SEPARATOR PARAGRAPH_SEPARATOR
jaroslav@68: * @see Character#PRIVATE_USE PRIVATE_USE
jaroslav@68: * @see Character#SPACE_SEPARATOR SPACE_SEPARATOR
jaroslav@68: * @see Character#START_PUNCTUATION START_PUNCTUATION
jaroslav@68: * @see Character#SURROGATE SURROGATE
jaroslav@68: * @see Character#TITLECASE_LETTER TITLECASE_LETTER
jaroslav@68: * @see Character#UNASSIGNED UNASSIGNED
jaroslav@68: * @see Character#UPPERCASE_LETTER UPPERCASE_LETTER
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static int getType(int codePoint) {
jaroslav@68: return CharacterData.of(codePoint).getType(codePoint);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Determines the character representation for a specific digit in
jaroslav@68: * the specified radix. If the value of {@code radix} is not a
jaroslav@68: * valid radix, or the value of {@code digit} is not a valid
jaroslav@68: * digit in the specified radix, the null character
jaroslav@68: * ({@code '\u005Cu0000'}) is returned.
jaroslav@68: *
jaroslav@68: * The {@code radix} argument is valid if it is greater than or
jaroslav@68: * equal to {@code MIN_RADIX} and less than or equal to
jaroslav@68: * {@code MAX_RADIX}. The {@code digit} argument is valid if
jaroslav@68: * {@code 0 <= digit < radix}.
jaroslav@68: *
jaroslav@68: * If the digit is less than 10, then
jaroslav@68: * {@code '0' + digit} is returned. Otherwise, the value
jaroslav@68: * {@code 'a' + digit - 10} is returned.
jaroslav@68: *
jaroslav@68: * @param digit the number to convert to a character.
jaroslav@68: * @param radix the radix.
jaroslav@68: * @return the {@code char} representation of the specified digit
jaroslav@68: * in the specified radix.
jaroslav@68: * @see Character#MIN_RADIX
jaroslav@68: * @see Character#MAX_RADIX
jaroslav@68: * @see Character#digit(char, int)
jaroslav@68: */
jaroslav@68: public static char forDigit(int digit, int radix) {
jaroslav@68: if ((digit >= radix) || (digit < 0)) {
jaroslav@68: return '\0';
jaroslav@68: }
jaroslav@68: if ((radix < Character.MIN_RADIX) || (radix > Character.MAX_RADIX)) {
jaroslav@68: return '\0';
jaroslav@68: }
jaroslav@68: if (digit < 10) {
jaroslav@68: return (char)('0' + digit);
jaroslav@68: }
jaroslav@68: return (char)('a' - 10 + digit);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Returns the Unicode directionality property for the given
jaroslav@68: * character. Character directionality is used to calculate the
jaroslav@68: * visual ordering of text. The directionality value of undefined
jaroslav@68: * {@code char} values is {@code DIRECTIONALITY_UNDEFINED}.
jaroslav@68: *
jaroslav@68: * Note: This method cannot handle supplementary characters. To support
jaroslav@68: * all Unicode characters, including supplementary characters, use
jaroslav@68: * the {@link #getDirectionality(int)} method.
jaroslav@68: *
jaroslav@68: * @param ch {@code char} for which the directionality property
jaroslav@68: * is requested.
jaroslav@68: * @return the directionality property of the {@code char} value.
jaroslav@68: *
jaroslav@68: * @see Character#DIRECTIONALITY_UNDEFINED
jaroslav@68: * @see Character#DIRECTIONALITY_LEFT_TO_RIGHT
jaroslav@68: * @see Character#DIRECTIONALITY_RIGHT_TO_LEFT
jaroslav@68: * @see Character#DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC
jaroslav@68: * @see Character#DIRECTIONALITY_EUROPEAN_NUMBER
jaroslav@68: * @see Character#DIRECTIONALITY_EUROPEAN_NUMBER_SEPARATOR
jaroslav@68: * @see Character#DIRECTIONALITY_EUROPEAN_NUMBER_TERMINATOR
jaroslav@68: * @see Character#DIRECTIONALITY_ARABIC_NUMBER
jaroslav@68: * @see Character#DIRECTIONALITY_COMMON_NUMBER_SEPARATOR
jaroslav@68: * @see Character#DIRECTIONALITY_NONSPACING_MARK
jaroslav@68: * @see Character#DIRECTIONALITY_BOUNDARY_NEUTRAL
jaroslav@68: * @see Character#DIRECTIONALITY_PARAGRAPH_SEPARATOR
jaroslav@68: * @see Character#DIRECTIONALITY_SEGMENT_SEPARATOR
jaroslav@68: * @see Character#DIRECTIONALITY_WHITESPACE
jaroslav@68: * @see Character#DIRECTIONALITY_OTHER_NEUTRALS
jaroslav@68: * @see Character#DIRECTIONALITY_LEFT_TO_RIGHT_EMBEDDING
jaroslav@68: * @see Character#DIRECTIONALITY_LEFT_TO_RIGHT_OVERRIDE
jaroslav@68: * @see Character#DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING
jaroslav@68: * @see Character#DIRECTIONALITY_RIGHT_TO_LEFT_OVERRIDE
jaroslav@68: * @see Character#DIRECTIONALITY_POP_DIRECTIONAL_FORMAT
jaroslav@68: * @since 1.4
jaroslav@68: */
jaroslav@68: public static byte getDirectionality(char ch) {
jaroslav@68: return getDirectionality((int)ch);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Returns the Unicode directionality property for the given
jaroslav@68: * character (Unicode code point). Character directionality is
jaroslav@68: * used to calculate the visual ordering of text. The
jaroslav@68: * directionality value of undefined character is {@link
jaroslav@68: * #DIRECTIONALITY_UNDEFINED}.
jaroslav@68: *
jaroslav@68: * @param codePoint the character (Unicode code point) for which
jaroslav@68: * the directionality property is requested.
jaroslav@68: * @return the directionality property of the character.
jaroslav@68: *
jaroslav@68: * @see Character#DIRECTIONALITY_UNDEFINED DIRECTIONALITY_UNDEFINED
jaroslav@68: * @see Character#DIRECTIONALITY_LEFT_TO_RIGHT DIRECTIONALITY_LEFT_TO_RIGHT
jaroslav@68: * @see Character#DIRECTIONALITY_RIGHT_TO_LEFT DIRECTIONALITY_RIGHT_TO_LEFT
jaroslav@68: * @see Character#DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC
jaroslav@68: * @see Character#DIRECTIONALITY_EUROPEAN_NUMBER DIRECTIONALITY_EUROPEAN_NUMBER
jaroslav@68: * @see Character#DIRECTIONALITY_EUROPEAN_NUMBER_SEPARATOR DIRECTIONALITY_EUROPEAN_NUMBER_SEPARATOR
jaroslav@68: * @see Character#DIRECTIONALITY_EUROPEAN_NUMBER_TERMINATOR DIRECTIONALITY_EUROPEAN_NUMBER_TERMINATOR
jaroslav@68: * @see Character#DIRECTIONALITY_ARABIC_NUMBER DIRECTIONALITY_ARABIC_NUMBER
jaroslav@68: * @see Character#DIRECTIONALITY_COMMON_NUMBER_SEPARATOR DIRECTIONALITY_COMMON_NUMBER_SEPARATOR
jaroslav@68: * @see Character#DIRECTIONALITY_NONSPACING_MARK DIRECTIONALITY_NONSPACING_MARK
jaroslav@68: * @see Character#DIRECTIONALITY_BOUNDARY_NEUTRAL DIRECTIONALITY_BOUNDARY_NEUTRAL
jaroslav@68: * @see Character#DIRECTIONALITY_PARAGRAPH_SEPARATOR DIRECTIONALITY_PARAGRAPH_SEPARATOR
jaroslav@68: * @see Character#DIRECTIONALITY_SEGMENT_SEPARATOR DIRECTIONALITY_SEGMENT_SEPARATOR
jaroslav@68: * @see Character#DIRECTIONALITY_WHITESPACE DIRECTIONALITY_WHITESPACE
jaroslav@68: * @see Character#DIRECTIONALITY_OTHER_NEUTRALS DIRECTIONALITY_OTHER_NEUTRALS
jaroslav@68: * @see Character#DIRECTIONALITY_LEFT_TO_RIGHT_EMBEDDING DIRECTIONALITY_LEFT_TO_RIGHT_EMBEDDING
jaroslav@68: * @see Character#DIRECTIONALITY_LEFT_TO_RIGHT_OVERRIDE DIRECTIONALITY_LEFT_TO_RIGHT_OVERRIDE
jaroslav@68: * @see Character#DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING
jaroslav@68: * @see Character#DIRECTIONALITY_RIGHT_TO_LEFT_OVERRIDE DIRECTIONALITY_RIGHT_TO_LEFT_OVERRIDE
jaroslav@68: * @see Character#DIRECTIONALITY_POP_DIRECTIONAL_FORMAT DIRECTIONALITY_POP_DIRECTIONAL_FORMAT
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static byte getDirectionality(int codePoint) {
jaroslav@68: return CharacterData.of(codePoint).getDirectionality(codePoint);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Determines whether the character is mirrored according to the
jaroslav@68: * Unicode specification. Mirrored characters should have their
jaroslav@68: * glyphs horizontally mirrored when displayed in text that is
jaroslav@68: * right-to-left. For example, {@code '\u005Cu0028'} LEFT
jaroslav@68: * PARENTHESIS is semantically defined to be an opening
jaroslav@68: * parenthesis. This will appear as a "(" in text that is
jaroslav@68: * left-to-right but as a ")" in text that is right-to-left.
jaroslav@68: *
jaroslav@68: * Note: This method cannot handle supplementary characters. To support
jaroslav@68: * all Unicode characters, including supplementary characters, use
jaroslav@68: * the {@link #isMirrored(int)} method.
jaroslav@68: *
jaroslav@68: * @param ch {@code char} for which the mirrored property is requested
jaroslav@68: * @return {@code true} if the char is mirrored, {@code false}
jaroslav@68: * if the {@code char} is not mirrored or is not defined.
jaroslav@68: * @since 1.4
jaroslav@68: */
jaroslav@68: public static boolean isMirrored(char ch) {
jaroslav@68: return isMirrored((int)ch);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Determines whether the specified character (Unicode code point)
jaroslav@68: * is mirrored according to the Unicode specification. Mirrored
jaroslav@68: * characters should have their glyphs horizontally mirrored when
jaroslav@68: * displayed in text that is right-to-left. For example,
jaroslav@68: * {@code '\u005Cu0028'} LEFT PARENTHESIS is semantically
jaroslav@68: * defined to be an opening parenthesis. This will appear
jaroslav@68: * as a "(" in text that is left-to-right but as a ")" in text
jaroslav@68: * that is right-to-left.
jaroslav@68: *
jaroslav@68: * @param codePoint the character (Unicode code point) to be tested.
jaroslav@68: * @return {@code true} if the character is mirrored, {@code false}
jaroslav@68: * if the character is not mirrored or is not defined.
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static boolean isMirrored(int codePoint) {
jaroslav@68: return CharacterData.of(codePoint).isMirrored(codePoint);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Compares two {@code Character} objects numerically.
jaroslav@68: *
jaroslav@68: * @param anotherCharacter the {@code Character} to be compared.
jaroslav@68:
jaroslav@68: * @return the value {@code 0} if the argument {@code Character}
jaroslav@68: * is equal to this {@code Character}; a value less than
jaroslav@68: * {@code 0} if this {@code Character} is numerically less
jaroslav@68: * than the {@code Character} argument; and a value greater than
jaroslav@68: * {@code 0} if this {@code Character} is numerically greater
jaroslav@68: * than the {@code Character} argument (unsigned comparison).
jaroslav@68: * Note that this is strictly a numerical comparison; it is not
jaroslav@68: * locale-dependent.
jaroslav@68: * @since 1.2
jaroslav@68: */
jaroslav@68: public int compareTo(Character anotherCharacter) {
jaroslav@68: return compare(this.value, anotherCharacter.value);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Compares two {@code char} values numerically.
jaroslav@68: * The value returned is identical to what would be returned by:
jaroslav@68: *
jaroslav@68: *
jaroslav@68: * @param codePoint the character (Unicode code point) to be converted.
jaroslav@68: * @return either the uppercase equivalent of the character, if
jaroslav@68: * any, or an error flag ({@code Character.ERROR})
jaroslav@68: * that indicates that a 1:M {@code char} mapping exists.
jaroslav@68: * @see Character#isLowerCase(char)
jaroslav@68: * @see Character#isUpperCase(char)
jaroslav@68: * @see Character#toLowerCase(char)
jaroslav@68: * @see Character#toTitleCase(char)
jaroslav@68: * @since 1.4
jaroslav@68: */
jaroslav@68: static int toUpperCaseEx(int codePoint) {
jaroslav@68: assert isValidCodePoint(codePoint);
jaroslav@68: return CharacterData.of(codePoint).toUpperCaseEx(codePoint);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Converts the character (Unicode code point) argument to uppercase using case
jaroslav@68: * mapping information from the SpecialCasing file in the Unicode
jaroslav@68: * specification. If a character has no explicit uppercase
jaroslav@68: * mapping, then the {@code char} itself is returned in the
jaroslav@68: * {@code char[]}.
jaroslav@68: *
jaroslav@68: * @param codePoint the character (Unicode code point) to be converted.
jaroslav@68: * @return a {@code char[]} with the uppercased character.
jaroslav@68: * @since 1.4
jaroslav@68: */
jaroslav@68: static char[] toUpperCaseCharArray(int codePoint) {
jaroslav@68: // As of Unicode 6.0, 1:M uppercasings only happen in the BMP.
jaroslav@68: assert isBmpCodePoint(codePoint);
jaroslav@68: return CharacterData.of(codePoint).toUpperCaseCharArray(codePoint);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * The number of bits used to represent a char value in unsigned
jaroslav@68: * binary form, constant {@code 16}.
jaroslav@68: *
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static final int SIZE = 16;
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Returns the value obtained by reversing the order of the bytes in the
jaroslav@68: * specified char value.
jaroslav@68: *
jaroslav@68: * @return the value obtained by reversing (or, equivalently, swapping)
jaroslav@68: * the bytes in the specified char value.
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static char reverseBytes(char ch) {
jaroslav@68: return (char) (((ch & 0xFF00) >> 8) | (ch << 8));
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Returns the Unicode name of the specified character
jaroslav@68: * {@code codePoint}, or null if the code point is
jaroslav@68: * {@link #UNASSIGNED unassigned}.
jaroslav@68: *
jaroslav@68: * Note: if the specified character is not assigned a name by
jaroslav@68: * the UnicodeData file (part of the Unicode Character
jaroslav@68: * Database maintained by the Unicode Consortium), the returned
jaroslav@68: * name is the same as the result of expression.
jaroslav@68: *
jaroslav@68: *
jaroslav@68: *
jaroslav@68: * Finally, character case is ignored for all of the valid block name forms.
jaroslav@68: * For example, "BASIC_LATIN" and "basic_latin" are both valid block names.
jaroslav@68: * The en_US locale's case mapping rules are used to provide case-insensitive
jaroslav@68: * string comparisons for block name validation.
jaroslav@68: *
jaroslav@68: *
jaroslav@68: * @param high the high-surrogate code value to be tested
jaroslav@68: * @param low the low-surrogate code value to be tested
jaroslav@68: * @return {@code true} if the specified high and
jaroslav@68: * low-surrogate code values represent a valid surrogate pair;
jaroslav@68: * {@code false} otherwise.
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static boolean isSurrogatePair(char high, char low) {
jaroslav@68: return isHighSurrogate(high) && isLowSurrogate(low);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Determines the number of {@code char} values needed to
jaroslav@68: * represent the specified character (Unicode code point). If the
jaroslav@68: * specified character is equal to or greater than 0x10000, then
jaroslav@68: * the method returns 2. Otherwise, the method returns 1.
jaroslav@68: *
jaroslav@68: *
jaroslav@68: * isHighSurrogate(high) && isLowSurrogate(low)
jaroslav@68: *
jaroslav@68: *
jaroslav@68: * 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
jaroslav@68: * '\u00DF' '\u00E0' '\u00E1' '\u00E2' '\u00E3' '\u00E4' '\u00E5' '\u00E6'
jaroslav@68: * '\u00E7' '\u00E8' '\u00E9' '\u00EA' '\u00EB' '\u00EC' '\u00ED' '\u00EE'
jaroslav@68: * '\u00EF' '\u00F0' '\u00F1' '\u00F2' '\u00F3' '\u00F4' '\u00F5' '\u00F6'
jaroslav@68: * '\u00F8' '\u00F9' '\u00FA' '\u00FB' '\u00FC' '\u00FD' '\u00FE' '\u00FF'
jaroslav@68: *
jaroslav@68: *
jaroslav@68: * 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
jaroslav@68: * '\u00DF' '\u00E0' '\u00E1' '\u00E2' '\u00E3' '\u00E4' '\u00E5' '\u00E6'
jaroslav@68: * '\u00E7' '\u00E8' '\u00E9' '\u00EA' '\u00EB' '\u00EC' '\u00ED' '\u00EE'
jaroslav@68: * '\u00EF' '\u00F0' '\u00F1' '\u00F2' '\u00F3' '\u00F4' '\u00F5' '\u00F6'
jaroslav@68: * '\u00F8' '\u00F9' '\u00FA' '\u00FB' '\u00FC' '\u00FD' '\u00FE' '\u00FF'
jaroslav@68: *
jaroslav@68: *
jaroslav@68: * 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
jaroslav@68: * '\u00C0' '\u00C1' '\u00C2' '\u00C3' '\u00C4' '\u00C5' '\u00C6' '\u00C7'
jaroslav@68: * '\u00C8' '\u00C9' '\u00CA' '\u00CB' '\u00CC' '\u00CD' '\u00CE' '\u00CF'
jaroslav@68: * '\u00D0' '\u00D1' '\u00D2' '\u00D3' '\u00D4' '\u00D5' '\u00D6' '\u00D8'
jaroslav@68: * '\u00D9' '\u00DA' '\u00DB' '\u00DC' '\u00DD' '\u00DE'
jaroslav@68: *
jaroslav@68: *
jaroslav@68: * 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
jaroslav@68: * '\u00C0' '\u00C1' '\u00C2' '\u00C3' '\u00C4' '\u00C5' '\u00C6' '\u00C7'
jaroslav@68: * '\u00C8' '\u00C9' '\u00CA' '\u00CB' '\u00CC' '\u00CD' '\u00CE' '\u00CF'
jaroslav@68: * '\u00D0' '\u00D1' '\u00D2' '\u00D3' '\u00D4' '\u00D5' '\u00D6' '\u00D8'
jaroslav@68: * '\u00D9' '\u00DA' '\u00DB' '\u00DC' '\u00DD' '\u00DE'
jaroslav@68: *
jaroslav@68: *
jaroslav@68: *
jaroslav@68: *
jaroslav@68: *
jaroslav@68: *
jaroslav@68: *
jaroslav@68: * Many other character ranges contain digits as well.
jaroslav@68: *
jaroslav@68: *
jaroslav@68: *
jaroslav@68: *
jaroslav@68: * Many other character ranges contain digits as well.
jaroslav@68: *
jaroslav@68: * @param codePoint the character (Unicode code point) to be tested.
jaroslav@68: * @return {@code true} if the character is a digit;
jaroslav@68: * {@code false} otherwise.
jaroslav@68: * @see Character#forDigit(int, int)
jaroslav@68: * @see Character#getType(int)
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static boolean isDigit(int codePoint) {
jaroslav@68: return getType(codePoint) == Character.DECIMAL_DIGIT_NUMBER;
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Determines if a character is defined in Unicode.
jaroslav@68: *
jaroslav@68: *
jaroslav@68: *
jaroslav@68: *
jaroslav@68: *
jaroslav@68: *
jaroslav@68: * @param codePoint the character (Unicode code point) to be tested.
jaroslav@68: * @return {@code true} if the character has a defined meaning
jaroslav@68: * in Unicode; {@code false} otherwise.
jaroslav@68: * @see Character#isDigit(int)
jaroslav@68: * @see Character#isLetter(int)
jaroslav@68: * @see Character#isLetterOrDigit(int)
jaroslav@68: * @see Character#isLowerCase(int)
jaroslav@68: * @see Character#isTitleCase(int)
jaroslav@68: * @see Character#isUpperCase(int)
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static boolean isDefined(int codePoint) {
jaroslav@68: return getType(codePoint) != Character.UNASSIGNED;
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Determines if the specified character is a letter.
jaroslav@68: *
jaroslav@68: *
jaroslav@68: *
jaroslav@68: * Not all letters have case. Many characters are
jaroslav@68: * letters but are neither uppercase nor lowercase nor titlecase.
jaroslav@68: *
jaroslav@68: *
jaroslav@68: *
jaroslav@68: *
jaroslav@68: * Not all letters have case. Many characters are
jaroslav@68: * letters but are neither uppercase nor lowercase nor titlecase.
jaroslav@68: *
jaroslav@68: * @param codePoint the character (Unicode code point) to be tested.
jaroslav@68: * @return {@code true} if the character is a letter;
jaroslav@68: * {@code false} otherwise.
jaroslav@68: * @see Character#isDigit(int)
jaroslav@68: * @see Character#isJavaIdentifierStart(int)
jaroslav@68: * @see Character#isLetterOrDigit(int)
jaroslav@68: * @see Character#isLowerCase(int)
jaroslav@68: * @see Character#isTitleCase(int)
jaroslav@68: * @see Character#isUnicodeIdentifierStart(int)
jaroslav@68: * @see Character#isUpperCase(int)
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static boolean isLetter(int codePoint) {
jaroslav@68: return ((((1 << Character.UPPERCASE_LETTER) |
jaroslav@68: (1 << Character.LOWERCASE_LETTER) |
jaroslav@68: (1 << Character.TITLECASE_LETTER) |
jaroslav@68: (1 << Character.MODIFIER_LETTER) |
jaroslav@68: (1 << Character.OTHER_LETTER)) >> getType(codePoint)) & 1)
jaroslav@68: != 0;
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Determines if the specified character is a letter or digit.
jaroslav@68: *
jaroslav@68: *
jaroslav@68: *
jaroslav@68: * @param ch the character to be tested.
jaroslav@68: * @return {@code true} if the character may start a Java
jaroslav@68: * identifier; {@code false} otherwise.
jaroslav@68: * @see Character#isJavaLetterOrDigit(char)
jaroslav@68: * @see Character#isJavaIdentifierStart(char)
jaroslav@68: * @see Character#isJavaIdentifierPart(char)
jaroslav@68: * @see Character#isLetter(char)
jaroslav@68: * @see Character#isLetterOrDigit(char)
jaroslav@68: * @see Character#isUnicodeIdentifierStart(char)
jaroslav@68: * @since 1.02
jaroslav@68: * @deprecated Replaced by isJavaIdentifierStart(char).
jaroslav@68: */
jaroslav@68: @Deprecated
jaroslav@68: public static boolean isJavaLetter(char ch) {
jaroslav@68: return isJavaIdentifierStart(ch);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Determines if the specified character may be part of a Java
jaroslav@68: * identifier as other than the first character.
jaroslav@68: *
jaroslav@68: *
jaroslav@68: *
jaroslav@68: * @param ch the character to be tested.
jaroslav@68: * @return {@code true} if the character may be part of a
jaroslav@68: * Java identifier; {@code false} otherwise.
jaroslav@68: * @see Character#isJavaLetter(char)
jaroslav@68: * @see Character#isJavaIdentifierStart(char)
jaroslav@68: * @see Character#isJavaIdentifierPart(char)
jaroslav@68: * @see Character#isLetter(char)
jaroslav@68: * @see Character#isLetterOrDigit(char)
jaroslav@68: * @see Character#isUnicodeIdentifierPart(char)
jaroslav@68: * @see Character#isIdentifierIgnorable(char)
jaroslav@68: * @since 1.02
jaroslav@68: * @deprecated Replaced by isJavaIdentifierPart(char).
jaroslav@68: */
jaroslav@68: @Deprecated
jaroslav@68: public static boolean isJavaLetterOrDigit(char ch) {
jaroslav@68: return isJavaIdentifierPart(ch);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Determines if the specified character (Unicode code point) is an alphabet.
jaroslav@68: *
jaroslav@68: *
jaroslav@68: * or it has contributory property Other_Alphabetic as defined by the
jaroslav@68: * Unicode Standard.
jaroslav@68: *
jaroslav@68: * @param codePoint the character (Unicode code point) to be tested.
jaroslav@68: * @return UPPERCASE_LETTER
jaroslav@68: * LOWERCASE_LETTER
jaroslav@68: * TITLECASE_LETTER
jaroslav@68: * MODIFIER_LETTER
jaroslav@68: * OTHER_LETTER
jaroslav@68: * LETTER_NUMBER
jaroslav@68: * true
if the character is a Unicode alphabet
jaroslav@68: * character, false
otherwise.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static boolean isAlphabetic(int codePoint) {
jaroslav@68: return (((((1 << Character.UPPERCASE_LETTER) |
jaroslav@68: (1 << Character.LOWERCASE_LETTER) |
jaroslav@68: (1 << Character.TITLECASE_LETTER) |
jaroslav@68: (1 << Character.MODIFIER_LETTER) |
jaroslav@68: (1 << Character.OTHER_LETTER) |
jaroslav@68: (1 << Character.LETTER_NUMBER)) >> getType(codePoint)) & 1) != 0) ||
jaroslav@68: CharacterData.of(codePoint).isOtherAlphabetic(codePoint);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Determines if the specified character (Unicode code point) is a CJKV
jaroslav@68: * (Chinese, Japanese, Korean and Vietnamese) ideograph, as defined by
jaroslav@68: * the Unicode Standard.
jaroslav@68: *
jaroslav@68: * @param codePoint the character (Unicode code point) to be tested.
jaroslav@68: * @return true
if the character is a Unicode ideograph
jaroslav@68: * character, false
otherwise.
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static boolean isIdeographic(int codePoint) {
jaroslav@68: return CharacterData.of(codePoint).isIdeographic(codePoint);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Determines if the specified character is
jaroslav@68: * permissible as the first character in a Java identifier.
jaroslav@68: *
jaroslav@68: *
jaroslav@68: *
jaroslav@68: *
jaroslav@68: *
jaroslav@68: *
jaroslav@68: * @param codePoint the character (Unicode code point) to be tested.
jaroslav@68: * @return {@code true} if the character may start a Java identifier;
jaroslav@68: * {@code false} otherwise.
jaroslav@68: * @see Character#isJavaIdentifierPart(int)
jaroslav@68: * @see Character#isLetter(int)
jaroslav@68: * @see Character#isUnicodeIdentifierStart(int)
jaroslav@68: * @see javax.lang.model.SourceVersion#isIdentifier(CharSequence)
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static boolean isJavaIdentifierStart(int codePoint) {
jaroslav@68: return CharacterData.of(codePoint).isJavaIdentifierStart(codePoint);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Determines if the specified character may be part of a Java
jaroslav@68: * identifier as other than the first character.
jaroslav@68: *
jaroslav@68: *
jaroslav@68: *
jaroslav@68: *
jaroslav@68: *
jaroslav@68: *
jaroslav@68: * @param codePoint the character (Unicode code point) to be tested.
jaroslav@68: * @return {@code true} if the character may be part of a
jaroslav@68: * Java identifier; {@code false} otherwise.
jaroslav@68: * @see Character#isIdentifierIgnorable(int)
jaroslav@68: * @see Character#isJavaIdentifierStart(int)
jaroslav@68: * @see Character#isLetterOrDigit(int)
jaroslav@68: * @see Character#isUnicodeIdentifierPart(int)
jaroslav@68: * @see javax.lang.model.SourceVersion#isIdentifier(CharSequence)
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static boolean isJavaIdentifierPart(int codePoint) {
jaroslav@68: return CharacterData.of(codePoint).isJavaIdentifierPart(codePoint);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Determines if the specified character is permissible as the
jaroslav@68: * first character in a Unicode identifier.
jaroslav@68: *
jaroslav@68: *
jaroslav@68: *
jaroslav@68: *
jaroslav@68: *
jaroslav@68: * @param codePoint the character (Unicode code point) to be tested.
jaroslav@68: * @return {@code true} if the character may start a Unicode
jaroslav@68: * identifier; {@code false} otherwise.
jaroslav@68: * @see Character#isJavaIdentifierStart(int)
jaroslav@68: * @see Character#isLetter(int)
jaroslav@68: * @see Character#isUnicodeIdentifierPart(int)
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static boolean isUnicodeIdentifierStart(int codePoint) {
jaroslav@68: return CharacterData.of(codePoint).isUnicodeIdentifierStart(codePoint);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Determines if the specified character may be part of a Unicode
jaroslav@68: * identifier as other than the first character.
jaroslav@68: *
jaroslav@68: *
jaroslav@68: *
jaroslav@68: *
jaroslav@68: *
jaroslav@68: * @param codePoint the character (Unicode code point) to be tested.
jaroslav@68: * @return {@code true} if the character may be part of a
jaroslav@68: * Unicode identifier; {@code false} otherwise.
jaroslav@68: * @see Character#isIdentifierIgnorable(int)
jaroslav@68: * @see Character#isJavaIdentifierPart(int)
jaroslav@68: * @see Character#isLetterOrDigit(int)
jaroslav@68: * @see Character#isUnicodeIdentifierStart(int)
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static boolean isUnicodeIdentifierPart(int codePoint) {
jaroslav@68: return CharacterData.of(codePoint).isUnicodeIdentifierPart(codePoint);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Determines if the specified character should be regarded as
jaroslav@68: * an ignorable character in a Java identifier or a Unicode identifier.
jaroslav@68: *
jaroslav@68: *
jaroslav@68: *
jaroslav@68: *
jaroslav@68: *
jaroslav@68: *
jaroslav@68: *
jaroslav@68: *
jaroslav@68: *
jaroslav@68: * @param codePoint the character (Unicode code point) to be tested.
jaroslav@68: * @return {@code true} if the character is an ignorable control
jaroslav@68: * character that may be part of a Java or Unicode identifier;
jaroslav@68: * {@code false} otherwise.
jaroslav@68: * @see Character#isJavaIdentifierPart(int)
jaroslav@68: * @see Character#isUnicodeIdentifierPart(int)
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static boolean isIdentifierIgnorable(int codePoint) {
jaroslav@68: return CharacterData.of(codePoint).isIdentifierIgnorable(codePoint);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Converts the character argument to lowercase using case
jaroslav@68: * mapping information from the UnicodeData file.
jaroslav@68: *
jaroslav@68: *
jaroslav@68: *
jaroslav@68: *
jaroslav@68: *
jaroslav@68: *
jaroslav@68: *
jaroslav@68: *
jaroslav@68: *
jaroslav@68: * @param codePoint the character (Unicode code point) to be converted.
jaroslav@68: * @param radix the radix.
jaroslav@68: * @return the numeric value represented by the character in the
jaroslav@68: * specified radix.
jaroslav@68: * @see Character#forDigit(int, int)
jaroslav@68: * @see Character#isDigit(int)
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static int digit(int codePoint, int radix) {
jaroslav@68: return CharacterData.of(codePoint).digit(codePoint, radix);
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Returns the {@code int} value that the specified Unicode
jaroslav@68: * character represents. For example, the character
jaroslav@68: * {@code '\u005Cu216C'} (the roman numeral fifty) will return
jaroslav@68: * an int with a value of 50.
jaroslav@68: *
jaroslav@68: *
jaroslav@68: *
jaroslav@68: * @param ch the character to be tested.
jaroslav@68: * @return {@code true} if the character is ISO-LATIN-1 white
jaroslav@68: * space; {@code false} otherwise.
jaroslav@68: * @see Character#isSpaceChar(char)
jaroslav@68: * @see Character#isWhitespace(char)
jaroslav@68: * @deprecated Replaced by isWhitespace(char).
jaroslav@68: */
jaroslav@68: @Deprecated
jaroslav@68: public static boolean isSpace(char ch) {
jaroslav@68: return (ch <= 0x0020) &&
jaroslav@68: (((((1L << 0x0009) |
jaroslav@68: (1L << 0x000A) |
jaroslav@68: (1L << 0x000C) |
jaroslav@68: (1L << 0x000D) |
jaroslav@68: (1L << 0x0020)) >> ch) & 1L) != 0);
jaroslav@68: }
jaroslav@68:
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Determines if the specified character is a Unicode space character.
jaroslav@68: * A character is considered to be a space character if and only if
jaroslav@68: * it is specified to be a space character by the Unicode Standard. This
jaroslav@68: * method returns true if the character's general category type is any of
jaroslav@68: * the following:
jaroslav@68: *
jaroslav@68: * {@code '\t'} {@code U+0009}
jaroslav@68: * {@code HORIZONTAL TABULATION}
jaroslav@68: * {@code '\n'} {@code U+000A}
jaroslav@68: * {@code NEW LINE}
jaroslav@68: * {@code '\f'} {@code U+000C}
jaroslav@68: * {@code FORM FEED}
jaroslav@68: * {@code '\r'} {@code U+000D}
jaroslav@68: * {@code CARRIAGE RETURN}
jaroslav@68: * {@code ' '} {@code U+0020}
jaroslav@68: * {@code SPACE}
jaroslav@68: *
jaroslav@68: *
jaroslav@68: *
jaroslav@68: *
jaroslav@68: *
jaroslav@68: * @param codePoint the character (Unicode code point) to be tested.
jaroslav@68: * @return {@code true} if the character is a space character;
jaroslav@68: * {@code false} otherwise.
jaroslav@68: * @see Character#isWhitespace(int)
jaroslav@68: * @since 1.5
jaroslav@68: */
jaroslav@68: public static boolean isSpaceChar(int codePoint) {
jaroslav@68: return ((((1 << Character.SPACE_SEPARATOR) |
jaroslav@68: (1 << Character.LINE_SEPARATOR) |
jaroslav@68: (1 << Character.PARAGRAPH_SEPARATOR)) >> getType(codePoint)) & 1)
jaroslav@68: != 0;
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Determines if the specified character is white space according to Java.
jaroslav@68: * A character is a Java whitespace character if and only if it satisfies
jaroslav@68: * one of the following criteria:
jaroslav@68: *
jaroslav@68: *
jaroslav@68: *
jaroslav@68: *
jaroslav@68: *
jaroslav@68: *
jaroslav@68: * Character.valueOf(x).compareTo(Character.valueOf(y))
jaroslav@68: *
jaroslav@68: *
jaroslav@68: * @param x the first {@code char} to compare
jaroslav@68: * @param y the second {@code char} to compare
jaroslav@68: * @return the value {@code 0} if {@code x == y};
jaroslav@68: * a value less than {@code 0} if {@code x < y}; and
jaroslav@68: * a value greater than {@code 0} if {@code x > y}
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static int compare(char x, char y) {
jaroslav@68: return x - y;
jaroslav@68: }
jaroslav@68:
jaroslav@68: /**
jaroslav@68: * Converts the character (Unicode code point) argument to uppercase using
jaroslav@68: * information from the UnicodeData file.
jaroslav@68: * {@code
jaroslav@68: * Character.UnicodeBlock.of(codePoint).toString().replace('_', ' ')
jaroslav@68: * + " "
jaroslav@68: * + Integer.toHexString(codePoint).toUpperCase(Locale.ENGLISH);
jaroslav@68: *
jaroslav@68: * }
jaroslav@68: *
jaroslav@68: * @param codePoint the character (Unicode code point)
jaroslav@68: *
jaroslav@68: * @return the Unicode name of the specified character, or null if
jaroslav@68: * the code point is unassigned.
jaroslav@68: *
jaroslav@68: * @exception IllegalArgumentException if the specified
jaroslav@68: * {@code codePoint} is not a valid Unicode
jaroslav@68: * code point.
jaroslav@68: *
jaroslav@68: * @since 1.7
jaroslav@68: */
jaroslav@68: public static String getName(int codePoint) {
jaroslav@68: if (!isValidCodePoint(codePoint)) {
jaroslav@68: throw new IllegalArgumentException();
jaroslav@68: }
jaroslav@68: String name = CharacterName.get(codePoint);
jaroslav@68: if (name != null)
jaroslav@68: return name;
jaroslav@68: if (getType(codePoint) == UNASSIGNED)
jaroslav@68: return null;
jaroslav@68: UnicodeBlock block = UnicodeBlock.of(codePoint);
jaroslav@68: if (block != null)
jaroslav@68: return block.toString().replace('_', ' ') + " "
jaroslav@68: + Integer.toHexString(codePoint).toUpperCase(Locale.ENGLISH);
jaroslav@68: // should never come here
jaroslav@68: return Integer.toHexString(codePoint).toUpperCase(Locale.ENGLISH);
jaroslav@68: }
jaroslav@68: }