jdk/src/share/classes/java/lang/Character.java
author martin
Tue, 22 Sep 2009 18:30:58 -0700
changeset 3943 11abf5578222
parent 3942 685e04a98396
child 5506 202f599c92aa
child 5610 fd2427610c7f
permissions -rw-r--r--
6582946: Add suite of compare(T, T) methods for ints, longs etc Reviewed-by: darcy Contributed-by: kevinb@google.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
2497
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
     2
 * Copyright 2002-2009 Sun Microsystems, Inc.  All Rights Reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Sun designates this
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 * by Sun in the LICENSE file that accompanied this code.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 * CA 95054 USA or visit www.sun.com if you need additional information or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
 * have any questions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package java.lang;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
import java.util.Map;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import java.util.HashMap;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import java.util.Locale;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 * The <code>Character</code> class wraps a value of the primitive
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 * type <code>char</code> in an object. An object of type
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 * <code>Character</code> contains a single field whose type is
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 * <code>char</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 * In addition, this class provides several methods for determining
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 * a character's category (lowercase letter, digit, etc.) and for converting
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 * characters from uppercase to lowercase and vice versa.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 * <p>
3501
a3168c7b4011 6866243: Javadoc for java.lang.Character still refers to Unicode 4 instead of 5
peytoia
parents: 3224
diff changeset
    41
 * Character information is based on the Unicode Standard, version 5.1.0.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 * The methods and data of class <code>Character</code> are defined by
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 * the information in the <i>UnicodeData</i> file that is part of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 * Unicode Character Database maintained by the Unicode
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 * Consortium. This file specifies various properties including name
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
 * and general category for every defined Unicode code point or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
 * character range.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
 * The file and its description are available from the Unicode Consortium at:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
 * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
 * <li><a href="http://www.unicode.org">http://www.unicode.org</a>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
 * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
 * <h4><a name="unicode">Unicode Character Representations</a></h4>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
 * <p>The <code>char</code> data type (and therefore the value that a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
 * <code>Character</code> object encapsulates) are based on the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
 * original Unicode specification, which defined characters as
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
 * fixed-width 16-bit entities. The Unicode standard has since been
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
 * changed to allow for characters whose representation requires more
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
 * than 16 bits.  The range of legal <em>code point</em>s is now
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
 * U+0000 to U+10FFFF, known as <em>Unicode scalar value</em>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
 * (Refer to the <a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
 * href="http://www.unicode.org/reports/tr27/#notation"><i>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
 * definition</i></a> of the U+<i>n</i> notation in the Unicode
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
 * standard.)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
 * <p>The set of characters from U+0000 to U+FFFF is sometimes
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
 * referred to as the <em>Basic Multilingual Plane (BMP)</em>. <a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
 * name="supplementary">Characters</a> whose code points are greater
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
 * than U+FFFF are called <em>supplementary character</em>s.  The Java
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
 * 2 platform uses the UTF-16 representation in <code>char</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
 * arrays and in the <code>String</code> and <code>StringBuffer</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
 * classes. In this representation, supplementary characters are
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
 * represented as a pair of <code>char</code> values, the first from
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
 * the <em>high-surrogates</em> range, (&#92;uD800-&#92;uDBFF), the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
 * second from the <em>low-surrogates</em> range
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
 * (&#92;uDC00-&#92;uDFFF).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
 * <p>A <code>char</code> value, therefore, represents Basic
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
 * Multilingual Plane (BMP) code points, including the surrogate
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
 * code points, or code units of the UTF-16 encoding. An
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
 * <code>int</code> value represents all Unicode code points,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
 * including supplementary code points. The lower (least significant)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
 * 21 bits of <code>int</code> are used to represent Unicode code
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
 * points and the upper (most significant) 11 bits must be zero.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
 * Unless otherwise specified, the behavior with respect to
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
 * supplementary characters and surrogate <code>char</code> values is
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
 * as follows:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
 * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
 * <li>The methods that only accept a <code>char</code> value cannot support
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
 * supplementary characters. They treat <code>char</code> values from the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
 * surrogate ranges as undefined characters. For example,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
 * <code>Character.isLetter('&#92;uD840')</code> returns <code>false</code>, even though
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
 * this specific value if followed by any low-surrogate value in a string
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
 * would represent a letter.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
 * <li>The methods that accept an <code>int</code> value support all
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
 * Unicode characters, including supplementary characters. For
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
 * example, <code>Character.isLetter(0x2F81A)</code> returns
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
 * <code>true</code> because the code point value represents a letter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
 * (a CJK ideograph).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
 * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
 * <p>In the Java SE API documentation, <em>Unicode code point</em> is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
 * used for character values in the range between U+0000 and U+10FFFF,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
 * and <em>Unicode code unit</em> is used for 16-bit
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
 * <code>char</code> values that are code units of the <em>UTF-16</em>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
 * encoding. For more information on Unicode terminology, refer to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
 * <a href="http://www.unicode.org/glossary/">Unicode Glossary</a>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
 * @author  Lee Boynton
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
 * @author  Guy Steele
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
 * @author  Akira Tanaka
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
 * @since   1.0
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
public final
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
class Character extends Object implements java.io.Serializable, Comparable<Character> {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
     * The minimum radix available for conversion to and from strings.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
     * The constant value of this field is the smallest value permitted
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
     * for the radix argument in radix-conversion methods such as the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
     * <code>digit</code> method, the <code>forDigit</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
     * method, and the <code>toString</code> method of class
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
     * <code>Integer</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
     * @see     java.lang.Character#digit(char, int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
     * @see     java.lang.Character#forDigit(int, int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
     * @see     java.lang.Integer#toString(int, int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
     * @see     java.lang.Integer#valueOf(java.lang.String)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
    public static final int MIN_RADIX = 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
     * The maximum radix available for conversion to and from strings.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
     * The constant value of this field is the largest value permitted
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
     * for the radix argument in radix-conversion methods such as the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
     * <code>digit</code> method, the <code>forDigit</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
     * method, and the <code>toString</code> method of class
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
     * <code>Integer</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
     * @see     java.lang.Character#digit(char, int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
     * @see     java.lang.Character#forDigit(int, int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
     * @see     java.lang.Integer#toString(int, int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
     * @see     java.lang.Integer#valueOf(java.lang.String)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
    public static final int MAX_RADIX = 36;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
     * The constant value of this field is the smallest value of type
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
     * <code>char</code>, <code>'&#92;u0000'</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
     * @since   1.0.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
    public static final char   MIN_VALUE = '\u0000';
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
     * The constant value of this field is the largest value of type
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
     * <code>char</code>, <code>'&#92;uFFFF'</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
     * @since   1.0.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
     */
3714
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
   165
    public static final char   MAX_VALUE = '\uFFFF';
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
     * The <code>Class</code> instance representing the primitive type
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
     * <code>char</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
     * @since   1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
    public static final Class<Character> TYPE = Class.getPrimitiveClass("char");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
   /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
    * Normative general types
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
   /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
    * General character types
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
    * General category "Cn" in the Unicode specification.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
    * @since   1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
    public static final byte
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
        UNASSIGNED                  = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
    * General category "Lu" in the Unicode specification.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
    * @since   1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
    public static final byte
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
        UPPERCASE_LETTER            = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
    * General category "Ll" in the Unicode specification.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
    * @since   1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
    public static final byte
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
        LOWERCASE_LETTER            = 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
    * General category "Lt" in the Unicode specification.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
    * @since   1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
    public static final byte
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
        TITLECASE_LETTER            = 3;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
    * General category "Lm" in the Unicode specification.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
    * @since   1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
    public static final byte
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
        MODIFIER_LETTER             = 4;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
    * General category "Lo" in the Unicode specification.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
    * @since   1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
    public static final byte
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
        OTHER_LETTER                = 5;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
    * General category "Mn" in the Unicode specification.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
    * @since   1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
    public static final byte
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
        NON_SPACING_MARK            = 6;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
    * General category "Me" in the Unicode specification.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
    * @since   1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
    public static final byte
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
        ENCLOSING_MARK              = 7;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
    * General category "Mc" in the Unicode specification.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
    * @since   1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
    public static final byte
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
        COMBINING_SPACING_MARK      = 8;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
    * General category "Nd" in the Unicode specification.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
    * @since   1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
    public static final byte
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
        DECIMAL_DIGIT_NUMBER        = 9;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
    * General category "Nl" in the Unicode specification.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
    * @since   1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
    public static final byte
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
        LETTER_NUMBER               = 10;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
    * General category "No" in the Unicode specification.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
    * @since   1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
    public static final byte
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
        OTHER_NUMBER                = 11;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
    * General category "Zs" in the Unicode specification.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
    * @since   1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
    public static final byte
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
        SPACE_SEPARATOR             = 12;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
    * General category "Zl" in the Unicode specification.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
    * @since   1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
    public static final byte
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
        LINE_SEPARATOR              = 13;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
    * General category "Zp" in the Unicode specification.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
    * @since   1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
    public static final byte
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
        PARAGRAPH_SEPARATOR         = 14;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
    * General category "Cc" in the Unicode specification.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
    * @since   1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
    public static final byte
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
        CONTROL                     = 15;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
    * General category "Cf" in the Unicode specification.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
    * @since   1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
    public static final byte
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
        FORMAT                      = 16;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
    * General category "Co" in the Unicode specification.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
    * @since   1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
    public static final byte
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
        PRIVATE_USE                 = 18;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
    * General category "Cs" in the Unicode specification.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
    * @since   1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
    public static final byte
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
        SURROGATE                   = 19;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
    * General category "Pd" in the Unicode specification.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
    * @since   1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
    public static final byte
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
        DASH_PUNCTUATION            = 20;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
    * General category "Ps" in the Unicode specification.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
    * @since   1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
    public static final byte
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
        START_PUNCTUATION           = 21;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
    * General category "Pe" in the Unicode specification.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
    * @since   1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
    public static final byte
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
        END_PUNCTUATION             = 22;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
    * General category "Pc" in the Unicode specification.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
    * @since   1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
    public static final byte
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
        CONNECTOR_PUNCTUATION       = 23;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
    * General category "Po" in the Unicode specification.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
    * @since   1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
    public static final byte
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
        OTHER_PUNCTUATION           = 24;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
    * General category "Sm" in the Unicode specification.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
    * @since   1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
    public static final byte
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
        MATH_SYMBOL                 = 25;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
    * General category "Sc" in the Unicode specification.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
    * @since   1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
    public static final byte
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
        CURRENCY_SYMBOL             = 26;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
    * General category "Sk" in the Unicode specification.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
    * @since   1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
    public static final byte
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
        MODIFIER_SYMBOL             = 27;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
    * General category "So" in the Unicode specification.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
    * @since   1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
    public static final byte
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
        OTHER_SYMBOL                = 28;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
    * General category "Pi" in the Unicode specification.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
    * @since   1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
    public static final byte
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
        INITIAL_QUOTE_PUNCTUATION   = 29;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
    * General category "Pf" in the Unicode specification.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
    * @since   1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
    public static final byte
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
        FINAL_QUOTE_PUNCTUATION     = 30;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
     * Error flag. Use int (code point) to avoid confusion with U+FFFF.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
     static final int ERROR = 0xFFFFFFFF;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
     * Undefined bidirectional character type. Undefined <code>char</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
     * values have undefined directionality in the Unicode specification.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
     public static final byte DIRECTIONALITY_UNDEFINED = -1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
     * Strong bidirectional character type "L" in the Unicode specification.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
    public static final byte DIRECTIONALITY_LEFT_TO_RIGHT = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
     * Strong bidirectional character type "R" in the Unicode specification.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
    public static final byte DIRECTIONALITY_RIGHT_TO_LEFT = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
    * Strong bidirectional character type "AL" in the Unicode specification.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
    public static final byte DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC = 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
     * Weak bidirectional character type "EN" in the Unicode specification.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
    public static final byte DIRECTIONALITY_EUROPEAN_NUMBER = 3;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
     * Weak bidirectional character type "ES" in the Unicode specification.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
    public static final byte DIRECTIONALITY_EUROPEAN_NUMBER_SEPARATOR = 4;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
     * Weak bidirectional character type "ET" in the Unicode specification.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   438
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   439
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
    public static final byte DIRECTIONALITY_EUROPEAN_NUMBER_TERMINATOR = 5;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   443
     * Weak bidirectional character type "AN" in the Unicode specification.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   445
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   446
    public static final byte DIRECTIONALITY_ARABIC_NUMBER = 6;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   447
90ce3da70b43 Initial load
duke
parents:
diff changeset
   448
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   449
     * Weak bidirectional character type "CS" in the Unicode specification.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   450
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   451
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   452
    public static final byte DIRECTIONALITY_COMMON_NUMBER_SEPARATOR = 7;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   453
90ce3da70b43 Initial load
duke
parents:
diff changeset
   454
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   455
     * Weak bidirectional character type "NSM" in the Unicode specification.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   456
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   457
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   458
    public static final byte DIRECTIONALITY_NONSPACING_MARK = 8;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   459
90ce3da70b43 Initial load
duke
parents:
diff changeset
   460
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   461
     * Weak bidirectional character type "BN" in the Unicode specification.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   462
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   463
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   464
    public static final byte DIRECTIONALITY_BOUNDARY_NEUTRAL = 9;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   465
90ce3da70b43 Initial load
duke
parents:
diff changeset
   466
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   467
     * Neutral bidirectional character type "B" in the Unicode specification.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   468
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   469
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   470
    public static final byte DIRECTIONALITY_PARAGRAPH_SEPARATOR = 10;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   471
90ce3da70b43 Initial load
duke
parents:
diff changeset
   472
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   473
     * Neutral bidirectional character type "S" in the Unicode specification.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   474
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   475
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   476
    public static final byte DIRECTIONALITY_SEGMENT_SEPARATOR = 11;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   477
90ce3da70b43 Initial load
duke
parents:
diff changeset
   478
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   479
     * Neutral bidirectional character type "WS" in the Unicode specification.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   480
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   481
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   482
    public static final byte DIRECTIONALITY_WHITESPACE = 12;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   483
90ce3da70b43 Initial load
duke
parents:
diff changeset
   484
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   485
     * Neutral bidirectional character type "ON" in the Unicode specification.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   486
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   487
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   488
    public static final byte DIRECTIONALITY_OTHER_NEUTRALS = 13;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   489
90ce3da70b43 Initial load
duke
parents:
diff changeset
   490
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   491
     * Strong bidirectional character type "LRE" in the Unicode specification.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   492
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   493
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   494
    public static final byte DIRECTIONALITY_LEFT_TO_RIGHT_EMBEDDING = 14;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   495
90ce3da70b43 Initial load
duke
parents:
diff changeset
   496
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   497
     * Strong bidirectional character type "LRO" in the Unicode specification.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   498
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   499
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   500
    public static final byte DIRECTIONALITY_LEFT_TO_RIGHT_OVERRIDE = 15;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   501
90ce3da70b43 Initial load
duke
parents:
diff changeset
   502
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   503
     * Strong bidirectional character type "RLE" in the Unicode specification.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   504
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   505
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   506
    public static final byte DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING = 16;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   507
90ce3da70b43 Initial load
duke
parents:
diff changeset
   508
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   509
     * Strong bidirectional character type "RLO" in the Unicode specification.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   510
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   511
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   512
    public static final byte DIRECTIONALITY_RIGHT_TO_LEFT_OVERRIDE = 17;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   513
90ce3da70b43 Initial load
duke
parents:
diff changeset
   514
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   515
     * Weak bidirectional character type "PDF" in the Unicode specification.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   516
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   517
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   518
    public static final byte DIRECTIONALITY_POP_DIRECTIONAL_FORMAT = 18;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   519
90ce3da70b43 Initial load
duke
parents:
diff changeset
   520
    /**
3714
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
   521
     * The minimum value of a
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
   522
     * <a href="http://www.unicode.org/glossary/#high_surrogate_code_unit">
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
   523
     * Unicode high-surrogate code unit</a>
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
   524
     * in the UTF-16 encoding, constant <code>'&#92;uD800'</code>.
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
   525
     * A high-surrogate is also known as a <i>leading-surrogate</i>.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   526
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   527
     * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
   528
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   529
    public static final char MIN_HIGH_SURROGATE = '\uD800';
90ce3da70b43 Initial load
duke
parents:
diff changeset
   530
90ce3da70b43 Initial load
duke
parents:
diff changeset
   531
    /**
3714
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
   532
     * The maximum value of a
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
   533
     * <a href="http://www.unicode.org/glossary/#high_surrogate_code_unit">
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
   534
     * Unicode high-surrogate code unit</a>
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
   535
     * in the UTF-16 encoding, constant <code>'&#92;uDBFF'</code>.
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
   536
     * A high-surrogate is also known as a <i>leading-surrogate</i>.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   537
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   538
     * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
   539
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   540
    public static final char MAX_HIGH_SURROGATE = '\uDBFF';
90ce3da70b43 Initial load
duke
parents:
diff changeset
   541
90ce3da70b43 Initial load
duke
parents:
diff changeset
   542
    /**
3714
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
   543
     * The minimum value of a
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
   544
     * <a href="http://www.unicode.org/glossary/#low_surrogate_code_unit">
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
   545
     * Unicode low-surrogate code unit</a>
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
   546
     * in the UTF-16 encoding, constant <code>'&#92;uDC00'</code>.
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
   547
     * A low-surrogate is also known as a <i>trailing-surrogate</i>.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   548
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   549
     * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
   550
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   551
    public static final char MIN_LOW_SURROGATE  = '\uDC00';
90ce3da70b43 Initial load
duke
parents:
diff changeset
   552
90ce3da70b43 Initial load
duke
parents:
diff changeset
   553
    /**
3714
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
   554
     * The maximum value of a
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
   555
     * <a href="http://www.unicode.org/glossary/#low_surrogate_code_unit">
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
   556
     * Unicode low-surrogate code unit</a>
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
   557
     * in the UTF-16 encoding, constant <code>'&#92;uDFFF'</code>.
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
   558
     * A low-surrogate is also known as a <i>trailing-surrogate</i>.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   559
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   560
     * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
   561
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   562
    public static final char MAX_LOW_SURROGATE  = '\uDFFF';
90ce3da70b43 Initial load
duke
parents:
diff changeset
   563
90ce3da70b43 Initial load
duke
parents:
diff changeset
   564
    /**
3714
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
   565
     * The minimum value of a Unicode surrogate code unit in the
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
   566
     * UTF-16 encoding, constant <code>'&#92;uD800'</code>.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   567
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   568
     * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
   569
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   570
    public static final char MIN_SURROGATE = MIN_HIGH_SURROGATE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   571
90ce3da70b43 Initial load
duke
parents:
diff changeset
   572
    /**
3714
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
   573
     * The maximum value of a Unicode surrogate code unit in the
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
   574
     * UTF-16 encoding, constant <code>'&#92;uDFFF'</code>.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   575
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   576
     * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
   577
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   578
    public static final char MAX_SURROGATE = MAX_LOW_SURROGATE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   579
90ce3da70b43 Initial load
duke
parents:
diff changeset
   580
    /**
3714
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
   581
     * The minimum value of a
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
   582
     * <a href="http://www.unicode.org/glossary/#supplementary_code_point">
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
   583
     * Unicode supplementary code point</a>, constant {@code U+10000}.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   584
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   585
     * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
   586
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   587
    public static final int MIN_SUPPLEMENTARY_CODE_POINT = 0x010000;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   588
90ce3da70b43 Initial load
duke
parents:
diff changeset
   589
    /**
3714
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
   590
     * The minimum value of a
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
   591
     * <a href="http://www.unicode.org/glossary/#code_point">
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
   592
     * Unicode code point</a>, constant {@code U+0000}.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   593
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   594
     * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
   595
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   596
    public static final int MIN_CODE_POINT = 0x000000;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   597
90ce3da70b43 Initial load
duke
parents:
diff changeset
   598
    /**
3714
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
   599
     * The maximum value of a
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
   600
     * <a href="http://www.unicode.org/glossary/#code_point">
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
   601
     * Unicode code point</a>, constant {@code U+10FFFF}.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   602
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   603
     * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
   604
     */
3714
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
   605
    public static final int MAX_CODE_POINT = 0X10FFFF;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   606
90ce3da70b43 Initial load
duke
parents:
diff changeset
   607
90ce3da70b43 Initial load
duke
parents:
diff changeset
   608
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   609
     * Instances of this class represent particular subsets of the Unicode
90ce3da70b43 Initial load
duke
parents:
diff changeset
   610
     * character set.  The only family of subsets defined in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   611
     * <code>Character</code> class is <code>{@link Character.UnicodeBlock
90ce3da70b43 Initial load
duke
parents:
diff changeset
   612
     * UnicodeBlock}</code>.  Other portions of the Java API may define other
90ce3da70b43 Initial load
duke
parents:
diff changeset
   613
     * subsets for their own purposes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   614
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   615
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   616
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   617
    public static class Subset  {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   618
90ce3da70b43 Initial load
duke
parents:
diff changeset
   619
        private String name;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   620
90ce3da70b43 Initial load
duke
parents:
diff changeset
   621
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   622
         * Constructs a new <code>Subset</code> instance.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   623
         *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   624
         * @exception NullPointerException if name is <code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   625
         * @param  name  The name of this subset
90ce3da70b43 Initial load
duke
parents:
diff changeset
   626
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   627
        protected Subset(String name) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   628
            if (name == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   629
                throw new NullPointerException("name");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   630
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   631
            this.name = name;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   632
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   633
90ce3da70b43 Initial load
duke
parents:
diff changeset
   634
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   635
         * Compares two <code>Subset</code> objects for equality.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   636
         * This method returns <code>true</code> if and only if
90ce3da70b43 Initial load
duke
parents:
diff changeset
   637
         * <code>this</code> and the argument refer to the same
90ce3da70b43 Initial load
duke
parents:
diff changeset
   638
         * object; since this method is <code>final</code>, this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   639
         * guarantee holds for all subclasses.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   640
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   641
        public final boolean equals(Object obj) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   642
            return (this == obj);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   643
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   644
90ce3da70b43 Initial load
duke
parents:
diff changeset
   645
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   646
         * Returns the standard hash code as defined by the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   647
         * <code>{@link Object#hashCode}</code> method.  This method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   648
         * is <code>final</code> in order to ensure that the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   649
         * <code>equals</code> and <code>hashCode</code> methods will
90ce3da70b43 Initial load
duke
parents:
diff changeset
   650
         * be consistent in all subclasses.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   651
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   652
        public final int hashCode() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   653
            return super.hashCode();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   654
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   655
90ce3da70b43 Initial load
duke
parents:
diff changeset
   656
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   657
         * Returns the name of this subset.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   658
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   659
        public final String toString() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   660
            return name;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   661
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   662
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   663
90ce3da70b43 Initial load
duke
parents:
diff changeset
   664
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   665
     * A family of character subsets representing the character blocks in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   666
     * Unicode specification. Character blocks generally define characters
90ce3da70b43 Initial load
duke
parents:
diff changeset
   667
     * used for a specific script or purpose. A character is contained by
90ce3da70b43 Initial load
duke
parents:
diff changeset
   668
     * at most one Unicode block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   669
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   670
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   671
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   672
    public static final class UnicodeBlock extends Subset {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   673
90ce3da70b43 Initial load
duke
parents:
diff changeset
   674
        private static Map map = new HashMap();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   675
90ce3da70b43 Initial load
duke
parents:
diff changeset
   676
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   677
         * Create a UnicodeBlock with the given identifier name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   678
         * This name must be the same as the block identifier.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   679
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   680
        private UnicodeBlock(String idName) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   681
            super(idName);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   682
            map.put(idName.toUpperCase(Locale.US), this);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   683
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   684
90ce3da70b43 Initial load
duke
parents:
diff changeset
   685
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   686
         * Create a UnicodeBlock with the given identifier name and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   687
         * alias name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   688
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   689
        private UnicodeBlock(String idName, String alias) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   690
            this(idName);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   691
            map.put(alias.toUpperCase(Locale.US), this);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   692
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   693
90ce3da70b43 Initial load
duke
parents:
diff changeset
   694
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   695
         * Create a UnicodeBlock with the given identifier name and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   696
         * alias names.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   697
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   698
        private UnicodeBlock(String idName, String[] aliasName) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   699
            this(idName);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   700
            if (aliasName != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   701
                for(int x=0; x<aliasName.length; ++x) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   702
                    map.put(aliasName[x].toUpperCase(Locale.US), this);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   703
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   704
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   705
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   706
90ce3da70b43 Initial load
duke
parents:
diff changeset
   707
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   708
         * Constant for the "Basic Latin" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   709
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   710
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   711
        public static final UnicodeBlock  BASIC_LATIN =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   712
            new UnicodeBlock("BASIC_LATIN", new String[] {"Basic Latin", "BasicLatin" });
90ce3da70b43 Initial load
duke
parents:
diff changeset
   713
90ce3da70b43 Initial load
duke
parents:
diff changeset
   714
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   715
         * Constant for the "Latin-1 Supplement" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   716
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   717
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   718
        public static final UnicodeBlock LATIN_1_SUPPLEMENT =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   719
            new UnicodeBlock("LATIN_1_SUPPLEMENT", new String[]{ "Latin-1 Supplement", "Latin-1Supplement"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
   720
90ce3da70b43 Initial load
duke
parents:
diff changeset
   721
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   722
         * Constant for the "Latin Extended-A" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   723
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   724
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   725
        public static final UnicodeBlock LATIN_EXTENDED_A =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   726
            new UnicodeBlock("LATIN_EXTENDED_A", new String[]{ "Latin Extended-A", "LatinExtended-A"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
   727
90ce3da70b43 Initial load
duke
parents:
diff changeset
   728
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   729
         * Constant for the "Latin Extended-B" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   730
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   731
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   732
        public static final UnicodeBlock LATIN_EXTENDED_B =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   733
            new UnicodeBlock("LATIN_EXTENDED_B", new String[] {"Latin Extended-B", "LatinExtended-B"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
   734
90ce3da70b43 Initial load
duke
parents:
diff changeset
   735
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   736
         * Constant for the "IPA Extensions" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   737
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   738
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   739
        public static final UnicodeBlock IPA_EXTENSIONS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   740
            new UnicodeBlock("IPA_EXTENSIONS", new String[] {"IPA Extensions", "IPAExtensions"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
   741
90ce3da70b43 Initial load
duke
parents:
diff changeset
   742
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   743
         * Constant for the "Spacing Modifier Letters" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   744
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   745
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   746
        public static final UnicodeBlock SPACING_MODIFIER_LETTERS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   747
            new UnicodeBlock("SPACING_MODIFIER_LETTERS", new String[] { "Spacing Modifier Letters",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   748
                                                                        "SpacingModifierLetters"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
   749
90ce3da70b43 Initial load
duke
parents:
diff changeset
   750
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   751
         * Constant for the "Combining Diacritical Marks" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   752
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   753
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   754
        public static final UnicodeBlock COMBINING_DIACRITICAL_MARKS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   755
            new UnicodeBlock("COMBINING_DIACRITICAL_MARKS", new String[] {"Combining Diacritical Marks",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   756
                                                                          "CombiningDiacriticalMarks" });
90ce3da70b43 Initial load
duke
parents:
diff changeset
   757
90ce3da70b43 Initial load
duke
parents:
diff changeset
   758
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   759
         * Constant for the "Greek and Coptic" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   760
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   761
         * This block was previously known as the "Greek" block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   762
         *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   763
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   764
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   765
        public static final UnicodeBlock GREEK
90ce3da70b43 Initial load
duke
parents:
diff changeset
   766
            = new UnicodeBlock("GREEK", new String[] {"Greek and Coptic", "GreekandCoptic"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
   767
90ce3da70b43 Initial load
duke
parents:
diff changeset
   768
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   769
         * Constant for the "Cyrillic" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   770
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   771
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   772
        public static final UnicodeBlock CYRILLIC =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   773
            new UnicodeBlock("CYRILLIC");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   774
90ce3da70b43 Initial load
duke
parents:
diff changeset
   775
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   776
         * Constant for the "Armenian" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   777
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   778
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   779
        public static final UnicodeBlock ARMENIAN =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   780
            new UnicodeBlock("ARMENIAN");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   781
90ce3da70b43 Initial load
duke
parents:
diff changeset
   782
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   783
         * Constant for the "Hebrew" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   784
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   785
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   786
        public static final UnicodeBlock HEBREW =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   787
            new UnicodeBlock("HEBREW");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   788
90ce3da70b43 Initial load
duke
parents:
diff changeset
   789
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   790
         * Constant for the "Arabic" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   791
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   792
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   793
        public static final UnicodeBlock ARABIC =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   794
            new UnicodeBlock("ARABIC");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   795
90ce3da70b43 Initial load
duke
parents:
diff changeset
   796
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   797
         * Constant for the "Devanagari" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   798
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   799
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   800
        public static final UnicodeBlock DEVANAGARI =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   801
            new UnicodeBlock("DEVANAGARI");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   802
90ce3da70b43 Initial load
duke
parents:
diff changeset
   803
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   804
         * Constant for the "Bengali" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   805
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   806
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   807
        public static final UnicodeBlock BENGALI =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   808
            new UnicodeBlock("BENGALI");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   809
90ce3da70b43 Initial load
duke
parents:
diff changeset
   810
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   811
         * Constant for the "Gurmukhi" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   812
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   813
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   814
        public static final UnicodeBlock GURMUKHI =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   815
            new UnicodeBlock("GURMUKHI");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   816
90ce3da70b43 Initial load
duke
parents:
diff changeset
   817
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   818
         * Constant for the "Gujarati" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   819
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   820
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   821
        public static final UnicodeBlock GUJARATI =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   822
            new UnicodeBlock("GUJARATI");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   823
90ce3da70b43 Initial load
duke
parents:
diff changeset
   824
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   825
         * Constant for the "Oriya" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   826
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   827
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   828
        public static final UnicodeBlock ORIYA =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   829
            new UnicodeBlock("ORIYA");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   830
90ce3da70b43 Initial load
duke
parents:
diff changeset
   831
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   832
         * Constant for the "Tamil" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   833
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   834
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   835
        public static final UnicodeBlock TAMIL =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   836
            new UnicodeBlock("TAMIL");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   837
90ce3da70b43 Initial load
duke
parents:
diff changeset
   838
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   839
         * Constant for the "Telugu" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   840
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   841
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   842
        public static final UnicodeBlock TELUGU =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   843
            new UnicodeBlock("TELUGU");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   844
90ce3da70b43 Initial load
duke
parents:
diff changeset
   845
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   846
         * Constant for the "Kannada" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   847
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   848
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   849
        public static final UnicodeBlock KANNADA =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   850
            new UnicodeBlock("KANNADA");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   851
90ce3da70b43 Initial load
duke
parents:
diff changeset
   852
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   853
         * Constant for the "Malayalam" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   854
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   855
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   856
        public static final UnicodeBlock MALAYALAM =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   857
            new UnicodeBlock("MALAYALAM");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   858
90ce3da70b43 Initial load
duke
parents:
diff changeset
   859
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   860
         * Constant for the "Thai" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   861
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   862
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   863
        public static final UnicodeBlock THAI =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   864
            new UnicodeBlock("THAI");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   865
90ce3da70b43 Initial load
duke
parents:
diff changeset
   866
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   867
         * Constant for the "Lao" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   868
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   869
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   870
        public static final UnicodeBlock LAO =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   871
            new UnicodeBlock("LAO");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   872
90ce3da70b43 Initial load
duke
parents:
diff changeset
   873
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   874
         * Constant for the "Tibetan" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   875
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   876
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   877
        public static final UnicodeBlock TIBETAN =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   878
            new UnicodeBlock("TIBETAN");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   879
90ce3da70b43 Initial load
duke
parents:
diff changeset
   880
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   881
         * Constant for the "Georgian" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   882
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   883
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   884
        public static final UnicodeBlock GEORGIAN =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   885
            new UnicodeBlock("GEORGIAN");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   886
90ce3da70b43 Initial load
duke
parents:
diff changeset
   887
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   888
         * Constant for the "Hangul Jamo" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   889
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   890
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   891
        public static final UnicodeBlock HANGUL_JAMO =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   892
            new UnicodeBlock("HANGUL_JAMO", new String[] {"Hangul Jamo", "HangulJamo"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
   893
90ce3da70b43 Initial load
duke
parents:
diff changeset
   894
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   895
         * Constant for the "Latin Extended Additional" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   896
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   897
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   898
        public static final UnicodeBlock LATIN_EXTENDED_ADDITIONAL =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   899
            new UnicodeBlock("LATIN_EXTENDED_ADDITIONAL", new String[] {"Latin Extended Additional",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   900
                                                                        "LatinExtendedAdditional"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
   901
90ce3da70b43 Initial load
duke
parents:
diff changeset
   902
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   903
         * Constant for the "Greek Extended" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   904
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   905
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   906
        public static final UnicodeBlock GREEK_EXTENDED =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   907
            new UnicodeBlock("GREEK_EXTENDED", new String[] {"Greek Extended", "GreekExtended"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
   908
90ce3da70b43 Initial load
duke
parents:
diff changeset
   909
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   910
         * Constant for the "General Punctuation" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   911
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   912
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   913
        public static final UnicodeBlock GENERAL_PUNCTUATION =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   914
            new UnicodeBlock("GENERAL_PUNCTUATION", new String[] {"General Punctuation", "GeneralPunctuation"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
   915
90ce3da70b43 Initial load
duke
parents:
diff changeset
   916
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   917
         * Constant for the "Superscripts and Subscripts" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   918
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   919
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   920
        public static final UnicodeBlock SUPERSCRIPTS_AND_SUBSCRIPTS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   921
            new UnicodeBlock("SUPERSCRIPTS_AND_SUBSCRIPTS", new String[] {"Superscripts and Subscripts",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   922
                                                                          "SuperscriptsandSubscripts" });
90ce3da70b43 Initial load
duke
parents:
diff changeset
   923
90ce3da70b43 Initial load
duke
parents:
diff changeset
   924
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   925
         * Constant for the "Currency Symbols" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   926
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   927
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   928
        public static final UnicodeBlock CURRENCY_SYMBOLS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   929
            new UnicodeBlock("CURRENCY_SYMBOLS", new String[] { "Currency Symbols", "CurrencySymbols"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
   930
90ce3da70b43 Initial load
duke
parents:
diff changeset
   931
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   932
         * Constant for the "Combining Diacritical Marks for Symbols" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   933
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   934
         * This block was previously known as "Combining Marks for Symbols".
90ce3da70b43 Initial load
duke
parents:
diff changeset
   935
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   936
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   937
        public static final UnicodeBlock COMBINING_MARKS_FOR_SYMBOLS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   938
            new UnicodeBlock("COMBINING_MARKS_FOR_SYMBOLS", new String[] {"Combining Diacritical Marks for Symbols",
2497
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
   939
                                                                                                                                                   "CombiningDiacriticalMarksforSymbols",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
   940
                                                                           "Combining Marks for Symbols",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
   941
                                                                           "CombiningMarksforSymbols" });
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   942
90ce3da70b43 Initial load
duke
parents:
diff changeset
   943
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   944
         * Constant for the "Letterlike Symbols" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   945
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   946
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   947
        public static final UnicodeBlock LETTERLIKE_SYMBOLS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   948
            new UnicodeBlock("LETTERLIKE_SYMBOLS", new String[] { "Letterlike Symbols", "LetterlikeSymbols"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
   949
90ce3da70b43 Initial load
duke
parents:
diff changeset
   950
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   951
         * Constant for the "Number Forms" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   952
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   953
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   954
        public static final UnicodeBlock NUMBER_FORMS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   955
            new UnicodeBlock("NUMBER_FORMS", new String[] {"Number Forms", "NumberForms"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
   956
90ce3da70b43 Initial load
duke
parents:
diff changeset
   957
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   958
         * Constant for the "Arrows" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   959
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   960
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   961
        public static final UnicodeBlock ARROWS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   962
            new UnicodeBlock("ARROWS");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   963
90ce3da70b43 Initial load
duke
parents:
diff changeset
   964
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   965
         * Constant for the "Mathematical Operators" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   966
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   967
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   968
        public static final UnicodeBlock MATHEMATICAL_OPERATORS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   969
            new UnicodeBlock("MATHEMATICAL_OPERATORS", new String[] {"Mathematical Operators",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   970
                                                                     "MathematicalOperators"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
   971
90ce3da70b43 Initial load
duke
parents:
diff changeset
   972
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   973
         * Constant for the "Miscellaneous Technical" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   974
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   975
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   976
        public static final UnicodeBlock MISCELLANEOUS_TECHNICAL =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   977
            new UnicodeBlock("MISCELLANEOUS_TECHNICAL", new String[] {"Miscellaneous Technical",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   978
                                                                      "MiscellaneousTechnical"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
   979
90ce3da70b43 Initial load
duke
parents:
diff changeset
   980
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   981
         * Constant for the "Control Pictures" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   982
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   983
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   984
        public static final UnicodeBlock CONTROL_PICTURES =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   985
            new UnicodeBlock("CONTROL_PICTURES", new String[] {"Control Pictures", "ControlPictures"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
   986
90ce3da70b43 Initial load
duke
parents:
diff changeset
   987
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   988
         * Constant for the "Optical Character Recognition" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   989
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   990
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   991
        public static final UnicodeBlock OPTICAL_CHARACTER_RECOGNITION =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   992
            new UnicodeBlock("OPTICAL_CHARACTER_RECOGNITION", new String[] {"Optical Character Recognition",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   993
                                                                            "OpticalCharacterRecognition"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
   994
90ce3da70b43 Initial load
duke
parents:
diff changeset
   995
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   996
         * Constant for the "Enclosed Alphanumerics" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   997
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   998
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   999
        public static final UnicodeBlock ENCLOSED_ALPHANUMERICS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1000
            new UnicodeBlock("ENCLOSED_ALPHANUMERICS", new String[] {"Enclosed Alphanumerics",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1001
                                                                     "EnclosedAlphanumerics"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1002
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1003
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1004
         * Constant for the "Box Drawing" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1005
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1006
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1007
        public static final UnicodeBlock BOX_DRAWING =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1008
            new UnicodeBlock("BOX_DRAWING", new String[] {"Box Drawing", "BoxDrawing"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1009
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1010
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1011
         * Constant for the "Block Elements" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1012
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1013
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1014
        public static final UnicodeBlock BLOCK_ELEMENTS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1015
            new UnicodeBlock("BLOCK_ELEMENTS", new String[] {"Block Elements", "BlockElements"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1016
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1017
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1018
         * Constant for the "Geometric Shapes" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1019
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1020
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1021
        public static final UnicodeBlock GEOMETRIC_SHAPES =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1022
            new UnicodeBlock("GEOMETRIC_SHAPES", new String[] {"Geometric Shapes", "GeometricShapes"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1023
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1024
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1025
         * Constant for the "Miscellaneous Symbols" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1026
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1027
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1028
        public static final UnicodeBlock MISCELLANEOUS_SYMBOLS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1029
            new UnicodeBlock("MISCELLANEOUS_SYMBOLS", new String[] {"Miscellaneous Symbols",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1030
                                                                    "MiscellaneousSymbols"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1031
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1032
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1033
         * Constant for the "Dingbats" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1034
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1035
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1036
        public static final UnicodeBlock DINGBATS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1037
            new UnicodeBlock("DINGBATS");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1038
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1039
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1040
         * Constant for the "CJK Symbols and Punctuation" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1041
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1042
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1043
        public static final UnicodeBlock CJK_SYMBOLS_AND_PUNCTUATION =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1044
            new UnicodeBlock("CJK_SYMBOLS_AND_PUNCTUATION", new String[] {"CJK Symbols and Punctuation",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1045
                                                                          "CJKSymbolsandPunctuation"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1046
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1047
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1048
         * Constant for the "Hiragana" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1049
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1050
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1051
        public static final UnicodeBlock HIRAGANA =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1052
            new UnicodeBlock("HIRAGANA");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1053
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1054
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1055
         * Constant for the "Katakana" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1056
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1057
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1058
        public static final UnicodeBlock KATAKANA =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1059
            new UnicodeBlock("KATAKANA");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1060
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1061
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1062
         * Constant for the "Bopomofo" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1063
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1064
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1065
        public static final UnicodeBlock BOPOMOFO =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1066
            new UnicodeBlock("BOPOMOFO");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1067
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1068
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1069
         * Constant for the "Hangul Compatibility Jamo" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1070
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1071
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1072
        public static final UnicodeBlock HANGUL_COMPATIBILITY_JAMO =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1073
            new UnicodeBlock("HANGUL_COMPATIBILITY_JAMO", new String[] {"Hangul Compatibility Jamo",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1074
                                                                        "HangulCompatibilityJamo"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1075
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1076
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1077
         * Constant for the "Kanbun" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1078
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1079
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1080
        public static final UnicodeBlock KANBUN =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1081
            new UnicodeBlock("KANBUN");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1082
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1083
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1084
         * Constant for the "Enclosed CJK Letters and Months" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1085
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1086
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1087
        public static final UnicodeBlock ENCLOSED_CJK_LETTERS_AND_MONTHS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1088
            new UnicodeBlock("ENCLOSED_CJK_LETTERS_AND_MONTHS", new String[] {"Enclosed CJK Letters and Months",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1089
                                                                              "EnclosedCJKLettersandMonths"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1090
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1091
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1092
         * Constant for the "CJK Compatibility" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1093
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1094
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1095
        public static final UnicodeBlock CJK_COMPATIBILITY =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1096
            new UnicodeBlock("CJK_COMPATIBILITY", new String[] {"CJK Compatibility", "CJKCompatibility"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1097
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1098
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1099
         * Constant for the "CJK Unified Ideographs" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1100
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1101
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1102
        public static final UnicodeBlock CJK_UNIFIED_IDEOGRAPHS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1103
            new UnicodeBlock("CJK_UNIFIED_IDEOGRAPHS", new String[] {"CJK Unified Ideographs",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1104
                                                                     "CJKUnifiedIdeographs"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1105
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1106
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1107
         * Constant for the "Hangul Syllables" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1108
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1109
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1110
        public static final UnicodeBlock HANGUL_SYLLABLES =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1111
            new UnicodeBlock("HANGUL_SYLLABLES", new String[] {"Hangul Syllables", "HangulSyllables"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1112
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1113
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1114
         * Constant for the "Private Use Area" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1115
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1116
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1117
        public static final UnicodeBlock PRIVATE_USE_AREA =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1118
            new UnicodeBlock("PRIVATE_USE_AREA", new String[] {"Private Use Area", "PrivateUseArea"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1119
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1120
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1121
         * Constant for the "CJK Compatibility Ideographs" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1122
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1123
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1124
        public static final UnicodeBlock CJK_COMPATIBILITY_IDEOGRAPHS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1125
            new UnicodeBlock("CJK_COMPATIBILITY_IDEOGRAPHS",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1126
                             new String[] {"CJK Compatibility Ideographs",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1127
                                           "CJKCompatibilityIdeographs"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1128
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1129
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1130
         * Constant for the "Alphabetic Presentation Forms" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1131
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1132
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1133
        public static final UnicodeBlock ALPHABETIC_PRESENTATION_FORMS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1134
            new UnicodeBlock("ALPHABETIC_PRESENTATION_FORMS", new String[] {"Alphabetic Presentation Forms",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1135
                                                                            "AlphabeticPresentationForms"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1136
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1137
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1138
         * Constant for the "Arabic Presentation Forms-A" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1139
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1140
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1141
        public static final UnicodeBlock ARABIC_PRESENTATION_FORMS_A =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1142
            new UnicodeBlock("ARABIC_PRESENTATION_FORMS_A", new String[] {"Arabic Presentation Forms-A",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1143
                                                                          "ArabicPresentationForms-A"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1144
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1145
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1146
         * Constant for the "Combining Half Marks" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1147
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1148
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1149
        public static final UnicodeBlock COMBINING_HALF_MARKS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1150
            new UnicodeBlock("COMBINING_HALF_MARKS", new String[] {"Combining Half Marks",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1151
                                                                   "CombiningHalfMarks"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1152
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1153
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1154
         * Constant for the "CJK Compatibility Forms" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1155
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1156
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1157
        public static final UnicodeBlock CJK_COMPATIBILITY_FORMS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1158
            new UnicodeBlock("CJK_COMPATIBILITY_FORMS", new String[] {"CJK Compatibility Forms",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1159
                                                                      "CJKCompatibilityForms"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1160
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1161
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1162
         * Constant for the "Small Form Variants" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1163
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1164
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1165
        public static final UnicodeBlock SMALL_FORM_VARIANTS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1166
            new UnicodeBlock("SMALL_FORM_VARIANTS", new String[] {"Small Form Variants",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1167
                                                                  "SmallFormVariants"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1168
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1169
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1170
         * Constant for the "Arabic Presentation Forms-B" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1171
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1172
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1173
        public static final UnicodeBlock ARABIC_PRESENTATION_FORMS_B =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1174
            new UnicodeBlock("ARABIC_PRESENTATION_FORMS_B", new String[] {"Arabic Presentation Forms-B",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1175
                                                                          "ArabicPresentationForms-B"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1176
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1177
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1178
         * Constant for the "Halfwidth and Fullwidth Forms" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1179
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1180
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1181
        public static final UnicodeBlock HALFWIDTH_AND_FULLWIDTH_FORMS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1182
            new UnicodeBlock("HALFWIDTH_AND_FULLWIDTH_FORMS",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1183
                             new String[] {"Halfwidth and Fullwidth Forms",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1184
                                           "HalfwidthandFullwidthForms"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1185
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1186
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1187
         * Constant for the "Specials" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1188
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1189
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1190
        public static final UnicodeBlock SPECIALS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1191
            new UnicodeBlock("SPECIALS");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1192
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1193
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1194
         * @deprecated As of J2SE 5, use {@link #HIGH_SURROGATES},
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1195
         *             {@link #HIGH_PRIVATE_USE_SURROGATES}, and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1196
         *             {@link #LOW_SURROGATES}. These new constants match
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1197
         *             the block definitions of the Unicode Standard.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1198
         *             The {@link #of(char)} and {@link #of(int)} methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1199
         *             return the new constants, not SURROGATES_AREA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1200
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1201
        @Deprecated
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1202
        public static final UnicodeBlock SURROGATES_AREA =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1203
            new UnicodeBlock("SURROGATES_AREA");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1204
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1205
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1206
         * Constant for the "Syriac" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1207
         * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1208
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1209
        public static final UnicodeBlock SYRIAC =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1210
            new UnicodeBlock("SYRIAC");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1211
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1212
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1213
         * Constant for the "Thaana" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1214
         * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1215
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1216
        public static final UnicodeBlock THAANA =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1217
            new UnicodeBlock("THAANA");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1218
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1219
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1220
         * Constant for the "Sinhala" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1221
         * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1222
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1223
        public static final UnicodeBlock SINHALA =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1224
            new UnicodeBlock("SINHALA");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1225
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1226
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1227
         * Constant for the "Myanmar" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1228
         * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1229
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1230
        public static final UnicodeBlock MYANMAR =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1231
            new UnicodeBlock("MYANMAR");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1232
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1233
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1234
         * Constant for the "Ethiopic" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1235
         * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1236
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1237
        public static final UnicodeBlock ETHIOPIC =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1238
            new UnicodeBlock("ETHIOPIC");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1239
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1240
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1241
         * Constant for the "Cherokee" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1242
         * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1243
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1244
        public static final UnicodeBlock CHEROKEE =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1245
            new UnicodeBlock("CHEROKEE");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1246
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1247
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1248
         * Constant for the "Unified Canadian Aboriginal Syllabics" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1249
         * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1250
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1251
        public static final UnicodeBlock UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1252
            new UnicodeBlock("UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1253
                             new String[] {"Unified Canadian Aboriginal Syllabics",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1254
                                           "UnifiedCanadianAboriginalSyllabics"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1255
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1256
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1257
         * Constant for the "Ogham" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1258
         * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1259
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1260
        public static final UnicodeBlock OGHAM =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1261
                             new UnicodeBlock("OGHAM");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1262
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1263
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1264
         * Constant for the "Runic" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1265
         * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1266
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1267
        public static final UnicodeBlock RUNIC =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1268
                             new UnicodeBlock("RUNIC");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1269
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1270
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1271
         * Constant for the "Khmer" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1272
         * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1273
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1274
        public static final UnicodeBlock KHMER =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1275
                             new UnicodeBlock("KHMER");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1276
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1277
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1278
         * Constant for the "Mongolian" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1279
         * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1280
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1281
        public static final UnicodeBlock MONGOLIAN =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1282
                             new UnicodeBlock("MONGOLIAN");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1283
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1284
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1285
         * Constant for the "Braille Patterns" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1286
         * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1287
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1288
        public static final UnicodeBlock BRAILLE_PATTERNS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1289
            new UnicodeBlock("BRAILLE_PATTERNS", new String[] {"Braille Patterns",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1290
                                                               "BraillePatterns"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1291
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1292
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1293
         * Constant for the "CJK Radicals Supplement" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1294
         * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1295
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1296
        public static final UnicodeBlock CJK_RADICALS_SUPPLEMENT =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1297
             new UnicodeBlock("CJK_RADICALS_SUPPLEMENT", new String[] {"CJK Radicals Supplement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1298
                                                                       "CJKRadicalsSupplement"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1299
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1300
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1301
         * Constant for the "Kangxi Radicals" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1302
         * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1303
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1304
        public static final UnicodeBlock KANGXI_RADICALS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1305
            new UnicodeBlock("KANGXI_RADICALS", new String[] {"Kangxi Radicals", "KangxiRadicals"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1306
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1307
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1308
         * Constant for the "Ideographic Description Characters" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1309
         * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1310
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1311
        public static final UnicodeBlock IDEOGRAPHIC_DESCRIPTION_CHARACTERS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1312
            new UnicodeBlock("IDEOGRAPHIC_DESCRIPTION_CHARACTERS", new String[] {"Ideographic Description Characters",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1313
                                                                                 "IdeographicDescriptionCharacters"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1314
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1315
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1316
         * Constant for the "Bopomofo Extended" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1317
         * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1318
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1319
        public static final UnicodeBlock BOPOMOFO_EXTENDED =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1320
            new UnicodeBlock("BOPOMOFO_EXTENDED", new String[] {"Bopomofo Extended",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1321
                                                                "BopomofoExtended"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1322
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1323
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1324
         * Constant for the "CJK Unified Ideographs Extension A" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1325
         * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1326
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1327
        public static final UnicodeBlock CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1328
            new UnicodeBlock("CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A", new String[] {"CJK Unified Ideographs Extension A",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1329
                                                                                 "CJKUnifiedIdeographsExtensionA"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1330
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1331
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1332
         * Constant for the "Yi Syllables" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1333
         * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1334
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1335
        public static final UnicodeBlock YI_SYLLABLES =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1336
            new UnicodeBlock("YI_SYLLABLES", new String[] {"Yi Syllables", "YiSyllables"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1337
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1338
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1339
         * Constant for the "Yi Radicals" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1340
         * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1341
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1342
        public static final UnicodeBlock YI_RADICALS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1343
            new UnicodeBlock("YI_RADICALS", new String[] {"Yi Radicals", "YiRadicals"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1344
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1345
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1346
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1347
         * Constant for the "Cyrillic Supplementary" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1348
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1349
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1350
        public static final UnicodeBlock CYRILLIC_SUPPLEMENTARY =
2497
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1351
            new UnicodeBlock("CYRILLIC_SUPPLEMENTARY",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1352
                             new String[] {"Cyrillic Supplementary",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1353
                                           "CyrillicSupplementary",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1354
                                           "Cyrillic Supplement",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1355
                                           "CyrillicSupplement"});
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1356
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1357
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1358
         * Constant for the "Tagalog" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1359
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1360
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1361
        public static final UnicodeBlock TAGALOG =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1362
            new UnicodeBlock("TAGALOG");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1363
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1364
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1365
         * Constant for the "Hanunoo" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1366
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1367
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1368
        public static final UnicodeBlock HANUNOO =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1369
            new UnicodeBlock("HANUNOO");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1370
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1371
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1372
         * Constant for the "Buhid" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1373
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1374
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1375
        public static final UnicodeBlock BUHID =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1376
            new UnicodeBlock("BUHID");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1377
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1378
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1379
         * Constant for the "Tagbanwa" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1380
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1381
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1382
        public static final UnicodeBlock TAGBANWA =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1383
            new UnicodeBlock("TAGBANWA");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1384
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1385
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1386
         * Constant for the "Limbu" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1387
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1388
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1389
        public static final UnicodeBlock LIMBU =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1390
            new UnicodeBlock("LIMBU");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1391
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1392
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1393
         * Constant for the "Tai Le" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1394
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1395
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1396
        public static final UnicodeBlock TAI_LE =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1397
            new UnicodeBlock("TAI_LE", new String[] {"Tai Le", "TaiLe"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1398
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1399
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1400
         * Constant for the "Khmer Symbols" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1401
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1402
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1403
        public static final UnicodeBlock KHMER_SYMBOLS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1404
            new UnicodeBlock("KHMER_SYMBOLS", new String[] {"Khmer Symbols", "KhmerSymbols"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1405
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1406
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1407
         * Constant for the "Phonetic Extensions" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1408
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1409
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1410
        public static final UnicodeBlock PHONETIC_EXTENSIONS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1411
            new UnicodeBlock("PHONETIC_EXTENSIONS", new String[] {"Phonetic Extensions", "PhoneticExtensions"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1412
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1413
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1414
         * Constant for the "Miscellaneous Mathematical Symbols-A" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1415
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1416
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1417
        public static final UnicodeBlock MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1418
            new UnicodeBlock("MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1419
                             new String[]{"Miscellaneous Mathematical Symbols-A",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1420
                                          "MiscellaneousMathematicalSymbols-A"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1421
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1422
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1423
         * Constant for the "Supplemental Arrows-A" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1424
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1425
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1426
        public static final UnicodeBlock SUPPLEMENTAL_ARROWS_A =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1427
            new UnicodeBlock("SUPPLEMENTAL_ARROWS_A", new String[] {"Supplemental Arrows-A",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1428
                                                                    "SupplementalArrows-A"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1429
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1430
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1431
         * Constant for the "Supplemental Arrows-B" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1432
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1433
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1434
        public static final UnicodeBlock SUPPLEMENTAL_ARROWS_B =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1435
            new UnicodeBlock("SUPPLEMENTAL_ARROWS_B", new String[] {"Supplemental Arrows-B",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1436
                                                                    "SupplementalArrows-B"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1437
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1438
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1439
         * Constant for the "Miscellaneous Mathematical Symbols-B" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1440
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1441
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1442
        public static final UnicodeBlock MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1443
                = new UnicodeBlock("MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1444
                                   new String[] {"Miscellaneous Mathematical Symbols-B",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1445
                                                 "MiscellaneousMathematicalSymbols-B"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1446
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1447
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1448
         * Constant for the "Supplemental Mathematical Operators" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1449
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1450
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1451
        public static final UnicodeBlock SUPPLEMENTAL_MATHEMATICAL_OPERATORS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1452
            new UnicodeBlock("SUPPLEMENTAL_MATHEMATICAL_OPERATORS",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1453
                             new String[]{"Supplemental Mathematical Operators",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1454
                                          "SupplementalMathematicalOperators"} );
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1455
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1456
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1457
         * Constant for the "Miscellaneous Symbols and Arrows" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1458
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1459
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1460
        public static final UnicodeBlock MISCELLANEOUS_SYMBOLS_AND_ARROWS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1461
            new UnicodeBlock("MISCELLANEOUS_SYMBOLS_AND_ARROWS", new String[] {"Miscellaneous Symbols and Arrows",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1462
                                                                               "MiscellaneousSymbolsandArrows"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1463
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1464
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1465
         * Constant for the "Katakana Phonetic Extensions" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1466
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1467
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1468
        public static final UnicodeBlock KATAKANA_PHONETIC_EXTENSIONS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1469
            new UnicodeBlock("KATAKANA_PHONETIC_EXTENSIONS", new String[] {"Katakana Phonetic Extensions",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1470
                                                                           "KatakanaPhoneticExtensions"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1471
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1472
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1473
         * Constant for the "Yijing Hexagram Symbols" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1474
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1475
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1476
        public static final UnicodeBlock YIJING_HEXAGRAM_SYMBOLS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1477
            new UnicodeBlock("YIJING_HEXAGRAM_SYMBOLS", new String[] {"Yijing Hexagram Symbols",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1478
                                                                      "YijingHexagramSymbols"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1479
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1480
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1481
         * Constant for the "Variation Selectors" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1482
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1483
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1484
        public static final UnicodeBlock VARIATION_SELECTORS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1485
            new UnicodeBlock("VARIATION_SELECTORS", new String[] {"Variation Selectors", "VariationSelectors"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1486
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1487
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1488
         * Constant for the "Linear B Syllabary" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1489
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1490
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1491
        public static final UnicodeBlock LINEAR_B_SYLLABARY =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1492
            new UnicodeBlock("LINEAR_B_SYLLABARY", new String[] {"Linear B Syllabary", "LinearBSyllabary"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1493
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1494
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1495
         * Constant for the "Linear B Ideograms" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1496
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1497
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1498
        public static final UnicodeBlock LINEAR_B_IDEOGRAMS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1499
            new UnicodeBlock("LINEAR_B_IDEOGRAMS", new String[] {"Linear B Ideograms", "LinearBIdeograms"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1500
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1501
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1502
         * Constant for the "Aegean Numbers" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1503
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1504
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1505
        public static final UnicodeBlock AEGEAN_NUMBERS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1506
            new UnicodeBlock("AEGEAN_NUMBERS", new String[] {"Aegean Numbers", "AegeanNumbers"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1507
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1508
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1509
         * Constant for the "Old Italic" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1510
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1511
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1512
        public static final UnicodeBlock OLD_ITALIC =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1513
            new UnicodeBlock("OLD_ITALIC", new String[] {"Old Italic", "OldItalic"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1514
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1515
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1516
         * Constant for the "Gothic" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1517
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1518
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1519
        public static final UnicodeBlock GOTHIC = new UnicodeBlock("GOTHIC");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1520
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1521
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1522
         * Constant for the "Ugaritic" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1523
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1524
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1525
        public static final UnicodeBlock UGARITIC = new UnicodeBlock("UGARITIC");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1526
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1527
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1528
         * Constant for the "Deseret" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1529
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1530
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1531
        public static final UnicodeBlock DESERET = new UnicodeBlock("DESERET");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1532
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1533
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1534
         * Constant for the "Shavian" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1535
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1536
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1537
        public static final UnicodeBlock SHAVIAN = new UnicodeBlock("SHAVIAN");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1538
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1539
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1540
         * Constant for the "Osmanya" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1541
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1542
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1543
        public static final UnicodeBlock OSMANYA = new UnicodeBlock("OSMANYA");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1544
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1545
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1546
         * Constant for the "Cypriot Syllabary" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1547
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1548
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1549
        public static final UnicodeBlock CYPRIOT_SYLLABARY =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1550
            new UnicodeBlock("CYPRIOT_SYLLABARY", new String[] {"Cypriot Syllabary", "CypriotSyllabary"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1551
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1552
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1553
         * Constant for the "Byzantine Musical Symbols" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1554
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1555
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1556
        public static final UnicodeBlock BYZANTINE_MUSICAL_SYMBOLS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1557
            new UnicodeBlock("BYZANTINE_MUSICAL_SYMBOLS", new String[] {"Byzantine Musical Symbols",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1558
                                                                        "ByzantineMusicalSymbols"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1559
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1560
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1561
         * Constant for the "Musical Symbols" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1562
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1563
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1564
        public static final UnicodeBlock MUSICAL_SYMBOLS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1565
            new UnicodeBlock("MUSICAL_SYMBOLS", new String[] {"Musical Symbols", "MusicalSymbols"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1566
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1567
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1568
         * Constant for the "Tai Xuan Jing Symbols" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1569
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1570
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1571
        public static final UnicodeBlock TAI_XUAN_JING_SYMBOLS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1572
            new UnicodeBlock("TAI_XUAN_JING_SYMBOLS", new String[] {"Tai Xuan Jing Symbols",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1573
                                                                     "TaiXuanJingSymbols"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1574
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1575
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1576
         * Constant for the "Mathematical Alphanumeric Symbols" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1577
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1578
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1579
        public static final UnicodeBlock MATHEMATICAL_ALPHANUMERIC_SYMBOLS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1580
            new UnicodeBlock("MATHEMATICAL_ALPHANUMERIC_SYMBOLS",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1581
                             new String[] {"Mathematical Alphanumeric Symbols", "MathematicalAlphanumericSymbols"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1582
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1583
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1584
         * Constant for the "CJK Unified Ideographs Extension B" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1585
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1586
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1587
        public static final UnicodeBlock CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1588
            new UnicodeBlock("CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1589
                             new String[] {"CJK Unified Ideographs Extension B", "CJKUnifiedIdeographsExtensionB"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1590
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1591
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1592
         * Constant for the "CJK Compatibility Ideographs Supplement" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1593
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1594
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1595
        public static final UnicodeBlock CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1596
            new UnicodeBlock("CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1597
                             new String[]{"CJK Compatibility Ideographs Supplement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1598
                                          "CJKCompatibilityIdeographsSupplement"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1599
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1600
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1601
         * Constant for the "Tags" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1602
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1603
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1604
        public static final UnicodeBlock TAGS = new UnicodeBlock("TAGS");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1605
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1606
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1607
         * Constant for the "Variation Selectors Supplement" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1608
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1609
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1610
        public static final UnicodeBlock VARIATION_SELECTORS_SUPPLEMENT =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1611
            new UnicodeBlock("VARIATION_SELECTORS_SUPPLEMENT", new String[] {"Variation Selectors Supplement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1612
                                                                             "VariationSelectorsSupplement"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1613
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1614
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1615
         * Constant for the "Supplementary Private Use Area-A" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1616
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1617
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1618
        public static final UnicodeBlock SUPPLEMENTARY_PRIVATE_USE_AREA_A =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1619
            new UnicodeBlock("SUPPLEMENTARY_PRIVATE_USE_AREA_A",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1620
                             new String[] {"Supplementary Private Use Area-A",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1621
                                           "SupplementaryPrivateUseArea-A"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1622
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1623
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1624
         * Constant for the "Supplementary Private Use Area-B" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1625
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1626
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1627
        public static final UnicodeBlock SUPPLEMENTARY_PRIVATE_USE_AREA_B =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1628
            new UnicodeBlock("SUPPLEMENTARY_PRIVATE_USE_AREA_B",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1629
                             new String[] {"Supplementary Private Use Area-B",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1630
                                           "SupplementaryPrivateUseArea-B"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1631
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1632
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1633
         * Constant for the "High Surrogates" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1634
         * This block represents codepoint values in the high surrogate
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1635
         * range: 0xD800 through 0xDB7F
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1636
         *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1637
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1638
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1639
        public static final UnicodeBlock HIGH_SURROGATES =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1640
            new UnicodeBlock("HIGH_SURROGATES", new String[] {"High Surrogates", "HighSurrogates"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1641
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1642
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1643
         * Constant for the "High Private Use Surrogates" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1644
         * This block represents codepoint values in the high surrogate
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1645
         * range: 0xDB80 through 0xDBFF
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1646
         *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1647
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1648
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1649
        public static final UnicodeBlock HIGH_PRIVATE_USE_SURROGATES =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1650
            new UnicodeBlock("HIGH_PRIVATE_USE_SURROGATES", new String[] { "High Private Use Surrogates",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1651
                                                                           "HighPrivateUseSurrogates"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1652
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1653
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1654
         * Constant for the "Low Surrogates" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1655
         * This block represents codepoint values in the high surrogate
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1656
         * range: 0xDC00 through 0xDFFF
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1657
         *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1658
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1659
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1660
        public static final UnicodeBlock LOW_SURROGATES =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1661
            new UnicodeBlock("LOW_SURROGATES", new String[] {"Low Surrogates", "LowSurrogates"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1662
2497
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1663
        /**
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1664
         * Constant for the "Arabic Supplement" Unicode character block.
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1665
         * @since 1.7
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1666
         */
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1667
        public static final UnicodeBlock ARABIC_SUPPLEMENT =
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1668
            new UnicodeBlock("ARABIC_SUPPLEMENT",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1669
                             new String[] { "Arabic Supplement",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1670
                                            "ArabicSupplement"});
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1671
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1672
        /**
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1673
         * Constant for the "NKo" Unicode character block.
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1674
         * @since 1.7
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1675
         */
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1676
        public static final UnicodeBlock NKO = new UnicodeBlock("NKO");
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1677
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1678
        /**
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1679
         * Constant for the "Ethiopic Supplement" Unicode character block.
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1680
         * @since 1.7
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1681
         */
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1682
        public static final UnicodeBlock ETHIOPIC_SUPPLEMENT =
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1683
            new UnicodeBlock("ETHIOPIC_SUPPLEMENT",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1684
                             new String[] { "Ethiopic Supplement",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1685
                                            "EthiopicSupplement"});
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1686
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1687
        /**
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1688
         * Constant for the "New Tai Lue" Unicode character block.
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1689
         * @since 1.7
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1690
         */
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1691
        public static final UnicodeBlock NEW_TAI_LUE =
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1692
            new UnicodeBlock("NEW_TAI_LUE",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1693
                             new String[] { "New Tai Lue",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1694
                                            "NewTaiLue"});
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1695
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1696
        /**
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1697
         * Constant for the "Buginese" Unicode character block.
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1698
         * @since 1.7
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1699
         */
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1700
        public static final UnicodeBlock BUGINESE =
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1701
            new UnicodeBlock("BUGINESE");
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1702
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1703
        /**
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1704
         * Constant for the "Balinese" Unicode character block.
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1705
         * @since 1.7
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1706
         */
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1707
        public static final UnicodeBlock BALINESE =
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1708
            new UnicodeBlock("BALINESE");
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1709
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1710
        /**
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1711
         * Constant for the "Sundanese" Unicode character block.
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1712
         * @since 1.7
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1713
         */
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1714
        public static final UnicodeBlock SUNDANESE =
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1715
            new UnicodeBlock("SUNDANESE");
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1716
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1717
        /**
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1718
         * Constant for the "Lepcha" Unicode character block.
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1719
         * @since 1.7
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1720
         */
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1721
        public static final UnicodeBlock LEPCHA = new UnicodeBlock("LEPCHA");
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1722
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1723
        /**
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1724
         * Constant for the "Ol Chiki" Unicode character block.
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1725
         * @since 1.7
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1726
         */
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1727
        public static final UnicodeBlock OL_CHIKI =
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1728
            new UnicodeBlock("OL_CHIKI",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1729
                             new String[] { "Ol Chiki",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1730
                                            "OlChiki"});
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1731
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1732
        /**
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1733
         * Constant for the "Phonetic Extensions Supplement" Unicode character
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1734
         * block.
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1735
         * @since 1.7
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1736
         */
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1737
        public static final UnicodeBlock PHONETIC_EXTENSIONS_SUPPLEMENT =
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1738
            new UnicodeBlock("PHONETIC_EXTENSIONS_SUPPLEMENT",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1739
                             new String[] { "Phonetic Extensions Supplement",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1740
                                            "PhoneticExtensionsSupplement"});
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1741
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1742
        /**
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1743
         * Constant for the "Combining Diacritical Marks Supplement" Unicode
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1744
         * character block.
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1745
         * @since 1.7
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1746
         */
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1747
        public static final UnicodeBlock COMBINING_DIACRITICAL_MARKS_SUPPLEMENT =
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1748
            new UnicodeBlock("COMBINING_DIACRITICAL_MARKS_SUPPLEMENT",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1749
                             new String[] { "Combining Diacritical Marks Supplement",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1750
                                            "CombiningDiacriticalMarksSupplement"});
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1751
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1752
        /**
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1753
         * Constant for the "Glagolitic" Unicode character block.
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1754
         * @since 1.7
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1755
         */
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1756
        public static final UnicodeBlock GLAGOLITIC =
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1757
            new UnicodeBlock("GLAGOLITIC");
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1758
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1759
        /**
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1760
         * Constant for the "Latin Extended-C" Unicode character block.
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1761
         * @since 1.7
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1762
         */
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1763
        public static final UnicodeBlock LATIN_EXTENDED_C =
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1764
            new UnicodeBlock("LATIN_EXTENDED_C",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1765
                             new String[] { "Latin Extended-C",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1766
                                            "LatinExtended-C"});
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1767
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1768
        /**
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1769
         * Constant for the "Coptic" Unicode character block.
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1770
         * @since 1.7
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1771
         */
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1772
        public static final UnicodeBlock COPTIC = new UnicodeBlock("COPTIC");
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1773
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1774
        /**
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1775
         * Constant for the "Georgian Supplement" Unicode character block.
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1776
         * @since 1.7
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1777
         */
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1778
        public static final UnicodeBlock GEORGIAN_SUPPLEMENT =
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1779
            new UnicodeBlock("GEORGIAN_SUPPLEMENT",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1780
                             new String[] { "Georgian Supplement",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1781
                                            "GeorgianSupplement"});
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1782
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1783
        /**
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1784
         * Constant for the "Tifinagh" Unicode character block.
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1785
         * @since 1.7
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1786
         */
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1787
        public static final UnicodeBlock TIFINAGH =
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1788
            new UnicodeBlock("TIFINAGH");
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1789
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1790
        /**
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1791
         * Constant for the "Ethiopic Extended" Unicode character block.
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1792
         * @since 1.7
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1793
         */
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1794
        public static final UnicodeBlock ETHIOPIC_EXTENDED =
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1795
            new UnicodeBlock("ETHIOPIC_EXTENDED",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1796
                             new String[] { "Ethiopic Extended",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1797
                                            "EthiopicExtended"});
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1798
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1799
        /**
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1800
         * Constant for the "Cyrillic Extended-A" Unicode character block.
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1801
         * @since 1.7
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1802
         */
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1803
        public static final UnicodeBlock CYRILLIC_EXTENDED_A =
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1804
            new UnicodeBlock("CYRILLIC_EXTENDED_A",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1805
                             new String[] { "Cyrillic Extended-A",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1806
                                            "CyrillicExtended-A"});
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1807
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1808
        /**
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1809
         * Constant for the "Supplemental Punctuation" Unicode character block.
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1810
         * @since 1.7
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1811
         */
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1812
        public static final UnicodeBlock SUPPLEMENTAL_PUNCTUATION =
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1813
            new UnicodeBlock("SUPPLEMENTAL_PUNCTUATION",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1814
                             new String[] { "Supplemental Punctuation",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1815
                                            "SupplementalPunctuation"});
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1816
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1817
        /**
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1818
         * Constant for the "CJK Strokes" Unicode character block.
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1819
         * @since 1.7
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1820
         */
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1821
        public static final UnicodeBlock CJK_STROKES =
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1822
            new UnicodeBlock("CJK_STROKES",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1823
                             new String[] { "CJK Strokes",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1824
                                            "CJKStrokes"});
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1825
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1826
        /**
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1827
         * Constant for the "Vai" Unicode character block.
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1828
         * @since 1.7
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1829
         */
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1830
        public static final UnicodeBlock VAI = new UnicodeBlock("VAI");
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1831
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1832
        /**
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1833
         * Constant for the "Cyrillic Extended-B" Unicode character block.
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1834
         * @since 1.7
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1835
         */
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1836
        public static final UnicodeBlock CYRILLIC_EXTENDED_B =
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1837
            new UnicodeBlock("CYRILLIC_EXTENDED_B",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1838
                             new String[] { "Cyrillic Extended-B",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1839
                                            "CyrillicExtended-B"});
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1840
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1841
        /**
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1842
         * Constant for the "Modifier Tone Letters" Unicode character block.
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1843
         * @since 1.7
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1844
         */
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1845
        public static final UnicodeBlock MODIFIER_TONE_LETTERS =
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1846
            new UnicodeBlock("MODIFIER_TONE_LETTERS",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1847
                             new String[] { "Modifier Tone Letters",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1848
                                            "ModifierToneLetters"});
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1849
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1850
        /**
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1851
         * Constant for the "Latin Extended-D" Unicode character block.
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1852
         * @since 1.7
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1853
         */
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1854
        public static final UnicodeBlock LATIN_EXTENDED_D =
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1855
            new UnicodeBlock("LATIN_EXTENDED_D",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1856
                             new String[] { "Latin Extended-D",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1857
                                            "LatinExtended-D"});
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1858
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1859
        /**
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1860
         * Constant for the "Syloti Nagri" Unicode character block.
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1861
         * @since 1.7
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1862
         */
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1863
        public static final UnicodeBlock SYLOTI_NAGRI =
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1864
            new UnicodeBlock("SYLOTI_NAGRI",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1865
                             new String[] { "Syloti Nagri",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1866
                                            "SylotiNagri"});
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1867
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1868
        /**
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1869
         * Constant for the "Phags-pa" Unicode character block.
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1870
         * @since 1.7
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1871
         */
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1872
        public static final UnicodeBlock PHAGS_PA =
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1873
            new UnicodeBlock("PHAGS_PA", new String[] { "Phags-pa"});
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1874
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1875
        /**
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1876
         * Constant for the "Saurashtra" Unicode character block.
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1877
         * @since 1.7
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1878
         */
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1879
        public static final UnicodeBlock SAURASHTRA =
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1880
            new UnicodeBlock("SAURASHTRA");
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1881
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1882
        /**
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1883
         * Constant for the "Kayah Li" Unicode character block.
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1884
         * @since 1.7
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1885
         */
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1886
        public static final UnicodeBlock KAYAH_LI =
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1887
            new UnicodeBlock("KAYAH_LI",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1888
                             new String[] { "Kayah Li",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1889
                                            "KayahLi"});
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1890
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1891
        /**
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1892
         * Constant for the "Rejang" Unicode character block.
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1893
         * @since 1.7
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1894
         */
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1895
        public static final UnicodeBlock REJANG = new UnicodeBlock("REJANG");
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1896
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1897
        /**
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1898
         * Constant for the "Cham" Unicode character block.
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1899
         * @since 1.7
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1900
         */
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1901
        public static final UnicodeBlock CHAM = new UnicodeBlock("CHAM");
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1902
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1903
        /**
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1904
         * Constant for the "Vertical Forms" Unicode character block.
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1905
         * @since 1.7
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1906
         */
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1907
        public static final UnicodeBlock VERTICAL_FORMS =
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1908
            new UnicodeBlock("VERTICAL_FORMS",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1909
                             new String[] { "Vertical Forms",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1910
                                            "VerticalForms"});
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1911
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1912
        /**
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1913
         * Constant for the "Ancient Greek Numbers" Unicode character block.
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1914
         * @since 1.7
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1915
         */
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1916
        public static final UnicodeBlock ANCIENT_GREEK_NUMBERS =
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1917
            new UnicodeBlock("ANCIENT_GREEK_NUMBERS",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1918
                             new String[] { "Ancient Greek Numbers",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1919
                                            "AncientGreekNumbers"});
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1920
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1921
        /**
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1922
         * Constant for the "Ancient Symbols" Unicode character block.
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1923
         * @since 1.7
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1924
         */
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1925
        public static final UnicodeBlock ANCIENT_SYMBOLS =
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1926
            new UnicodeBlock("ANCIENT_SYMBOLS",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1927
                             new String[] { "Ancient Symbols",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1928
                                            "AncientSymbols"});
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1929
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1930
        /**
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1931
         * Constant for the "Phaistos Disc" Unicode character block.
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1932
         * @since 1.7
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1933
         */
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1934
        public static final UnicodeBlock PHAISTOS_DISC =
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1935
            new UnicodeBlock("PHAISTOS_DISC",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1936
                             new String[] { "Phaistos Disc",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1937
                                            "PhaistosDisc"});
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1938
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1939
        /**
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1940
         * Constant for the "Lycian" Unicode character block.
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1941
         * @since 1.7
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1942
         */
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1943
        public static final UnicodeBlock LYCIAN = new UnicodeBlock("LYCIAN");
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1944
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1945
        /**
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1946
         * Constant for the "Carian" Unicode character block.
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1947
         * @since 1.7
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1948
         */
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1949
        public static final UnicodeBlock CARIAN = new UnicodeBlock("CARIAN");
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1950
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1951
        /**
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1952
         * Constant for the "Old Persian" Unicode character block.
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1953
         * @since 1.7
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1954
         */
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1955
        public static final UnicodeBlock OLD_PERSIAN =
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1956
            new UnicodeBlock("OLD_PERSIAN",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1957
                             new String[] { "Old Persian",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1958
                                            "OldPersian"});
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1959
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1960
        /**
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1961
         * Constant for the "Phoenician" Unicode character block.
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1962
         * @since 1.7
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1963
         */
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1964
        public static final UnicodeBlock PHOENICIAN =
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1965
            new UnicodeBlock("PHOENICIAN");
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1966
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1967
        /**
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1968
         * Constant for the "Lydian" Unicode character block.
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1969
         * @since 1.7
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1970
         */
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1971
        public static final UnicodeBlock LYDIAN = new UnicodeBlock("LYDIAN");
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1972
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1973
        /**
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1974
         * Constant for the "Kharoshthi" Unicode character block.
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1975
         * @since 1.7
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1976
         */
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1977
        public static final UnicodeBlock KHAROSHTHI =
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1978
            new UnicodeBlock("KHAROSHTHI");
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1979
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1980
        /**
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1981
         * Constant for the "Cuneiform" Unicode character block.
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1982
         * @since 1.7
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1983
         */
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1984
        public static final UnicodeBlock CUNEIFORM =
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1985
            new UnicodeBlock("CUNEIFORM");
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1986
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1987
        /**
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1988
         * Constant for the "Cuneiform Numbers and Punctuation" Unicode
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1989
         * character block.
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1990
         * @since 1.7
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1991
         */
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1992
        public static final UnicodeBlock CUNEIFORM_NUMBERS_AND_PUNCTUATION =
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1993
            new UnicodeBlock("CUNEIFORM_NUMBERS_AND_PUNCTUATION",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1994
                             new String[] { "Cuneiform Numbers and Punctuation",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1995
                                            "CuneiformNumbersandPunctuation"});
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1996
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1997
        /**
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1998
         * Constant for the "Ancient Greek Musical Notation" Unicode character
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  1999
         * block.
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2000
         * @since 1.7
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2001
         */
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2002
        public static final UnicodeBlock ANCIENT_GREEK_MUSICAL_NOTATION =
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2003
            new UnicodeBlock("ANCIENT_GREEK_MUSICAL_NOTATION",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2004
                             new String[] { "Ancient Greek Musical Notation",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2005
                                            "AncientGreekMusicalNotation"});
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2006
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2007
        /**
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2008
         * Constant for the "Counting Rod Numerals" Unicode character block.
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2009
         * @since 1.7
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2010
         */
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2011
        public static final UnicodeBlock COUNTING_ROD_NUMERALS =
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2012
            new UnicodeBlock("COUNTING_ROD_NUMERALS",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2013
                             new String[] { "Counting Rod Numerals",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2014
                                            "CountingRodNumerals"});
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2015
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2016
        /**
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2017
         * Constant for the "Mahjong Tiles" Unicode character block.
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2018
         * @since 1.7
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2019
         */
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2020
        public static final UnicodeBlock MAHJONG_TILES =
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2021
            new UnicodeBlock("MAHJONG_TILES",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2022
                             new String[] { "Mahjong Tiles",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2023
                                            "MahjongTiles"});
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2024
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2025
        /**
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2026
         * Constant for the "Domino Tiles" Unicode character block.
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2027
         * @since 1.7
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2028
         */
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2029
        public static final UnicodeBlock DOMINO_TILES =
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2030
            new UnicodeBlock("DOMINO_TILES",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2031
                             new String[] { "Domino Tiles",
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2032
                                            "DominoTiles"});
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2033
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2034
        private static final int blockStarts[] = {
2497
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2035
            0x0000,   // 0000..007F; Basic Latin
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2036
            0x0080,   // 0080..00FF; Latin-1 Supplement
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2037
            0x0100,   // 0100..017F; Latin Extended-A
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2038
            0x0180,   // 0180..024F; Latin Extended-B
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2039
            0x0250,   // 0250..02AF; IPA Extensions
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2040
            0x02B0,   // 02B0..02FF; Spacing Modifier Letters
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2041
            0x0300,   // 0300..036F; Combining Diacritical Marks
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2042
            0x0370,   // 0370..03FF; Greek and Coptic
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2043
            0x0400,   // 0400..04FF; Cyrillic
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2044
            0x0500,   // 0500..052F; Cyrillic Supplement
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2045
            0x0530,   // 0530..058F; Armenian
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2046
            0x0590,   // 0590..05FF; Hebrew
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2047
            0x0600,   // 0600..06FF; Arabic
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2048
            0x0700,   // 0700..074F; Syria
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2049
            0x0750,   // 0750..077F; Arabic Supplement
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2050
            0x0780,   // 0780..07BF; Thaana
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2051
            0x07C0,   // 07C0..07FF; NKo
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2052
            0x0800,   //             unassigned
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2053
            0x0900,   // 0900..097F; Devanagari
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2054
            0x0980,   // 0980..09FF; Bengali
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2055
            0x0A00,   // 0A00..0A7F; Gurmukhi
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2056
            0x0A80,   // 0A80..0AFF; Gujarati
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2057
            0x0B00,   // 0B00..0B7F; Oriya
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2058
            0x0B80,   // 0B80..0BFF; Tamil
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2059
            0x0C00,   // 0C00..0C7F; Telugu
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2060
            0x0C80,   // 0C80..0CFF; Kannada
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2061
            0x0D00,   // 0D00..0D7F; Malayalam
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2062
            0x0D80,   // 0D80..0DFF; Sinhala
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2063
            0x0E00,   // 0E00..0E7F; Thai
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2064
            0x0E80,   // 0E80..0EFF; Lao
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2065
            0x0F00,   // 0F00..0FFF; Tibetan
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2066
            0x1000,   // 1000..109F; Myanmar
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2067
            0x10A0,   // 10A0..10FF; Georgian
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2068
            0x1100,   // 1100..11FF; Hangul Jamo
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2069
            0x1200,   // 1200..137F; Ethiopic
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2070
            0x1380,   // 1380..139F; Ethiopic Supplement
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2071
            0x13A0,   // 13A0..13FF; Cherokee
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2072
            0x1400,   // 1400..167F; Unified Canadian Aboriginal Syllabics
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2073
            0x1680,   // 1680..169F; Ogham
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2074
            0x16A0,   // 16A0..16FF; Runic
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2075
            0x1700,   // 1700..171F; Tagalog
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2076
            0x1720,   // 1720..173F; Hanunoo
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2077
            0x1740,   // 1740..175F; Buhid
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2078
            0x1760,   // 1760..177F; Tagbanwa
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2079
            0x1780,   // 1780..17FF; Khmer
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2080
            0x1800,   // 1800..18AF; Mongolian
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2081
            0x18B0,   //             unassigned
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2082
            0x1900,   // 1900..194F; Limbu
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2083
            0x1950,   // 1950..197F; Tai Le
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2084
            0x1980,   // 1980..19DF; New Tai Lue
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2085
            0x19E0,   // 19E0..19FF; Khmer Symbols
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2086
            0x1A00,   // 1A00..1A1F; Buginese
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2087
            0x1A20,   //             unassigned
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2088
            0x1B00,   // 1B00..1B7F; Balinese
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2089
            0x1B80,   // 1B80..1BBF; Sundanese
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2090
            0x1BC0,   //             unassigned
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2091
            0x1C00,   // 1C00..1C4F; Lepcha
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2092
            0x1C50,   // 1C50..1C7F; Ol Chiki
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2093
            0x1C80,   //             unassigned
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2094
            0x1D00,   // 1D00..1D7F; Phonetic Extensions
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2095
            0x1D80,   // 1D80..1DBF; Phonetic Extensions Supplement
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2096
            0x1DC0,   // 1DC0..1DFF; Combining Diacritical Marks Supplement
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2097
            0x1E00,   // 1E00..1EFF; Latin Extended Additional
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2098
            0x1F00,   // 1F00..1FFF; Greek Extended
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2099
            0x2000,   // 2000..206F; General Punctuation
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2100
            0x2070,   // 2070..209F; Superscripts and Subscripts
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2101
            0x20A0,   // 20A0..20CF; Currency Symbols
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2102
            0x20D0,   // 20D0..20FF; Combining Diacritical Marks for Symbols
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2103
            0x2100,   // 2100..214F; Letterlike Symbols
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2104
            0x2150,   // 2150..218F; Number Forms
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2105
            0x2190,   // 2190..21FF; Arrows
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2106
            0x2200,   // 2200..22FF; Mathematical Operators
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2107
            0x2300,   // 2300..23FF; Miscellaneous Technical
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2108
            0x2400,   // 2400..243F; Control Pictures
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2109
            0x2440,   // 2440..245F; Optical Character Recognition
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2110
            0x2460,   // 2460..24FF; Enclosed Alphanumerics
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2111
            0x2500,   // 2500..257F; Box Drawing
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2112
            0x2580,   // 2580..259F; Block Elements
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2113
            0x25A0,   // 25A0..25FF; Geometric Shapes
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2114
            0x2600,   // 2600..26FF; Miscellaneous Symbols
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2115
            0x2700,   // 2700..27BF; Dingbats
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2116
            0x27C0,   // 27C0..27EF; Miscellaneous Mathematical Symbols-A
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2117
            0x27F0,   // 27F0..27FF; Supplemental Arrows-A
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2118
            0x2800,   // 2800..28FF; Braille Patterns
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2119
            0x2900,   // 2900..297F; Supplemental Arrows-B
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2120
            0x2980,   // 2980..29FF; Miscellaneous Mathematical Symbols-B
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2121
            0x2A00,   // 2A00..2AFF; Supplemental Mathematical Operators
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2122
            0x2B00,   // 2B00..2BFF; Miscellaneous Symbols and Arrows
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2123
            0x2C00,   // 2C00..2C5F; Glagolitic
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2124
            0x2C60,   // 2C60..2C7F; Latin Extended-C
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2125
            0x2C80,   // 2C80..2CFF; Coptic
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2126
            0x2D00,   // 2D00..2D2F; Georgian Supplement
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2127
            0x2D30,   // 2D30..2D7F; Tifinagh
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2128
            0x2D80,   // 2D80..2DDF; Ethiopic Extended
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2129
            0x2DE0,   // 2DE0..2DFF; Cyrillic Extended-A
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2130
            0x2E00,   // 2E00..2E7F; Supplemental Punctuation
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2131
            0x2E80,   // 2E80..2EFF; CJK Radicals Supplement
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2132
            0x2F00,   // 2F00..2FDF; Kangxi Radicals
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2133
            0x2FE0,   //             unassigned
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2134
            0x2FF0,   // 2FF0..2FFF; Ideographic Description Characters
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2135
            0x3000,   // 3000..303F; CJK Symbols and Punctuation
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2136
            0x3040,   // 3040..309F; Hiragana
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2137
            0x30A0,   // 30A0..30FF; Katakana
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2138
            0x3100,   // 3100..312F; Bopomofo
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2139
            0x3130,   // 3130..318F; Hangul Compatibility Jamo
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2140
            0x3190,   // 3190..319F; Kanbun
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2141
            0x31A0,   // 31A0..31BF; Bopomofo Extended
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2142
            0x31C0,   // 31C0..31EF; CJK Strokes
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2143
            0x31F0,   // 31F0..31FF; Katakana Phonetic Extensions
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2144
            0x3200,   // 3200..32FF; Enclosed CJK Letters and Months
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2145
            0x3300,   // 3300..33FF; CJK Compatibility
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2146
            0x3400,   // 3400..4DBF; CJK Unified Ideographs Extension A
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2147
            0x4DC0,   // 4DC0..4DFF; Yijing Hexagram Symbols
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2148
            0x4E00,   // 4E00..9FFF; CJK Unified Ideograph
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2149
            0xA000,   // A000..A48F; Yi Syllables
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2150
            0xA490,   // A490..A4CF; Yi Radicals
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2151
            0xA4D0,   //             unassigned
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2152
            0xA500,   // A500..A63F; Vai
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2153
            0xA640,   // A640..A69F; Cyrillic Extended-B
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2154
            0xA6A0,   //             unassigned
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2155
            0xA700,   // A700..A71F; Modifier Tone Letters
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2156
            0xA720,   // A720..A7FF; Latin Extended-D
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2157
            0xA800,   // A800..A82F; Syloti Nagri
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2158
            0xA830,   //             unassigned
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2159
            0xA840,   // A840..A87F; Phags-pa
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2160
            0xA880,   // A880..A8DF; Saurashtra
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2161
            0xA8E0,   //             unassigned
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2162
            0xA900,   // A900..A92F; Kayah Li
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2163
            0xA930,   // A930..A95F; Rejang
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2164
            0xA960,   //             unassigned
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2165
            0xAA00,   // AA00..AA5F; Cham
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2166
            0xAA60,   //             unassigned
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2167
            0xAC00,   // AC00..D7AF; Hangul Syllables
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2168
            0xD7B0,   //             unassigned
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2169
            0xD800,   // D800..DB7F; High Surrogates
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2170
            0xDB80,   // DB80..DBFF; High Private Use Surrogates
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2171
            0xDC00,   // DC00..DFFF; Low Surrogates
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2172
            0xE000,   // E000..F8FF; Private Use Area
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2173
            0xF900,   // F900..FAFF; CJK Compatibility Ideographs
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2174
            0xFB00,   // FB00..FB4F; Alphabetic Presentation Forms
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2175
            0xFB50,   // FB50..FDFF; Arabic Presentation Forms-A
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2176
            0xFE00,   // FE00..FE0F; Variation Selectors
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2177
            0xFE10,   // FE10..FE1F; Vertical Forms
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2178
            0xFE20,   // FE20..FE2F; Combining Half Marks
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2179
            0xFE30,   // FE30..FE4F; CJK Compatibility Forms
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2180
            0xFE50,   // FE50..FE6F; Small Form Variants
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2181
            0xFE70,   // FE70..FEFF; Arabic Presentation Forms-B
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2182
            0xFF00,   // FF00..FFEF; Halfwidth and Fullwidth Forms
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2183
            0xFFF0,   // FFF0..FFFF; Specials
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2184
            0x10000,  // 10000..1007F; Linear B Syllabary
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2185
            0x10080,  // 10080..100FF; Linear B Ideograms
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2186
            0x10100,  // 10100..1013F; Aegean Numbers
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2187
            0x10140,  // 10140..1018F; Ancient Greek Numbers
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2188
            0x10190,  // 10190..101CF; Ancient Symbols
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2189
            0x101D0,  // 101D0..101FF; Phaistos Disc
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2190
            0x10200,  //               unassigned
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2191
            0x10280,  // 10280..1029F; Lycian
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2192
            0x102A0,  // 102A0..102DF; Carian
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2193
            0x102E0,  //               unassigned
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2194
            0x10300,  // 10300..1032F; Old Italic
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2195
            0x10330,  // 10330..1034F; Gothic
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2196
            0x10350,  //               unassigned
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2197
            0x10380,  // 10380..1039F; Ugaritic
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2198
            0x103A0,  // 103A0..103DF; Old Persian
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2199
            0x103E0,  //               unassigned
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2200
            0x10400,  // 10400..1044F; Desere
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2201
            0x10450,  // 10450..1047F; Shavian
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2202
            0x10480,  // 10480..104AF; Osmanya
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2203
            0x104B0,  //               unassigned
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2204
            0x10800,  // 10800..1083F; Cypriot Syllabary
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2205
            0x10840,  //               unassigned
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2206
            0x10900,  // 10900..1091F; Phoenician
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2207
            0x10920,  // 10920..1093F; Lydian
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2208
            0x10940,  //               unassigned
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2209
            0x10A00,  // 10A00..10A5F; Kharoshthi
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2210
            0x10A60,  //               unassigned
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2211
            0x12000,  // 12000..123FF; Cuneiform
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2212
            0x12400,  // 12400..1247F; Cuneiform Numbers and Punctuation
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2213
            0x12480,  //               unassigned
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2214
            0x1D000,  // 1D000..1D0FF; Byzantine Musical Symbols
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2215
            0x1D100,  // 1D100..1D1FF; Musical Symbols
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2216
            0x1D200,  // 1D200..1D24F; Ancient Greek Musical Notation
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2217
            0x1D250,  //               unassigned
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2218
            0x1D300,  // 1D300..1D35F; Tai Xuan Jing Symbols
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2219
            0x1D360,  // 1D360..1D37F; Counting Rod Numerals
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2220
            0x1D380,  //               unassigned
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2221
            0x1D400,  // 1D400..1D7FF; Mathematical Alphanumeric Symbols
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2222
            0x1D800,  //               unassigned
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2223
            0x1F000,  // 1F000..1F02F; Mahjong Tiles
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2224
            0x1F030,  // 1F030..1F09F; Domino Tiles
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2225
            0x1F0A0,  //               unassigned
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2226
            0x20000,  // 20000..2A6DF; CJK Unified Ideographs Extension B
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2227
            0x2A6E0,  //               unassigned
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2228
            0x2F800,  // 2F800..2FA1F; CJK Compatibility Ideographs Supplement
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2229
            0x2FA20,  //               unassigned
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2230
            0xE0000,  // E0000..E007F; Tags
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2231
            0xE0080,  //               unassigned
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2232
            0xE0100,  // E0100..E01EF; Variation Selectors Supplement
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2233
            0xE01F0,  //               unassigned
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2234
            0xF0000,  // F0000..FFFFF; Supplementary Private Use Area-A
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2235
            0x100000, // 100000..10FFFF; Supplementary Private Use Area-B
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2236
        };
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2237
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2238
        private static final UnicodeBlock[] blocks = {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2239
            BASIC_LATIN,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2240
            LATIN_1_SUPPLEMENT,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2241
            LATIN_EXTENDED_A,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2242
            LATIN_EXTENDED_B,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2243
            IPA_EXTENSIONS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2244
            SPACING_MODIFIER_LETTERS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2245
            COMBINING_DIACRITICAL_MARKS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2246
            GREEK,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2247
            CYRILLIC,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2248
            CYRILLIC_SUPPLEMENTARY,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2249
            ARMENIAN,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2250
            HEBREW,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2251
            ARABIC,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2252
            SYRIAC,
2497
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2253
            ARABIC_SUPPLEMENT,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2254
            THAANA,
2497
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2255
            NKO,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2256
            null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2257
            DEVANAGARI,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2258
            BENGALI,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2259
            GURMUKHI,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2260
            GUJARATI,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2261
            ORIYA,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2262
            TAMIL,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2263
            TELUGU,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2264
            KANNADA,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2265
            MALAYALAM,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2266
            SINHALA,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2267
            THAI,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2268
            LAO,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2269
            TIBETAN,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2270
            MYANMAR,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2271
            GEORGIAN,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2272
            HANGUL_JAMO,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2273
            ETHIOPIC,
2497
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2274
            ETHIOPIC_SUPPLEMENT,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2275
            CHEROKEE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2276
            UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2277
            OGHAM,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2278
            RUNIC,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2279
            TAGALOG,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2280
            HANUNOO,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2281
            BUHID,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2282
            TAGBANWA,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2283
            KHMER,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2284
            MONGOLIAN,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2285
            null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2286
            LIMBU,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2287
            TAI_LE,
2497
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2288
            NEW_TAI_LUE,
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2289
            KHMER_SYMBOLS,
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2290
            BUGINESE,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2291
            null,
2497
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2292
            BALINESE,
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2293
            SUNDANESE,
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2294
            null,
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2295
            LEPCHA,
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2296
            OL_CHIKI,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2297
            null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2298
            PHONETIC_EXTENSIONS,
2497
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2299
            PHONETIC_EXTENSIONS_SUPPLEMENT,
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2300
            COMBINING_DIACRITICAL_MARKS_SUPPLEMENT,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2301
            LATIN_EXTENDED_ADDITIONAL,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2302
            GREEK_EXTENDED,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2303
            GENERAL_PUNCTUATION,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2304
            SUPERSCRIPTS_AND_SUBSCRIPTS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2305
            CURRENCY_SYMBOLS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2306
            COMBINING_MARKS_FOR_SYMBOLS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2307
            LETTERLIKE_SYMBOLS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2308
            NUMBER_FORMS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2309
            ARROWS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2310
            MATHEMATICAL_OPERATORS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2311
            MISCELLANEOUS_TECHNICAL,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2312
            CONTROL_PICTURES,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2313
            OPTICAL_CHARACTER_RECOGNITION,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2314
            ENCLOSED_ALPHANUMERICS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2315
            BOX_DRAWING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2316
            BLOCK_ELEMENTS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2317
            GEOMETRIC_SHAPES,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2318
            MISCELLANEOUS_SYMBOLS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2319
            DINGBATS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2320
            MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2321
            SUPPLEMENTAL_ARROWS_A,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2322
            BRAILLE_PATTERNS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2323
            SUPPLEMENTAL_ARROWS_B,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2324
            MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2325
            SUPPLEMENTAL_MATHEMATICAL_OPERATORS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2326
            MISCELLANEOUS_SYMBOLS_AND_ARROWS,
2497
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2327
            GLAGOLITIC,
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2328
            LATIN_EXTENDED_C,
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2329
            COPTIC,
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2330
            GEORGIAN_SUPPLEMENT,
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2331
            TIFINAGH,
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2332
            ETHIOPIC_EXTENDED,
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2333
            CYRILLIC_EXTENDED_A,
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2334
            SUPPLEMENTAL_PUNCTUATION,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2335
            CJK_RADICALS_SUPPLEMENT,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2336
            KANGXI_RADICALS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2337
            null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2338
            IDEOGRAPHIC_DESCRIPTION_CHARACTERS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2339
            CJK_SYMBOLS_AND_PUNCTUATION,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2340
            HIRAGANA,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2341
            KATAKANA,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2342
            BOPOMOFO,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2343
            HANGUL_COMPATIBILITY_JAMO,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2344
            KANBUN,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2345
            BOPOMOFO_EXTENDED,
2497
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2346
            CJK_STROKES,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2347
            KATAKANA_PHONETIC_EXTENSIONS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2348
            ENCLOSED_CJK_LETTERS_AND_MONTHS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2349
            CJK_COMPATIBILITY,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2350
            CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2351
            YIJING_HEXAGRAM_SYMBOLS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2352
            CJK_UNIFIED_IDEOGRAPHS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2353
            YI_SYLLABLES,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2354
            YI_RADICALS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2355
            null,
2497
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2356
            VAI,
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2357
            CYRILLIC_EXTENDED_B,
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2358
            null,
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2359
            MODIFIER_TONE_LETTERS,
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2360
            LATIN_EXTENDED_D,
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2361
            SYLOTI_NAGRI,
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2362
            null,
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2363
            PHAGS_PA,
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2364
            SAURASHTRA,
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2365
            null,
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2366
            KAYAH_LI,
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2367
            REJANG,
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2368
            null,
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2369
            CHAM,
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2370
            null,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2371
            HANGUL_SYLLABLES,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2372
            null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2373
            HIGH_SURROGATES,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2374
            HIGH_PRIVATE_USE_SURROGATES,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2375
            LOW_SURROGATES,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2376
            PRIVATE_USE_AREA,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2377
            CJK_COMPATIBILITY_IDEOGRAPHS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2378
            ALPHABETIC_PRESENTATION_FORMS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2379
            ARABIC_PRESENTATION_FORMS_A,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2380
            VARIATION_SELECTORS,
2497
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2381
            VERTICAL_FORMS,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2382
            COMBINING_HALF_MARKS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2383
            CJK_COMPATIBILITY_FORMS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2384
            SMALL_FORM_VARIANTS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2385
            ARABIC_PRESENTATION_FORMS_B,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2386
            HALFWIDTH_AND_FULLWIDTH_FORMS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2387
            SPECIALS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2388
            LINEAR_B_SYLLABARY,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2389
            LINEAR_B_IDEOGRAMS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2390
            AEGEAN_NUMBERS,
2497
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2391
            ANCIENT_GREEK_NUMBERS,
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2392
            ANCIENT_SYMBOLS,
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2393
            PHAISTOS_DISC,
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2394
            null,
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2395
            LYCIAN,
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2396
            CARIAN,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2397
            null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2398
            OLD_ITALIC,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2399
            GOTHIC,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2400
            null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2401
            UGARITIC,
2497
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2402
            OLD_PERSIAN,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2403
            null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2404
            DESERET,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2405
            SHAVIAN,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2406
            OSMANYA,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2407
            null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2408
            CYPRIOT_SYLLABARY,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2409
            null,
2497
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2410
            PHOENICIAN,
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2411
            LYDIAN,
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2412
            null,
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2413
            KHAROSHTHI,
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2414
            null,
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2415
            CUNEIFORM,
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2416
            CUNEIFORM_NUMBERS_AND_PUNCTUATION,
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2417
            null,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2418
            BYZANTINE_MUSICAL_SYMBOLS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2419
            MUSICAL_SYMBOLS,
2497
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2420
            ANCIENT_GREEK_MUSICAL_NOTATION,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2421
            null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2422
            TAI_XUAN_JING_SYMBOLS,
2497
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2423
            COUNTING_ROD_NUMERALS,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2424
            null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2425
            MATHEMATICAL_ALPHANUMERIC_SYMBOLS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2426
            null,
2497
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2427
            MAHJONG_TILES,
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2428
            DOMINO_TILES,
903fd9d785ef 6404304: RFE: Unicode 5.1 support
peytoia
parents: 2
diff changeset
  2429
            null,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2430
            CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2431
            null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2432
            CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2433
            null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2434
            TAGS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2435
            null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2436
            VARIATION_SELECTORS_SUPPLEMENT,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2437
            null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2438
            SUPPLEMENTARY_PRIVATE_USE_AREA_A,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2439
            SUPPLEMENTARY_PRIVATE_USE_AREA_B
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2440
        };
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2441
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2442
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2443
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2444
         * Returns the object representing the Unicode block containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2445
         * given character, or <code>null</code> if the character is not a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2446
         * member of a defined block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2447
         *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2448
                 * <p><b>Note:</b> This method cannot handle <a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2449
                 * href="Character.html#supplementary"> supplementary
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2450
                 * characters</a>. To support all Unicode characters,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2451
                 * including supplementary characters, use the {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2452
                 * #of(int)} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2453
         *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2454
         * @param   c  The character in question
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2455
         * @return  The <code>UnicodeBlock</code> instance representing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2456
         *          Unicode block of which this character is a member, or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2457
         *          <code>null</code> if the character is not a member of any
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2458
         *          Unicode block
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2459
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2460
        public static UnicodeBlock of(char c) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2461
            return of((int)c);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2462
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2463
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2464
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2465
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2466
         * Returns the object representing the Unicode block
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2467
         * containing the given character (Unicode code point), or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2468
         * <code>null</code> if the character is not a member of a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2469
         * defined block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2470
         *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2471
                 * @param   codePoint the character (Unicode code point) in question.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2472
         * @return  The <code>UnicodeBlock</code> instance representing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2473
         *          Unicode block of which this character is a member, or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2474
         *          <code>null</code> if the character is not a member of any
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2475
         *          Unicode block
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2476
                 * @exception IllegalArgumentException if the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2477
                 * <code>codePoint</code> is an invalid Unicode code point.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2478
                 * @see Character#isValidCodePoint(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2479
                 * @since   1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2480
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2481
        public static UnicodeBlock of(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2482
            if (!isValidCodePoint(codePoint)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2483
                throw new IllegalArgumentException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2484
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2485
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2486
            int top, bottom, current;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2487
            bottom = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2488
            top = blockStarts.length;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2489
            current = top/2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2490
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2491
            // invariant: top > current >= bottom && codePoint >= unicodeBlockStarts[bottom]
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2492
            while (top - bottom > 1) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2493
                if (codePoint >= blockStarts[current]) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2494
                    bottom = current;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2495
                } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2496
                    top = current;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2497
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2498
                current = (top + bottom) / 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2499
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2500
            return blocks[current];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2501
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2502
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2503
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2504
         * Returns the UnicodeBlock with the given name. Block
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2505
         * names are determined by The Unicode Standard. The file
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2506
         * Blocks-&lt;version&gt;.txt defines blocks for a particular
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2507
         * version of the standard. The {@link Character} class specifies
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2508
         * the version of the standard that it supports.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2509
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2510
         * This method accepts block names in the following forms:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2511
         * <ol>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2512
         * <li> Canonical block names as defined by the Unicode Standard.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2513
         * For example, the standard defines a "Basic Latin" block. Therefore, this
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2514
         * method accepts "Basic Latin" as a valid block name. The documentation of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2515
         * each UnicodeBlock provides the canonical name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2516
         * <li>Canonical block names with all spaces removed. For example, "BasicLatin"
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2517
         * is a valid block name for the "Basic Latin" block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2518
         * <li>The text representation of each constant UnicodeBlock identifier.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2519
         * For example, this method will return the {@link #BASIC_LATIN} block if
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2520
         * provided with the "BASIC_LATIN" name. This form replaces all spaces and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2521
         *  hyphens in the canonical name with underscores.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2522
         * </ol>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2523
         * Finally, character case is ignored for all of the valid block name forms.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2524
         * For example, "BASIC_LATIN" and "basic_latin" are both valid block names.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2525
         * The en_US locale's case mapping rules are used to provide case-insensitive
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2526
         * string comparisons for block name validation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2527
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2528
         * If the Unicode Standard changes block names, both the previous and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2529
         * current names will be accepted.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2530
         *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2531
         * @param blockName A <code>UnicodeBlock</code> name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2532
         * @return The <code>UnicodeBlock</code> instance identified
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2533
         *         by <code>blockName</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2534
         * @throws IllegalArgumentException if <code>blockName</code> is an
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2535
         *         invalid name
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2536
         * @throws NullPointerException if <code>blockName</code> is null
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2537
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2538
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2539
        public static final UnicodeBlock forName(String blockName) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2540
            UnicodeBlock block = (UnicodeBlock)map.get(blockName.toUpperCase(Locale.US));
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2541
            if (block == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2542
                throw new IllegalArgumentException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2543
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2544
            return block;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2545
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2546
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2547
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2548
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2549
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2550
     * The value of the <code>Character</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2551
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2552
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2553
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2554
    private final char value;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2555
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2556
    /** use serialVersionUID from JDK 1.0.2 for interoperability */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2557
    private static final long serialVersionUID = 3786198910865385080L;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2558
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2559
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2560
     * Constructs a newly allocated <code>Character</code> object that
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2561
     * represents the specified <code>char</code> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2562
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2563
     * @param  value   the value to be represented by the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2564
     *                  <code>Character</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2565
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2566
    public Character(char value) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2567
        this.value = value;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2568
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2569
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2570
    private static class CharacterCache {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2571
        private CharacterCache(){}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2572
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2573
        static final Character cache[] = new Character[127 + 1];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2574
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2575
        static {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2576
            for(int i = 0; i < cache.length; i++)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2577
                cache[i] = new Character((char)i);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2578
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2579
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2580
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2581
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2582
     * Returns a <tt>Character</tt> instance representing the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2583
     * <tt>char</tt> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2584
     * If a new <tt>Character</tt> instance is not required, this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2585
     * should generally be used in preference to the constructor
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2586
     * {@link #Character(char)}, as this method is likely to yield
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2587
     * significantly better space and time performance by caching
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2588
     * frequently requested values.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2589
     *
3719
b00a1e55ec44 6879368: Remove stray quote in Character javadoc
martin
parents: 3714
diff changeset
  2590
     * This method will always cache values in the range {@code
b00a1e55ec44 6879368: Remove stray quote in Character javadoc
martin
parents: 3714
diff changeset
  2591
     * '\u005Cu0000'} to {@code '\u005Cu007f'}, inclusive, and may
b00a1e55ec44 6879368: Remove stray quote in Character javadoc
martin
parents: 3714
diff changeset
  2592
     * cache other values outside of this range.
3224
3aa65803ae07 6628737: Specification of wrapper class valueOf static factories should require caching
darcy
parents: 2497
diff changeset
  2593
     *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2594
     * @param  c a char value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2595
     * @return a <tt>Character</tt> instance representing <tt>c</tt>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2596
     * @since  1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2597
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2598
    public static Character valueOf(char c) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2599
        if(c <= 127) { // must cache
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2600
            return CharacterCache.cache[(int)c];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2601
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2602
        return new Character(c);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2603
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2604
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2605
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2606
     * Returns the value of this <code>Character</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2607
     * @return  the primitive <code>char</code> value represented by
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2608
     *          this object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2609
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2610
    public char charValue() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2611
        return value;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2612
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2613
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2614
    /**
3942
685e04a98396 4245470: algorithm of java.lang.Byte.hashCode() is not specified
martin
parents: 3719
diff changeset
  2615
     * Returns a hash code for this {@code Character}; equal to the result
685e04a98396 4245470: algorithm of java.lang.Byte.hashCode() is not specified
martin
parents: 3719
diff changeset
  2616
     * of invoking {@code charValue()}.
685e04a98396 4245470: algorithm of java.lang.Byte.hashCode() is not specified
martin
parents: 3719
diff changeset
  2617
     *
685e04a98396 4245470: algorithm of java.lang.Byte.hashCode() is not specified
martin
parents: 3719
diff changeset
  2618
     * @return a hash code value for this {@code Character}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2619
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2620
    public int hashCode() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2621
        return (int)value;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2622
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2623
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2624
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2625
     * Compares this object against the specified object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2626
     * The result is <code>true</code> if and only if the argument is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2627
     * <code>null</code> and is a <code>Character</code> object that
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2628
     * represents the same <code>char</code> value as this object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2629
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2630
     * @param   obj   the object to compare with.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2631
     * @return  <code>true</code> if the objects are the same;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2632
     *          <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2633
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2634
    public boolean equals(Object obj) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2635
        if (obj instanceof Character) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2636
            return value == ((Character)obj).charValue();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2637
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2638
        return false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2639
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2640
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2641
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2642
     * Returns a <code>String</code> object representing this
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2643
     * <code>Character</code>'s value.  The result is a string of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2644
     * length 1 whose sole component is the primitive
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2645
     * <code>char</code> value represented by this
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2646
     * <code>Character</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2647
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2648
     * @return  a string representation of this object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2649
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2650
    public String toString() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2651
        char buf[] = {value};
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2652
        return String.valueOf(buf);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2653
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2654
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2655
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2656
     * Returns a <code>String</code> object representing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2657
     * specified <code>char</code>.  The result is a string of length
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2658
     * 1 consisting solely of the specified <code>char</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2659
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2660
     * @param c the <code>char</code> to be converted
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2661
     * @return the string representation of the specified <code>char</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2662
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2663
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2664
    public static String toString(char c) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2665
        return String.valueOf(c);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2666
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2667
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2668
    /**
3714
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2669
     * Determines whether the specified code point is a valid
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2670
     * <a href="http://www.unicode.org/glossary/#code_point">
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2671
     * Unicode code point value</a>.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2672
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2673
     * @param  codePoint the Unicode code point to be tested
3714
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2674
     * @return {@code true} if the specified code point value is between
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2675
     *         {@link #MIN_CODE_POINT} and
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2676
     *         {@link #MAX_CODE_POINT} inclusive;
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2677
     *         {@code false} otherwise.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2678
     * @since  1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2679
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2680
    public static boolean isValidCodePoint(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2681
        return codePoint >= MIN_CODE_POINT && codePoint <= MAX_CODE_POINT;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2682
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2683
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2684
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2685
     * Determines whether the specified character (Unicode code point)
3714
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2686
     * is in the <a href="#supplementary">supplementary character</a> range.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2687
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2688
     * @param  codePoint the character (Unicode code point) to be tested
3714
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2689
     * @return {@code true} if the specified code point is between
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2690
     *         {@link #MIN_SUPPLEMENTARY_CODE_POINT} and
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2691
     *         {@link #MAX_CODE_POINT} inclusive;
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2692
     *         {@code false} otherwise.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2693
     * @since  1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2694
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2695
    public static boolean isSupplementaryCodePoint(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2696
        return codePoint >= MIN_SUPPLEMENTARY_CODE_POINT
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2697
            && codePoint <= MAX_CODE_POINT;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2698
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2699
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2700
    /**
3714
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2701
     * Determines if the given {@code char} value is a
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2702
     * <a href="http://www.unicode.org/glossary/#high_surrogate_code_unit">
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2703
     * Unicode high-surrogate code unit</a>
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2704
     * (also known as <i>leading-surrogate code unit</i>).
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2705
     *
3714
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2706
     * <p>Such values do not represent characters by themselves,
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2707
     * but are used in the representation of
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2708
     * <a href="#supplementary">supplementary characters</a>
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2709
     * in the UTF-16 encoding.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2710
     *
3714
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2711
     * @param  ch the {@code char} value to be tested.
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2712
     * @return {@code true} if the {@code char} value is between
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2713
     *         {@link #MIN_HIGH_SURROGATE} and
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2714
     *         {@link #MAX_HIGH_SURROGATE} inclusive;
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2715
     *         {@code false} otherwise.
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2716
     * @see    #isLowSurrogate(char)
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2717
     * @see    Character.UnicodeBlock#of(int)
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2718
     * @since  1.5
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2719
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2720
    public static boolean isHighSurrogate(char ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2721
        return ch >= MIN_HIGH_SURROGATE && ch <= MAX_HIGH_SURROGATE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2722
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2723
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2724
    /**
3714
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2725
     * Determines if the given {@code char} value is a
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2726
     * <a href="http://www.unicode.org/glossary/#low_surrogate_code_unit">
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2727
     * Unicode low-surrogate code unit</a>
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2728
     * (also known as <i>trailing-surrogate code unit</i>).
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2729
     *
3714
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2730
     * <p>Such values do not represent characters by themselves,
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2731
     * but are used in the representation of
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2732
     * <a href="#supplementary">supplementary characters</a>
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2733
     * in the UTF-16 encoding.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2734
     *
3714
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2735
     * @param  ch the {@code char} value to be tested.
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2736
     * @return {@code true} if the {@code char} value is between
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2737
     *         {@link #MIN_LOW_SURROGATE} and
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2738
     *         {@link #MAX_LOW_SURROGATE} inclusive;
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2739
     *         {@code false} otherwise.
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2740
     * @see    #isHighSurrogate(char)
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2741
     * @since  1.5
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2742
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2743
    public static boolean isLowSurrogate(char ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2744
        return ch >= MIN_LOW_SURROGATE && ch <= MAX_LOW_SURROGATE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2745
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2746
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2747
    /**
3714
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2748
     * Determines if the given {@code char} value is a Unicode
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2749
     * <i>surrogate code unit</i>.
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2750
     *
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2751
     * <p>Such values do not represent characters by themselves,
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2752
     * but are used in the representation of
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2753
     * <a href="#supplementary">supplementary characters</a>
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2754
     * in the UTF-16 encoding.
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2755
     *
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2756
     * <p>A char value is a surrogate code unit if and only if it is either
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2757
     * a {@linkplain #isLowSurrogate(char) low-surrogate code unit} or
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2758
     * a {@linkplain #isHighSurrogate(char) high-surrogate code unit}.
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2759
     *
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2760
     * @param  ch the {@code char} value to be tested.
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2761
     * @return {@code true} if the {@code char} value is between
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2762
     *         {@link #MIN_SURROGATE} and
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2763
     *         {@link #MAX_SURROGATE} inclusive;
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2764
     *         {@code false} otherwise.
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2765
     * @since  1.7
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2766
     */
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2767
    public static boolean isSurrogate(char ch) {
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2768
        return ch >= MIN_SURROGATE && ch <= MAX_SURROGATE;
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2769
    }
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2770
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2771
    /**
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2772
     * Determines whether the specified pair of <code>char</code>
3714
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2773
     * values is a valid
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2774
     * <a href="http://www.unicode.org/glossary/#surrogate_pair">
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2775
     * Unicode surrogate pair</a>.
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2776
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  2777
     * <p>This method is equivalent to the expression:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2778
     * <blockquote><pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2779
     * isHighSurrogate(high) && isLowSurrogate(low)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2780
     * </pre></blockquote>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2781
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2782
     * @param  high the high-surrogate code value to be tested
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2783
     * @param  low the low-surrogate code value to be tested
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2784
     * @return <code>true</code> if the specified high and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2785
     * low-surrogate code values represent a valid surrogate pair;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2786
     * <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2787
     * @since  1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2788
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2789
    public static boolean isSurrogatePair(char high, char low) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2790
        return isHighSurrogate(high) && isLowSurrogate(low);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2791
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2792
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2793
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2794
     * Determines the number of <code>char</code> values needed to
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2795
     * represent the specified character (Unicode code point). If the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2796
     * specified character is equal to or greater than 0x10000, then
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2797
     * the method returns 2. Otherwise, the method returns 1.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2798
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2799
     * <p>This method doesn't validate the specified character to be a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2800
     * valid Unicode code point. The caller must validate the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2801
     * character value using {@link #isValidCodePoint(int) isValidCodePoint}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2802
     * if necessary.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2803
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2804
     * @param   codePoint the character (Unicode code point) to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2805
     * @return  2 if the character is a valid supplementary character; 1 otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2806
     * @see     #isSupplementaryCodePoint(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2807
     * @since   1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2808
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2809
    public static int charCount(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2810
        return codePoint >= MIN_SUPPLEMENTARY_CODE_POINT? 2 : 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2811
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2812
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2813
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2814
     * Converts the specified surrogate pair to its supplementary code
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2815
     * point value. This method does not validate the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2816
     * surrogate pair. The caller must validate it using {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2817
     * #isSurrogatePair(char, char) isSurrogatePair} if necessary.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2818
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2819
     * @param  high the high-surrogate code unit
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2820
     * @param  low the low-surrogate code unit
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2821
     * @return the supplementary code point composed from the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2822
     *         specified surrogate pair.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2823
     * @since  1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2824
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2825
    public static int toCodePoint(char high, char low) {
3323
29b6893c6188 6639443: Character.toCodePoint and Character.toSurrogates can be optimized
martin
parents: 3224
diff changeset
  2826
        // Optimized form of:
29b6893c6188 6639443: Character.toCodePoint and Character.toSurrogates can be optimized
martin
parents: 3224
diff changeset
  2827
        // return ((high - MIN_HIGH_SURROGATE) << 10)
29b6893c6188 6639443: Character.toCodePoint and Character.toSurrogates can be optimized
martin
parents: 3224
diff changeset
  2828
        //         + (low - MIN_LOW_SURROGATE)
29b6893c6188 6639443: Character.toCodePoint and Character.toSurrogates can be optimized
martin
parents: 3224
diff changeset
  2829
        //         + MIN_SUPPLEMENTARY_CODE_POINT;
29b6893c6188 6639443: Character.toCodePoint and Character.toSurrogates can be optimized
martin
parents: 3224
diff changeset
  2830
        return ((high << 10) + low) + (MIN_SUPPLEMENTARY_CODE_POINT
29b6893c6188 6639443: Character.toCodePoint and Character.toSurrogates can be optimized
martin
parents: 3224
diff changeset
  2831
                                       - (MIN_HIGH_SURROGATE << 10)
29b6893c6188 6639443: Character.toCodePoint and Character.toSurrogates can be optimized
martin
parents: 3224
diff changeset
  2832
                                       - MIN_LOW_SURROGATE);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2833
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2834
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2835
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2836
     * Returns the code point at the given index of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2837
     * <code>CharSequence</code>. If the <code>char</code> value at
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2838
     * the given index in the <code>CharSequence</code> is in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2839
     * high-surrogate range, the following index is less than the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2840
     * length of the <code>CharSequence</code>, and the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2841
     * <code>char</code> value at the following index is in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2842
     * low-surrogate range, then the supplementary code point
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2843
     * corresponding to this surrogate pair is returned. Otherwise,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2844
     * the <code>char</code> value at the given index is returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2845
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2846
     * @param seq a sequence of <code>char</code> values (Unicode code
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2847
     * units)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2848
     * @param index the index to the <code>char</code> values (Unicode
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2849
     * code units) in <code>seq</code> to be converted
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2850
     * @return the Unicode code point at the given index
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2851
     * @exception NullPointerException if <code>seq</code> is null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2852
     * @exception IndexOutOfBoundsException if the value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2853
     * <code>index</code> is negative or not less than
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2854
     * {@link CharSequence#length() seq.length()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2855
     * @since  1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2856
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2857
    public static int codePointAt(CharSequence seq, int index) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2858
        char c1 = seq.charAt(index++);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2859
        if (isHighSurrogate(c1)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2860
            if (index < seq.length()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2861
                char c2 = seq.charAt(index);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2862
                if (isLowSurrogate(c2)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2863
                    return toCodePoint(c1, c2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2864
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2865
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2866
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2867
        return c1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2868
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2869
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2870
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2871
     * Returns the code point at the given index of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2872
     * <code>char</code> array. If the <code>char</code> value at
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2873
     * the given index in the <code>char</code> array is in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2874
     * high-surrogate range, the following index is less than the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2875
     * length of the <code>char</code> array, and the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2876
     * <code>char</code> value at the following index is in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2877
     * low-surrogate range, then the supplementary code point
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2878
     * corresponding to this surrogate pair is returned. Otherwise,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2879
     * the <code>char</code> value at the given index is returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2880
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2881
     * @param a the <code>char</code> array
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2882
     * @param index the index to the <code>char</code> values (Unicode
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2883
     * code units) in the <code>char</code> array to be converted
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2884
     * @return the Unicode code point at the given index
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2885
     * @exception NullPointerException if <code>a</code> is null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2886
     * @exception IndexOutOfBoundsException if the value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2887
     * <code>index</code> is negative or not less than
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2888
     * the length of the <code>char</code> array.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2889
     * @since  1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2890
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2891
    public static int codePointAt(char[] a, int index) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2892
        return codePointAtImpl(a, index, a.length);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2893
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2894
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2895
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2896
     * Returns the code point at the given index of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2897
     * <code>char</code> array, where only array elements with
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2898
     * <code>index</code> less than <code>limit</code> can be used. If
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2899
     * the <code>char</code> value at the given index in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2900
     * <code>char</code> array is in the high-surrogate range, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2901
     * following index is less than the <code>limit</code>, and the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2902
     * <code>char</code> value at the following index is in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2903
     * low-surrogate range, then the supplementary code point
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2904
     * corresponding to this surrogate pair is returned. Otherwise,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2905
     * the <code>char</code> value at the given index is returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2906
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2907
     * @param a the <code>char</code> array
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2908
     * @param index the index to the <code>char</code> values (Unicode
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2909
     * code units) in the <code>char</code> array to be converted
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2910
     * @param limit the index after the last array element that can be used in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2911
     * <code>char</code> array
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2912
     * @return the Unicode code point at the given index
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2913
     * @exception NullPointerException if <code>a</code> is null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2914
     * @exception IndexOutOfBoundsException if the <code>index</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2915
     * argument is negative or not less than the <code>limit</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2916
     * argument, or if the <code>limit</code> argument is negative or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2917
     * greater than the length of the <code>char</code> array.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2918
     * @since  1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2919
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2920
    public static int codePointAt(char[] a, int index, int limit) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2921
        if (index >= limit || limit < 0 || limit > a.length) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2922
            throw new IndexOutOfBoundsException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2923
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2924
        return codePointAtImpl(a, index, limit);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2925
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2926
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2927
    static int codePointAtImpl(char[] a, int index, int limit) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2928
        char c1 = a[index++];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2929
        if (isHighSurrogate(c1)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2930
            if (index < limit) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2931
                char c2 = a[index];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2932
                if (isLowSurrogate(c2)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2933
                    return toCodePoint(c1, c2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2934
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2935
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2936
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2937
        return c1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2938
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2939
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2940
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2941
     * Returns the code point preceding the given index of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2942
     * <code>CharSequence</code>. If the <code>char</code> value at
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2943
     * <code>(index - 1)</code> in the <code>CharSequence</code> is in
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2944
     * the low-surrogate range, <code>(index - 2)</code> is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2945
     * negative, and the <code>char</code> value at <code>(index -
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2946
     * 2)</code> in the <code>CharSequence</code> is in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2947
     * high-surrogate range, then the supplementary code point
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2948
     * corresponding to this surrogate pair is returned. Otherwise,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2949
     * the <code>char</code> value at <code>(index - 1)</code> is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2950
     * returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2951
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2952
     * @param seq the <code>CharSequence</code> instance
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2953
     * @param index the index following the code point that should be returned
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2954
     * @return the Unicode code point value before the given index.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2955
     * @exception NullPointerException if <code>seq</code> is null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2956
     * @exception IndexOutOfBoundsException if the <code>index</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2957
     * argument is less than 1 or greater than {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2958
     * CharSequence#length() seq.length()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2959
     * @since  1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2960
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2961
    public static int codePointBefore(CharSequence seq, int index) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2962
        char c2 = seq.charAt(--index);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2963
        if (isLowSurrogate(c2)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2964
            if (index > 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2965
                char c1 = seq.charAt(--index);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2966
                if (isHighSurrogate(c1)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2967
                    return toCodePoint(c1, c2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2968
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2969
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2970
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2971
        return c2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2972
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2973
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2974
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2975
     * Returns the code point preceding the given index of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2976
     * <code>char</code> array. If the <code>char</code> value at
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2977
     * <code>(index - 1)</code> in the <code>char</code> array is in
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2978
     * the low-surrogate range, <code>(index - 2)</code> is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2979
     * negative, and the <code>char</code> value at <code>(index -
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2980
     * 2)</code> in the <code>char</code> array is in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2981
     * high-surrogate range, then the supplementary code point
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2982
     * corresponding to this surrogate pair is returned. Otherwise,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2983
     * the <code>char</code> value at <code>(index - 1)</code> is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2984
     * returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2985
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2986
     * @param a the <code>char</code> array
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2987
     * @param index the index following the code point that should be returned
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2988
     * @return the Unicode code point value before the given index.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2989
     * @exception NullPointerException if <code>a</code> is null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2990
     * @exception IndexOutOfBoundsException if the <code>index</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2991
     * argument is less than 1 or greater than the length of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2992
     * <code>char</code> array
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2993
     * @since  1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2994
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2995
    public static int codePointBefore(char[] a, int index) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2996
        return codePointBeforeImpl(a, index, 0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2997
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2998
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2999
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3000
     * Returns the code point preceding the given index of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3001
     * <code>char</code> array, where only array elements with
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3002
     * <code>index</code> greater than or equal to <code>start</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3003
     * can be used. If the <code>char</code> value at <code>(index -
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3004
     * 1)</code> in the <code>char</code> array is in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3005
     * low-surrogate range, <code>(index - 2)</code> is not less than
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3006
     * <code>start</code>, and the <code>char</code> value at
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3007
     * <code>(index - 2)</code> in the <code>char</code> array is in
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3008
     * the high-surrogate range, then the supplementary code point
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3009
     * corresponding to this surrogate pair is returned. Otherwise,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3010
     * the <code>char</code> value at <code>(index - 1)</code> is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3011
     * returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3012
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3013
     * @param a the <code>char</code> array
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3014
     * @param index the index following the code point that should be returned
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3015
     * @param start the index of the first array element in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3016
     * <code>char</code> array
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3017
     * @return the Unicode code point value before the given index.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3018
     * @exception NullPointerException if <code>a</code> is null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3019
     * @exception IndexOutOfBoundsException if the <code>index</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3020
     * argument is not greater than the <code>start</code> argument or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3021
     * is greater than the length of the <code>char</code> array, or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3022
     * if the <code>start</code> argument is negative or not less than
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3023
     * the length of the <code>char</code> array.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3024
     * @since  1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3025
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3026
    public static int codePointBefore(char[] a, int index, int start) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3027
        if (index <= start || start < 0 || start >= a.length) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3028
            throw new IndexOutOfBoundsException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3029
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3030
        return codePointBeforeImpl(a, index, start);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3031
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3032
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3033
    static int codePointBeforeImpl(char[] a, int index, int start) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3034
        char c2 = a[--index];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3035
        if (isLowSurrogate(c2)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3036
            if (index > start) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3037
                char c1 = a[--index];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3038
                if (isHighSurrogate(c1)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3039
                    return toCodePoint(c1, c2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3040
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3041
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3042
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3043
        return c2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3044
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3045
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3046
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3047
     * Converts the specified character (Unicode code point) to its
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3048
     * UTF-16 representation. If the specified code point is a BMP
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3049
     * (Basic Multilingual Plane or Plane 0) value, the same value is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3050
     * stored in <code>dst[dstIndex]</code>, and 1 is returned. If the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3051
     * specified code point is a supplementary character, its
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3052
     * surrogate values are stored in <code>dst[dstIndex]</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3053
     * (high-surrogate) and <code>dst[dstIndex+1]</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3054
     * (low-surrogate), and 2 is returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3055
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3056
     * @param  codePoint the character (Unicode code point) to be converted.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3057
     * @param  dst an array of <code>char</code> in which the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3058
     * <code>codePoint</code>'s UTF-16 value is stored.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3059
     * @param dstIndex the start index into the <code>dst</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3060
     * array where the converted value is stored.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3061
     * @return 1 if the code point is a BMP code point, 2 if the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3062
     * code point is a supplementary code point.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3063
     * @exception IllegalArgumentException if the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3064
     * <code>codePoint</code> is not a valid Unicode code point.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3065
     * @exception NullPointerException if the specified <code>dst</code> is null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3066
     * @exception IndexOutOfBoundsException if <code>dstIndex</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3067
     * is negative or not less than <code>dst.length</code>, or if
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3068
     * <code>dst</code> at <code>dstIndex</code> doesn't have enough
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3069
     * array element(s) to store the resulting <code>char</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3070
     * value(s). (If <code>dstIndex</code> is equal to
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3071
     * <code>dst.length-1</code> and the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3072
     * <code>codePoint</code> is a supplementary character, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3073
     * high-surrogate value is not stored in
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3074
     * <code>dst[dstIndex]</code>.)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3075
     * @since  1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3076
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3077
    public static int toChars(int codePoint, char[] dst, int dstIndex) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3078
        if (codePoint < 0 || codePoint > MAX_CODE_POINT) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3079
            throw new IllegalArgumentException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3080
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3081
        if (codePoint < MIN_SUPPLEMENTARY_CODE_POINT) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3082
            dst[dstIndex] = (char) codePoint;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3083
            return 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3084
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3085
        toSurrogates(codePoint, dst, dstIndex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3086
        return 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3087
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3088
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3089
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3090
     * Converts the specified character (Unicode code point) to its
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3091
     * UTF-16 representation stored in a <code>char</code> array. If
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3092
     * the specified code point is a BMP (Basic Multilingual Plane or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3093
     * Plane 0) value, the resulting <code>char</code> array has
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3094
     * the same value as <code>codePoint</code>. If the specified code
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3095
     * point is a supplementary code point, the resulting
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3096
     * <code>char</code> array has the corresponding surrogate pair.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3097
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3098
     * @param  codePoint a Unicode code point
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3099
     * @return a <code>char</code> array having
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3100
     *         <code>codePoint</code>'s UTF-16 representation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3101
     * @exception IllegalArgumentException if the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3102
     * <code>codePoint</code> is not a valid Unicode code point.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3103
     * @since  1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3104
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3105
    public static char[] toChars(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3106
        if (codePoint < 0 || codePoint > MAX_CODE_POINT) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3107
            throw new IllegalArgumentException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3108
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3109
        if (codePoint < MIN_SUPPLEMENTARY_CODE_POINT) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3110
                return new char[] { (char) codePoint };
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3111
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3112
        char[] result = new char[2];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3113
        toSurrogates(codePoint, result, 0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3114
        return result;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3115
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3116
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3117
    static void toSurrogates(int codePoint, char[] dst, int index) {
3323
29b6893c6188 6639443: Character.toCodePoint and Character.toSurrogates can be optimized
martin
parents: 3224
diff changeset
  3118
        // We write elements "backwards" to guarantee all-or-nothing
29b6893c6188 6639443: Character.toCodePoint and Character.toSurrogates can be optimized
martin
parents: 3224
diff changeset
  3119
        dst[index+1] = (char)((codePoint & 0x3ff) + MIN_LOW_SURROGATE);
29b6893c6188 6639443: Character.toCodePoint and Character.toSurrogates can be optimized
martin
parents: 3224
diff changeset
  3120
        dst[index] = (char)((codePoint >>> 10)
29b6893c6188 6639443: Character.toCodePoint and Character.toSurrogates can be optimized
martin
parents: 3224
diff changeset
  3121
            + (MIN_HIGH_SURROGATE - (MIN_SUPPLEMENTARY_CODE_POINT >>> 10)));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3122
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3123
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3124
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3125
     * Returns the number of Unicode code points in the text range of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3126
     * the specified char sequence. The text range begins at the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3127
     * specified <code>beginIndex</code> and extends to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3128
     * <code>char</code> at index <code>endIndex - 1</code>. Thus the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3129
     * length (in <code>char</code>s) of the text range is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3130
     * <code>endIndex-beginIndex</code>. Unpaired surrogates within
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3131
     * the text range count as one code point each.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3132
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3133
     * @param seq the char sequence
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3134
     * @param beginIndex the index to the first <code>char</code> of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3135
     * the text range.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3136
     * @param endIndex the index after the last <code>char</code> of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3137
     * the text range.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3138
     * @return the number of Unicode code points in the specified text
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3139
     * range
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3140
     * @exception NullPointerException if <code>seq</code> is null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3141
     * @exception IndexOutOfBoundsException if the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3142
     * <code>beginIndex</code> is negative, or <code>endIndex</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3143
     * is larger than the length of the given sequence, or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3144
     * <code>beginIndex</code> is larger than <code>endIndex</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3145
     * @since  1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3146
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3147
    public static int codePointCount(CharSequence seq, int beginIndex, int endIndex) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3148
        int length = seq.length();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3149
        if (beginIndex < 0 || endIndex > length || beginIndex > endIndex) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3150
            throw new IndexOutOfBoundsException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3151
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3152
        int n = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3153
        for (int i = beginIndex; i < endIndex; ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3154
            n++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3155
            if (isHighSurrogate(seq.charAt(i++))) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3156
                if (i < endIndex && isLowSurrogate(seq.charAt(i))) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3157
                    i++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3158
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3159
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3160
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3161
        return n;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3162
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3163
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3164
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3165
     * Returns the number of Unicode code points in a subarray of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3166
     * <code>char</code> array argument. The <code>offset</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3167
     * argument is the index of the first <code>char</code> of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3168
     * subarray and the <code>count</code> argument specifies the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3169
     * length of the subarray in <code>char</code>s. Unpaired
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3170
     * surrogates within the subarray count as one code point each.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3171
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3172
     * @param a the <code>char</code> array
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3173
     * @param offset the index of the first <code>char</code> in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3174
     * given <code>char</code> array
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3175
     * @param count the length of the subarray in <code>char</code>s
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3176
     * @return the number of Unicode code points in the specified subarray
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3177
     * @exception NullPointerException if <code>a</code> is null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3178
     * @exception IndexOutOfBoundsException if <code>offset</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3179
     * <code>count</code> is negative, or if <code>offset +
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3180
     * count</code> is larger than the length of the given array.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3181
     * @since  1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3182
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3183
    public static int codePointCount(char[] a, int offset, int count) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3184
        if (count > a.length - offset || offset < 0 || count < 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3185
            throw new IndexOutOfBoundsException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3186
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3187
        return codePointCountImpl(a, offset, count);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3188
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3189
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3190
    static int codePointCountImpl(char[] a, int offset, int count) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3191
        int endIndex = offset + count;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3192
        int n = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3193
        for (int i = offset; i < endIndex; ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3194
            n++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3195
            if (isHighSurrogate(a[i++])) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3196
                if (i < endIndex && isLowSurrogate(a[i])) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3197
                    i++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3198
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3199
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3200
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3201
        return n;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3202
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3203
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3204
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3205
     * Returns the index within the given char sequence that is offset
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3206
     * from the given <code>index</code> by <code>codePointOffset</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3207
     * code points. Unpaired surrogates within the text range given by
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3208
     * <code>index</code> and <code>codePointOffset</code> count as
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3209
     * one code point each.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3210
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3211
     * @param seq the char sequence
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3212
     * @param index the index to be offset
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3213
     * @param codePointOffset the offset in code points
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3214
     * @return the index within the char sequence
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3215
     * @exception NullPointerException if <code>seq</code> is null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3216
     * @exception IndexOutOfBoundsException if <code>index</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3217
     *   is negative or larger then the length of the char sequence,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3218
     *   or if <code>codePointOffset</code> is positive and the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3219
     *   subsequence starting with <code>index</code> has fewer than
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3220
     *   <code>codePointOffset</code> code points, or if
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3221
     *   <code>codePointOffset</code> is negative and the subsequence
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3222
     *   before <code>index</code> has fewer than the absolute value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3223
     *   of <code>codePointOffset</code> code points.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3224
     * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3225
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3226
    public static int offsetByCodePoints(CharSequence seq, int index,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3227
                                         int codePointOffset) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3228
        int length = seq.length();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3229
        if (index < 0 || index > length) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3230
            throw new IndexOutOfBoundsException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3231
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3232
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3233
        int x = index;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3234
        if (codePointOffset >= 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3235
            int i;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3236
            for (i = 0; x < length && i < codePointOffset; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3237
                if (isHighSurrogate(seq.charAt(x++))) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3238
                    if (x < length && isLowSurrogate(seq.charAt(x))) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3239
                        x++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3240
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3241
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3242
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3243
            if (i < codePointOffset) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3244
                throw new IndexOutOfBoundsException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3245
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3246
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3247
            int i;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3248
            for (i = codePointOffset; x > 0 && i < 0; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3249
                if (isLowSurrogate(seq.charAt(--x))) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3250
                    if (x > 0 && isHighSurrogate(seq.charAt(x-1))) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3251
                        x--;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3252
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3253
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3254
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3255
            if (i < 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3256
                throw new IndexOutOfBoundsException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3257
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3258
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3259
        return x;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3260
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3261
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3262
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3263
     * Returns the index within the given <code>char</code> subarray
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3264
     * that is offset from the given <code>index</code> by
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3265
     * <code>codePointOffset</code> code points. The
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3266
     * <code>start</code> and <code>count</code> arguments specify a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3267
     * subarray of the <code>char</code> array. Unpaired surrogates
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3268
     * within the text range given by <code>index</code> and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3269
     * <code>codePointOffset</code> count as one code point each.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3270
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3271
     * @param a the <code>char</code> array
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3272
     * @param start the index of the first <code>char</code> of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3273
     * subarray
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3274
     * @param count the length of the subarray in <code>char</code>s
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3275
     * @param index the index to be offset
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3276
     * @param codePointOffset the offset in code points
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3277
     * @return the index within the subarray
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3278
     * @exception NullPointerException if <code>a</code> is null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3279
     * @exception IndexOutOfBoundsException
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3280
     *   if <code>start</code> or <code>count</code> is negative,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3281
     *   or if <code>start + count</code> is larger than the length of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3282
     *   the given array,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3283
     *   or if <code>index</code> is less than <code>start</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3284
     *   larger then <code>start + count</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3285
     *   or if <code>codePointOffset</code> is positive and the text range
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3286
     *   starting with <code>index</code> and ending with <code>start
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3287
     *   + count - 1</code> has fewer than <code>codePointOffset</code> code
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3288
     *   points,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3289
     *   or if <code>codePointOffset</code> is negative and the text range
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3290
     *   starting with <code>start</code> and ending with <code>index
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3291
     *   - 1</code> has fewer than the absolute value of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3292
     *   <code>codePointOffset</code> code points.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3293
     * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3294
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3295
    public static int offsetByCodePoints(char[] a, int start, int count,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3296
                                         int index, int codePointOffset) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3297
        if (count > a.length-start || start < 0 || count < 0
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3298
            || index < start || index > start+count) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3299
            throw new IndexOutOfBoundsException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3300
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3301
        return offsetByCodePointsImpl(a, start, count, index, codePointOffset);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3302
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3303
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3304
    static int offsetByCodePointsImpl(char[]a, int start, int count,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3305
                                      int index, int codePointOffset) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3306
        int x = index;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3307
        if (codePointOffset >= 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3308
            int limit = start + count;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3309
            int i;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3310
            for (i = 0; x < limit && i < codePointOffset; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3311
                if (isHighSurrogate(a[x++])) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3312
                    if (x < limit && isLowSurrogate(a[x])) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3313
                        x++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3314
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3315
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3316
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3317
            if (i < codePointOffset) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3318
                throw new IndexOutOfBoundsException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3319
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3320
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3321
            int i;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3322
            for (i = codePointOffset; x > start && i < 0; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3323
                if (isLowSurrogate(a[--x])) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3324
                    if (x > start && isHighSurrogate(a[x-1])) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3325
                        x--;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3326
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3327
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3328
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3329
            if (i < 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3330
                throw new IndexOutOfBoundsException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3331
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3332
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3333
        return x;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3334
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3335
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3336
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3337
     * Determines if the specified character is a lowercase character.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3338
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3339
     * A character is lowercase if its general category type, provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3340
     * by <code>Character.getType(ch)</code>, is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3341
     * <code>LOWERCASE_LETTER</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3342
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3343
     * The following are examples of lowercase characters:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3344
     * <p><blockquote><pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3345
     * 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
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3346
     * '&#92;u00DF' '&#92;u00E0' '&#92;u00E1' '&#92;u00E2' '&#92;u00E3' '&#92;u00E4' '&#92;u00E5' '&#92;u00E6'
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3347
     * '&#92;u00E7' '&#92;u00E8' '&#92;u00E9' '&#92;u00EA' '&#92;u00EB' '&#92;u00EC' '&#92;u00ED' '&#92;u00EE'
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3348
     * '&#92;u00EF' '&#92;u00F0' '&#92;u00F1' '&#92;u00F2' '&#92;u00F3' '&#92;u00F4' '&#92;u00F5' '&#92;u00F6'
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3349
     * '&#92;u00F8' '&#92;u00F9' '&#92;u00FA' '&#92;u00FB' '&#92;u00FC' '&#92;u00FD' '&#92;u00FE' '&#92;u00FF'
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3350
     * </pre></blockquote>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3351
     * <p> Many other Unicode characters are lowercase too.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3352
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3353
     * <p><b>Note:</b> This method cannot handle <a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3354
     * href="#supplementary"> supplementary characters</a>. To support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3355
     * all Unicode characters, including supplementary characters, use
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3356
     * the {@link #isLowerCase(int)} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3357
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3358
     * @param   ch   the character to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3359
     * @return  <code>true</code> if the character is lowercase;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3360
     *          <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3361
     * @see     java.lang.Character#isLowerCase(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3362
     * @see     java.lang.Character#isTitleCase(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3363
     * @see     java.lang.Character#toLowerCase(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3364
     * @see     java.lang.Character#getType(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3365
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3366
    public static boolean isLowerCase(char ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3367
        return isLowerCase((int)ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3368
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3369
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3370
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3371
     * Determines if the specified character (Unicode code point) is a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3372
     * lowercase character.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3373
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3374
     * A character is lowercase if its general category type, provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3375
     * by {@link Character#getType getType(codePoint)}, is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3376
     * <code>LOWERCASE_LETTER</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3377
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3378
     * The following are examples of lowercase characters:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3379
     * <p><blockquote><pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3380
     * 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
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3381
     * '&#92;u00DF' '&#92;u00E0' '&#92;u00E1' '&#92;u00E2' '&#92;u00E3' '&#92;u00E4' '&#92;u00E5' '&#92;u00E6'
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3382
     * '&#92;u00E7' '&#92;u00E8' '&#92;u00E9' '&#92;u00EA' '&#92;u00EB' '&#92;u00EC' '&#92;u00ED' '&#92;u00EE'
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3383
     * '&#92;u00EF' '&#92;u00F0' '&#92;u00F1' '&#92;u00F2' '&#92;u00F3' '&#92;u00F4' '&#92;u00F5' '&#92;u00F6'
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3384
     * '&#92;u00F8' '&#92;u00F9' '&#92;u00FA' '&#92;u00FB' '&#92;u00FC' '&#92;u00FD' '&#92;u00FE' '&#92;u00FF'
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3385
     * </pre></blockquote>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3386
     * <p> Many other Unicode characters are lowercase too.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3387
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3388
     * @param   codePoint the character (Unicode code point) to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3389
     * @return  <code>true</code> if the character is lowercase;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3390
     *          <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3391
     * @see     java.lang.Character#isLowerCase(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3392
     * @see     java.lang.Character#isTitleCase(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3393
     * @see     java.lang.Character#toLowerCase(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3394
     * @see     java.lang.Character#getType(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3395
     * @since   1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3396
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3397
    public static boolean isLowerCase(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3398
        return getType(codePoint) == Character.LOWERCASE_LETTER;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3399
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3400
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3401
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3402
     * Determines if the specified character is an uppercase character.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3403
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3404
     * A character is uppercase if its general category type, provided by
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3405
     * <code>Character.getType(ch)</code>, is <code>UPPERCASE_LETTER</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3406
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3407
     * The following are examples of uppercase characters:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3408
     * <p><blockquote><pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3409
     * 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
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3410
     * '&#92;u00C0' '&#92;u00C1' '&#92;u00C2' '&#92;u00C3' '&#92;u00C4' '&#92;u00C5' '&#92;u00C6' '&#92;u00C7'
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3411
     * '&#92;u00C8' '&#92;u00C9' '&#92;u00CA' '&#92;u00CB' '&#92;u00CC' '&#92;u00CD' '&#92;u00CE' '&#92;u00CF'
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3412
     * '&#92;u00D0' '&#92;u00D1' '&#92;u00D2' '&#92;u00D3' '&#92;u00D4' '&#92;u00D5' '&#92;u00D6' '&#92;u00D8'
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3413
     * '&#92;u00D9' '&#92;u00DA' '&#92;u00DB' '&#92;u00DC' '&#92;u00DD' '&#92;u00DE'
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3414
     * </pre></blockquote>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3415
     * <p> Many other Unicode characters are uppercase too.<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3416
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3417
     * <p><b>Note:</b> This method cannot handle <a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3418
     * href="#supplementary"> supplementary characters</a>. To support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3419
     * all Unicode characters, including supplementary characters, use
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3420
     * the {@link #isUpperCase(int)} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3421
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3422
     * @param   ch   the character to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3423
     * @return  <code>true</code> if the character is uppercase;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3424
     *          <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3425
     * @see     java.lang.Character#isLowerCase(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3426
     * @see     java.lang.Character#isTitleCase(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3427
     * @see     java.lang.Character#toUpperCase(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3428
     * @see     java.lang.Character#getType(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3429
     * @since   1.0
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3430
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3431
    public static boolean isUpperCase(char ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3432
        return isUpperCase((int)ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3433
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3434
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3435
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3436
     * Determines if the specified character (Unicode code point) is an uppercase character.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3437
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3438
     * A character is uppercase if its general category type, provided by
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3439
     * {@link Character#getType(int) getType(codePoint)}, is <code>UPPERCASE_LETTER</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3440
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3441
     * The following are examples of uppercase characters:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3442
     * <p><blockquote><pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3443
     * 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
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3444
     * '&#92;u00C0' '&#92;u00C1' '&#92;u00C2' '&#92;u00C3' '&#92;u00C4' '&#92;u00C5' '&#92;u00C6' '&#92;u00C7'
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3445
     * '&#92;u00C8' '&#92;u00C9' '&#92;u00CA' '&#92;u00CB' '&#92;u00CC' '&#92;u00CD' '&#92;u00CE' '&#92;u00CF'
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3446
     * '&#92;u00D0' '&#92;u00D1' '&#92;u00D2' '&#92;u00D3' '&#92;u00D4' '&#92;u00D5' '&#92;u00D6' '&#92;u00D8'
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3447
     * '&#92;u00D9' '&#92;u00DA' '&#92;u00DB' '&#92;u00DC' '&#92;u00DD' '&#92;u00DE'
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3448
     * </pre></blockquote>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3449
     * <p> Many other Unicode characters are uppercase too.<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3450
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3451
     * @param   codePoint the character (Unicode code point) to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3452
     * @return  <code>true</code> if the character is uppercase;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3453
     *          <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3454
     * @see     java.lang.Character#isLowerCase(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3455
     * @see     java.lang.Character#isTitleCase(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3456
     * @see     java.lang.Character#toUpperCase(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3457
     * @see     java.lang.Character#getType(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3458
     * @since   1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3459
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3460
    public static boolean isUpperCase(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3461
        return getType(codePoint) == Character.UPPERCASE_LETTER;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3462
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3463
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3464
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3465
     * Determines if the specified character is a titlecase character.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3466
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3467
     * A character is a titlecase character if its general
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3468
     * category type, provided by <code>Character.getType(ch)</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3469
     * is <code>TITLECASE_LETTER</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3470
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3471
     * Some characters look like pairs of Latin letters. For example, there
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3472
     * is an uppercase letter that looks like "LJ" and has a corresponding
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3473
     * lowercase letter that looks like "lj". A third form, which looks like "Lj",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3474
     * is the appropriate form to use when rendering a word in lowercase
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3475
     * with initial capitals, as for a book title.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3476
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3477
     * These are some of the Unicode characters for which this method returns
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3478
     * <code>true</code>:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3479
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3480
     * <li><code>LATIN CAPITAL LETTER D WITH SMALL LETTER Z WITH CARON</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3481
     * <li><code>LATIN CAPITAL LETTER L WITH SMALL LETTER J</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3482
     * <li><code>LATIN CAPITAL LETTER N WITH SMALL LETTER J</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3483
     * <li><code>LATIN CAPITAL LETTER D WITH SMALL LETTER Z</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3484
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3485
     * <p> Many other Unicode characters are titlecase too.<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3486
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3487
     * <p><b>Note:</b> This method cannot handle <a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3488
     * href="#supplementary"> supplementary characters</a>. To support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3489
     * all Unicode characters, including supplementary characters, use
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3490
     * the {@link #isTitleCase(int)} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3491
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3492
     * @param   ch   the character to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3493
     * @return  <code>true</code> if the character is titlecase;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3494
     *          <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3495
     * @see     java.lang.Character#isLowerCase(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3496
     * @see     java.lang.Character#isUpperCase(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3497
     * @see     java.lang.Character#toTitleCase(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3498
     * @see     java.lang.Character#getType(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3499
     * @since   1.0.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3500
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3501
    public static boolean isTitleCase(char ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3502
        return isTitleCase((int)ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3503
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3504
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3505
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3506
     * Determines if the specified character (Unicode code point) is a titlecase character.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3507
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3508
     * A character is a titlecase character if its general
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3509
     * category type, provided by {@link Character#getType(int) getType(codePoint)},
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3510
     * is <code>TITLECASE_LETTER</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3511
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3512
     * Some characters look like pairs of Latin letters. For example, there
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3513
     * is an uppercase letter that looks like "LJ" and has a corresponding
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3514
     * lowercase letter that looks like "lj". A third form, which looks like "Lj",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3515
     * is the appropriate form to use when rendering a word in lowercase
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3516
     * with initial capitals, as for a book title.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3517
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3518
     * These are some of the Unicode characters for which this method returns
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3519
     * <code>true</code>:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3520
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3521
     * <li><code>LATIN CAPITAL LETTER D WITH SMALL LETTER Z WITH CARON</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3522
     * <li><code>LATIN CAPITAL LETTER L WITH SMALL LETTER J</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3523
     * <li><code>LATIN CAPITAL LETTER N WITH SMALL LETTER J</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3524
     * <li><code>LATIN CAPITAL LETTER D WITH SMALL LETTER Z</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3525
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3526
     * <p> Many other Unicode characters are titlecase too.<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3527
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3528
     * @param   codePoint the character (Unicode code point) to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3529
     * @return  <code>true</code> if the character is titlecase;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3530
     *          <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3531
     * @see     java.lang.Character#isLowerCase(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3532
     * @see     java.lang.Character#isUpperCase(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3533
     * @see     java.lang.Character#toTitleCase(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3534
     * @see     java.lang.Character#getType(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3535
     * @since   1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3536
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3537
    public static boolean isTitleCase(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3538
        return getType(codePoint) == Character.TITLECASE_LETTER;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3539
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3540
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3541
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3542
     * Determines if the specified character is a digit.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3543
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3544
     * A character is a digit if its general category type, provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3545
     * by <code>Character.getType(ch)</code>, is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3546
     * <code>DECIMAL_DIGIT_NUMBER</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3547
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3548
     * Some Unicode character ranges that contain digits:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3549
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3550
     * <li><code>'&#92;u0030'</code> through <code>'&#92;u0039'</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3551
     *     ISO-LATIN-1 digits (<code>'0'</code> through <code>'9'</code>)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3552
     * <li><code>'&#92;u0660'</code> through <code>'&#92;u0669'</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3553
     *     Arabic-Indic digits
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3554
     * <li><code>'&#92;u06F0'</code> through <code>'&#92;u06F9'</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3555
     *     Extended Arabic-Indic digits
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3556
     * <li><code>'&#92;u0966'</code> through <code>'&#92;u096F'</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3557
     *     Devanagari digits
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3558
     * <li><code>'&#92;uFF10'</code> through <code>'&#92;uFF19'</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3559
     *     Fullwidth digits
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3560
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3561
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3562
     * Many other character ranges contain digits as well.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3563
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3564
     * <p><b>Note:</b> This method cannot handle <a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3565
     * href="#supplementary"> supplementary characters</a>. To support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3566
     * all Unicode characters, including supplementary characters, use
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3567
     * the {@link #isDigit(int)} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3568
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3569
     * @param   ch   the character to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3570
     * @return  <code>true</code> if the character is a digit;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3571
     *          <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3572
     * @see     java.lang.Character#digit(char, int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3573
     * @see     java.lang.Character#forDigit(int, int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3574
     * @see     java.lang.Character#getType(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3575
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3576
    public static boolean isDigit(char ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3577
        return isDigit((int)ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3578
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3579
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3580
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3581
     * Determines if the specified character (Unicode code point) is a digit.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3582
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3583
     * A character is a digit if its general category type, provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3584
     * by {@link Character#getType(int) getType(codePoint)}, is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3585
     * <code>DECIMAL_DIGIT_NUMBER</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3586
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3587
     * Some Unicode character ranges that contain digits:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3588
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3589
     * <li><code>'&#92;u0030'</code> through <code>'&#92;u0039'</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3590
     *     ISO-LATIN-1 digits (<code>'0'</code> through <code>'9'</code>)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3591
     * <li><code>'&#92;u0660'</code> through <code>'&#92;u0669'</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3592
     *     Arabic-Indic digits
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3593
     * <li><code>'&#92;u06F0'</code> through <code>'&#92;u06F9'</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3594
     *     Extended Arabic-Indic digits
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3595
     * <li><code>'&#92;u0966'</code> through <code>'&#92;u096F'</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3596
     *     Devanagari digits
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3597
     * <li><code>'&#92;uFF10'</code> through <code>'&#92;uFF19'</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3598
     *     Fullwidth digits
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3599
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3600
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3601
     * Many other character ranges contain digits as well.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3602
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3603
     * @param   codePoint the character (Unicode code point) to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3604
     * @return  <code>true</code> if the character is a digit;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3605
     *          <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3606
     * @see     java.lang.Character#forDigit(int, int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3607
     * @see     java.lang.Character#getType(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3608
     * @since   1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3609
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3610
    public static boolean isDigit(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3611
        return getType(codePoint) == Character.DECIMAL_DIGIT_NUMBER;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3612
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3613
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3614
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3615
     * Determines if a character is defined in Unicode.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3616
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3617
     * A character is defined if at least one of the following is true:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3618
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3619
     * <li>It has an entry in the UnicodeData file.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3620
     * <li>It has a value in a range defined by the UnicodeData file.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3621
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3622
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3623
     * <p><b>Note:</b> This method cannot handle <a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3624
     * href="#supplementary"> supplementary characters</a>. To support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3625
     * all Unicode characters, including supplementary characters, use
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3626
     * the {@link #isDefined(int)} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3627
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3628
     * @param   ch   the character to be tested
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3629
     * @return  <code>true</code> if the character has a defined meaning
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3630
     *          in Unicode; <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3631
     * @see     java.lang.Character#isDigit(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3632
     * @see     java.lang.Character#isLetter(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3633
     * @see     java.lang.Character#isLetterOrDigit(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3634
     * @see     java.lang.Character#isLowerCase(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3635
     * @see     java.lang.Character#isTitleCase(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3636
     * @see     java.lang.Character#isUpperCase(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3637
     * @since   1.0.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3638
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3639
    public static boolean isDefined(char ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3640
        return isDefined((int)ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3641
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3642
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3643
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3644
     * Determines if a character (Unicode code point) is defined in Unicode.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3645
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3646
     * A character is defined if at least one of the following is true:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3647
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3648
     * <li>It has an entry in the UnicodeData file.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3649
     * <li>It has a value in a range defined by the UnicodeData file.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3650
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3651
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3652
     * @param   codePoint the character (Unicode code point) to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3653
     * @return  <code>true</code> if the character has a defined meaning
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3654
     *          in Unicode; <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3655
     * @see     java.lang.Character#isDigit(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3656
     * @see     java.lang.Character#isLetter(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3657
     * @see     java.lang.Character#isLetterOrDigit(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3658
     * @see     java.lang.Character#isLowerCase(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3659
     * @see     java.lang.Character#isTitleCase(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3660
     * @see     java.lang.Character#isUpperCase(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3661
     * @since   1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3662
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3663
    public static boolean isDefined(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3664
        return getType(codePoint) != Character.UNASSIGNED;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3665
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3666
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3667
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3668
     * Determines if the specified character is a letter.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3669
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3670
     * A character is considered to be a letter if its general
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3671
     * category type, provided by <code>Character.getType(ch)</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3672
     * is any of the following:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3673
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3674
     * <li> <code>UPPERCASE_LETTER</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3675
     * <li> <code>LOWERCASE_LETTER</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3676
     * <li> <code>TITLECASE_LETTER</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3677
     * <li> <code>MODIFIER_LETTER</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3678
     * <li> <code>OTHER_LETTER</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3679
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3680
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3681
     * Not all letters have case. Many characters are
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3682
     * letters but are neither uppercase nor lowercase nor titlecase.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3683
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3684
     * <p><b>Note:</b> This method cannot handle <a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3685
     * href="#supplementary"> supplementary characters</a>. To support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3686
     * all Unicode characters, including supplementary characters, use
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3687
     * the {@link #isLetter(int)} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3688
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3689
     * @param   ch   the character to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3690
     * @return  <code>true</code> if the character is a letter;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3691
     *          <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3692
     * @see     java.lang.Character#isDigit(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3693
     * @see     java.lang.Character#isJavaIdentifierStart(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3694
     * @see     java.lang.Character#isJavaLetter(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3695
     * @see     java.lang.Character#isJavaLetterOrDigit(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3696
     * @see     java.lang.Character#isLetterOrDigit(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3697
     * @see     java.lang.Character#isLowerCase(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3698
     * @see     java.lang.Character#isTitleCase(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3699
     * @see     java.lang.Character#isUnicodeIdentifierStart(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3700
     * @see     java.lang.Character#isUpperCase(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3701
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3702
    public static boolean isLetter(char ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3703
        return isLetter((int)ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3704
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3705
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3706
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3707
     * Determines if the specified character (Unicode code point) is a letter.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3708
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3709
     * A character is considered to be a letter if its general
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3710
     * category type, provided by {@link Character#getType(int) getType(codePoint)},
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3711
     * is any of the following:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3712
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3713
     * <li> <code>UPPERCASE_LETTER</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3714
     * <li> <code>LOWERCASE_LETTER</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3715
     * <li> <code>TITLECASE_LETTER</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3716
     * <li> <code>MODIFIER_LETTER</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3717
     * <li> <code>OTHER_LETTER</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3718
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3719
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3720
     * Not all letters have case. Many characters are
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3721
     * letters but are neither uppercase nor lowercase nor titlecase.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3722
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3723
     * @param   codePoint the character (Unicode code point) to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3724
     * @return  <code>true</code> if the character is a letter;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3725
     *          <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3726
     * @see     java.lang.Character#isDigit(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3727
     * @see     java.lang.Character#isJavaIdentifierStart(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3728
     * @see     java.lang.Character#isLetterOrDigit(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3729
     * @see     java.lang.Character#isLowerCase(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3730
     * @see     java.lang.Character#isTitleCase(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3731
     * @see     java.lang.Character#isUnicodeIdentifierStart(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3732
     * @see     java.lang.Character#isUpperCase(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3733
     * @since   1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3734
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3735
    public static boolean isLetter(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3736
        return ((((1 << Character.UPPERCASE_LETTER) |
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3737
            (1 << Character.LOWERCASE_LETTER) |
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3738
            (1 << Character.TITLECASE_LETTER) |
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3739
            (1 << Character.MODIFIER_LETTER) |
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3740
            (1 << Character.OTHER_LETTER)) >> getType(codePoint)) & 1)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3741
            != 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3742
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3743
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3744
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3745
     * Determines if the specified character is a letter or digit.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3746
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3747
     * A character is considered to be a letter or digit if either
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3748
     * <code>Character.isLetter(char ch)</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3749
     * <code>Character.isDigit(char ch)</code> returns
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3750
     * <code>true</code> for the character.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3751
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3752
     * <p><b>Note:</b> This method cannot handle <a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3753
     * href="#supplementary"> supplementary characters</a>. To support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3754
     * all Unicode characters, including supplementary characters, use
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3755
     * the {@link #isLetterOrDigit(int)} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3756
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3757
     * @param   ch   the character to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3758
     * @return  <code>true</code> if the character is a letter or digit;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3759
     *          <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3760
     * @see     java.lang.Character#isDigit(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3761
     * @see     java.lang.Character#isJavaIdentifierPart(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3762
     * @see     java.lang.Character#isJavaLetter(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3763
     * @see     java.lang.Character#isJavaLetterOrDigit(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3764
     * @see     java.lang.Character#isLetter(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3765
     * @see     java.lang.Character#isUnicodeIdentifierPart(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3766
     * @since   1.0.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3767
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3768
    public static boolean isLetterOrDigit(char ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3769
        return isLetterOrDigit((int)ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3770
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3771
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3772
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3773
     * Determines if the specified character (Unicode code point) is a letter or digit.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3774
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3775
     * A character is considered to be a letter or digit if either
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3776
     * {@link #isLetter(int) isLetter(codePoint)} or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3777
     * {@link #isDigit(int) isDigit(codePoint)} returns
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3778
     * <code>true</code> for the character.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3779
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3780
     * @param   codePoint the character (Unicode code point) to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3781
     * @return  <code>true</code> if the character is a letter or digit;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3782
     *          <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3783
     * @see     java.lang.Character#isDigit(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3784
     * @see     java.lang.Character#isJavaIdentifierPart(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3785
     * @see     java.lang.Character#isLetter(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3786
     * @see     java.lang.Character#isUnicodeIdentifierPart(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3787
     * @since   1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3788
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3789
    public static boolean isLetterOrDigit(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3790
        return ((((1 << Character.UPPERCASE_LETTER) |
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3791
            (1 << Character.LOWERCASE_LETTER) |
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3792
            (1 << Character.TITLECASE_LETTER) |
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3793
            (1 << Character.MODIFIER_LETTER) |
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3794
            (1 << Character.OTHER_LETTER) |
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3795
            (1 << Character.DECIMAL_DIGIT_NUMBER)) >> getType(codePoint)) & 1)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3796
            != 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3797
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3798
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3799
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3800
     * Determines if the specified character is permissible as the first
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3801
     * character in a Java identifier.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3802
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3803
     * A character may start a Java identifier if and only if
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3804
     * one of the following is true:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3805
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3806
     * <li> {@link #isLetter(char) isLetter(ch)} returns <code>true</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3807
     * <li> {@link #getType(char) getType(ch)} returns <code>LETTER_NUMBER</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3808
     * <li> ch is a currency symbol (such as "$")
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3809
     * <li> ch is a connecting punctuation character (such as "_").
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3810
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3811
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3812
     * @param   ch the character to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3813
     * @return  <code>true</code> if the character may start a Java
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3814
     *          identifier; <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3815
     * @see     java.lang.Character#isJavaLetterOrDigit(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3816
     * @see     java.lang.Character#isJavaIdentifierStart(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3817
     * @see     java.lang.Character#isJavaIdentifierPart(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3818
     * @see     java.lang.Character#isLetter(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3819
     * @see     java.lang.Character#isLetterOrDigit(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3820
     * @see     java.lang.Character#isUnicodeIdentifierStart(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3821
     * @since   1.02
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3822
     * @deprecated Replaced by isJavaIdentifierStart(char).
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3823
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3824
    @Deprecated
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3825
    public static boolean isJavaLetter(char ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3826
        return isJavaIdentifierStart(ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3827
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3828
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3829
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3830
     * Determines if the specified character may be part of a Java
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3831
     * identifier as other than the first character.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3832
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3833
     * A character may be part of a Java identifier if and only if any
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3834
     * of the following are true:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3835
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3836
     * <li>  it is a letter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3837
     * <li>  it is a currency symbol (such as <code>'$'</code>)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3838
     * <li>  it is a connecting punctuation character (such as <code>'_'</code>)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3839
     * <li>  it is a digit
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3840
     * <li>  it is a numeric letter (such as a Roman numeral character)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3841
     * <li>  it is a combining mark
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3842
     * <li>  it is a non-spacing mark
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3843
     * <li> <code>isIdentifierIgnorable</code> returns
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3844
     * <code>true</code> for the character.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3845
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3846
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3847
     * @param   ch the character to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3848
     * @return  <code>true</code> if the character may be part of a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3849
     *          Java identifier; <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3850
     * @see     java.lang.Character#isJavaLetter(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3851
     * @see     java.lang.Character#isJavaIdentifierStart(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3852
     * @see     java.lang.Character#isJavaIdentifierPart(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3853
     * @see     java.lang.Character#isLetter(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3854
     * @see     java.lang.Character#isLetterOrDigit(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3855
     * @see     java.lang.Character#isUnicodeIdentifierPart(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3856
     * @see     java.lang.Character#isIdentifierIgnorable(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3857
     * @since   1.02
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3858
     * @deprecated Replaced by isJavaIdentifierPart(char).
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3859
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3860
    @Deprecated
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3861
    public static boolean isJavaLetterOrDigit(char ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3862
        return isJavaIdentifierPart(ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3863
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3864
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3865
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3866
     * Determines if the specified character is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3867
     * permissible as the first character in a Java identifier.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3868
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3869
     * A character may start a Java identifier if and only if
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3870
     * one of the following conditions is true:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3871
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3872
     * <li> {@link #isLetter(char) isLetter(ch)} returns <code>true</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3873
     * <li> {@link #getType(char) getType(ch)} returns <code>LETTER_NUMBER</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3874
     * <li> ch is a currency symbol (such as "$")
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3875
     * <li> ch is a connecting punctuation character (such as "_").
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3876
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3877
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3878
     * <p><b>Note:</b> This method cannot handle <a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3879
     * href="#supplementary"> supplementary characters</a>. To support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3880
     * all Unicode characters, including supplementary characters, use
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3881
     * the {@link #isJavaIdentifierStart(int)} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3882
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3883
     * @param   ch the character to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3884
     * @return  <code>true</code> if the character may start a Java identifier;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3885
     *          <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3886
     * @see     java.lang.Character#isJavaIdentifierPart(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3887
     * @see     java.lang.Character#isLetter(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3888
     * @see     java.lang.Character#isUnicodeIdentifierStart(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3889
     * @see     javax.lang.model.SourceVersion#isIdentifier(CharSequence)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3890
     * @since   1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3891
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3892
    public static boolean isJavaIdentifierStart(char ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3893
        return isJavaIdentifierStart((int)ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3894
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3895
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3896
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3897
     * Determines if the character (Unicode code point) is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3898
     * permissible as the first character in a Java identifier.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3899
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3900
     * A character may start a Java identifier if and only if
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3901
     * one of the following conditions is true:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3902
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3903
     * <li> {@link #isLetter(int) isLetter(codePoint)}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3904
     *      returns <code>true</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3905
     * <li> {@link #getType(int) getType(codePoint)}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3906
     *      returns <code>LETTER_NUMBER</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3907
     * <li> the referenced character is a currency symbol (such as "$")
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3908
     * <li> the referenced character is a connecting punctuation character
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3909
     *      (such as "_").
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3910
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3911
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3912
     * @param   codePoint the character (Unicode code point) to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3913
     * @return  <code>true</code> if the character may start a Java identifier;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3914
     *          <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3915
     * @see     java.lang.Character#isJavaIdentifierPart(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3916
     * @see     java.lang.Character#isLetter(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3917
     * @see     java.lang.Character#isUnicodeIdentifierStart(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3918
     * @see     javax.lang.model.SourceVersion#isIdentifier(CharSequence)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3919
     * @since   1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3920
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3921
    public static boolean isJavaIdentifierStart(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3922
        return CharacterData.of(codePoint).isJavaIdentifierStart(codePoint);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3923
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3924
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3925
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3926
     * Determines if the specified character may be part of a Java
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3927
     * identifier as other than the first character.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3928
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3929
     * A character may be part of a Java identifier if any of the following
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3930
     * are true:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3931
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3932
     * <li>  it is a letter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3933
     * <li>  it is a currency symbol (such as <code>'$'</code>)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3934
     * <li>  it is a connecting punctuation character (such as <code>'_'</code>)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3935
     * <li>  it is a digit
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3936
     * <li>  it is a numeric letter (such as a Roman numeral character)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3937
     * <li>  it is a combining mark
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3938
     * <li>  it is a non-spacing mark
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3939
     * <li> <code>isIdentifierIgnorable</code> returns
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3940
     * <code>true</code> for the character
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3941
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3942
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3943
     * <p><b>Note:</b> This method cannot handle <a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3944
     * href="#supplementary"> supplementary characters</a>. To support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3945
     * all Unicode characters, including supplementary characters, use
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3946
     * the {@link #isJavaIdentifierPart(int)} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3947
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3948
     * @param   ch      the character to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3949
     * @return <code>true</code> if the character may be part of a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3950
     *          Java identifier; <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3951
     * @see     java.lang.Character#isIdentifierIgnorable(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3952
     * @see     java.lang.Character#isJavaIdentifierStart(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3953
     * @see     java.lang.Character#isLetterOrDigit(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3954
     * @see     java.lang.Character#isUnicodeIdentifierPart(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3955
     * @see     javax.lang.model.SourceVersion#isIdentifier(CharSequence)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3956
     * @since   1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3957
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3958
    public static boolean isJavaIdentifierPart(char ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3959
        return isJavaIdentifierPart((int)ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3960
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3961
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3962
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3963
     * Determines if the character (Unicode code point) may be part of a Java
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3964
     * identifier as other than the first character.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3965
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3966
     * A character may be part of a Java identifier if any of the following
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3967
     * are true:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3968
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3969
     * <li>  it is a letter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3970
     * <li>  it is a currency symbol (such as <code>'$'</code>)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3971
     * <li>  it is a connecting punctuation character (such as <code>'_'</code>)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3972
     * <li>  it is a digit
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3973
     * <li>  it is a numeric letter (such as a Roman numeral character)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3974
     * <li>  it is a combining mark
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3975
     * <li>  it is a non-spacing mark
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3976
     * <li> {@link #isIdentifierIgnorable(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3977
     * isIdentifierIgnorable(codePoint)} returns <code>true</code> for
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3978
     * the character
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3979
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3980
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3981
     * @param   codePoint the character (Unicode code point) to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3982
     * @return <code>true</code> if the character may be part of a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3983
     *          Java identifier; <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3984
     * @see     java.lang.Character#isIdentifierIgnorable(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3985
     * @see     java.lang.Character#isJavaIdentifierStart(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3986
     * @see     java.lang.Character#isLetterOrDigit(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3987
     * @see     java.lang.Character#isUnicodeIdentifierPart(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3988
     * @see     javax.lang.model.SourceVersion#isIdentifier(CharSequence)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3989
     * @since   1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3990
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3991
    public static boolean isJavaIdentifierPart(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3992
        return CharacterData.of(codePoint).isJavaIdentifierPart(codePoint);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3993
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3994
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3995
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3996
     * Determines if the specified character is permissible as the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3997
     * first character in a Unicode identifier.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3998
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3999
     * A character may start a Unicode identifier if and only if
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4000
     * one of the following conditions is true:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4001
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4002
     * <li> {@link #isLetter(char) isLetter(ch)} returns <code>true</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4003
     * <li> {@link #getType(char) getType(ch)} returns
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4004
     *      <code>LETTER_NUMBER</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4005
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4006
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4007
     * <p><b>Note:</b> This method cannot handle <a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4008
     * href="#supplementary"> supplementary characters</a>. To support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4009
     * all Unicode characters, including supplementary characters, use
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4010
     * the {@link #isUnicodeIdentifierStart(int)} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4011
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4012
     * @param   ch      the character to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4013
     * @return  <code>true</code> if the character may start a Unicode
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4014
     *          identifier; <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4015
     * @see     java.lang.Character#isJavaIdentifierStart(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4016
     * @see     java.lang.Character#isLetter(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4017
     * @see     java.lang.Character#isUnicodeIdentifierPart(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4018
     * @since   1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4019
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4020
    public static boolean isUnicodeIdentifierStart(char ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4021
        return isUnicodeIdentifierStart((int)ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4022
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4023
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4024
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4025
     * Determines if the specified character (Unicode code point) is permissible as the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4026
     * first character in a Unicode identifier.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4027
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4028
     * A character may start a Unicode identifier if and only if
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4029
     * one of the following conditions is true:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4030
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4031
     * <li> {@link #isLetter(int) isLetter(codePoint)}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4032
     *      returns <code>true</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4033
     * <li> {@link #getType(int) getType(codePoint)}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4034
     *      returns <code>LETTER_NUMBER</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4035
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4036
     * @param   codePoint the character (Unicode code point) to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4037
     * @return  <code>true</code> if the character may start a Unicode
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4038
     *          identifier; <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4039
     * @see     java.lang.Character#isJavaIdentifierStart(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4040
     * @see     java.lang.Character#isLetter(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4041
     * @see     java.lang.Character#isUnicodeIdentifierPart(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4042
     * @since   1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4043
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4044
    public static boolean isUnicodeIdentifierStart(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4045
        return CharacterData.of(codePoint).isUnicodeIdentifierStart(codePoint);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4046
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4047
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4048
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4049
     * Determines if the specified character may be part of a Unicode
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4050
     * identifier as other than the first character.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4051
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4052
     * A character may be part of a Unicode identifier if and only if
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4053
     * one of the following statements is true:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4054
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4055
     * <li>  it is a letter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4056
     * <li>  it is a connecting punctuation character (such as <code>'_'</code>)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4057
     * <li>  it is a digit
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4058
     * <li>  it is a numeric letter (such as a Roman numeral character)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4059
     * <li>  it is a combining mark
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4060
     * <li>  it is a non-spacing mark
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4061
     * <li> <code>isIdentifierIgnorable</code> returns
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4062
     * <code>true</code> for this character.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4063
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4064
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4065
     * <p><b>Note:</b> This method cannot handle <a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4066
     * href="#supplementary"> supplementary characters</a>. To support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4067
     * all Unicode characters, including supplementary characters, use
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4068
     * the {@link #isUnicodeIdentifierPart(int)} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4069
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4070
     * @param   ch      the character to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4071
     * @return  <code>true</code> if the character may be part of a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4072
     *          Unicode identifier; <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4073
     * @see     java.lang.Character#isIdentifierIgnorable(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4074
     * @see     java.lang.Character#isJavaIdentifierPart(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4075
     * @see     java.lang.Character#isLetterOrDigit(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4076
     * @see     java.lang.Character#isUnicodeIdentifierStart(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4077
     * @since   1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4078
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4079
    public static boolean isUnicodeIdentifierPart(char ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4080
        return isUnicodeIdentifierPart((int)ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4081
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4082
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4083
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4084
     * Determines if the specified character (Unicode code point) may be part of a Unicode
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4085
     * identifier as other than the first character.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4086
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4087
     * A character may be part of a Unicode identifier if and only if
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4088
     * one of the following statements is true:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4089
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4090
     * <li>  it is a letter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4091
     * <li>  it is a connecting punctuation character (such as <code>'_'</code>)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4092
     * <li>  it is a digit
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4093
     * <li>  it is a numeric letter (such as a Roman numeral character)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4094
     * <li>  it is a combining mark
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4095
     * <li>  it is a non-spacing mark
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4096
     * <li> <code>isIdentifierIgnorable</code> returns
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4097
     * <code>true</code> for this character.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4098
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4099
     * @param   codePoint the character (Unicode code point) to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4100
     * @return  <code>true</code> if the character may be part of a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4101
     *          Unicode identifier; <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4102
     * @see     java.lang.Character#isIdentifierIgnorable(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4103
     * @see     java.lang.Character#isJavaIdentifierPart(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4104
     * @see     java.lang.Character#isLetterOrDigit(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4105
     * @see     java.lang.Character#isUnicodeIdentifierStart(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4106
     * @since   1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4107
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4108
    public static boolean isUnicodeIdentifierPart(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4109
        return CharacterData.of(codePoint).isUnicodeIdentifierPart(codePoint);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4110
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4111
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4112
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4113
     * Determines if the specified character should be regarded as
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4114
     * an ignorable character in a Java identifier or a Unicode identifier.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4115
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4116
     * The following Unicode characters are ignorable in a Java identifier
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4117
     * or a Unicode identifier:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4118
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4119
     * <li>ISO control characters that are not whitespace
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4120
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4121
     * <li><code>'&#92;u0000'</code> through <code>'&#92;u0008'</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4122
     * <li><code>'&#92;u000E'</code> through <code>'&#92;u001B'</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4123
     * <li><code>'&#92;u007F'</code> through <code>'&#92;u009F'</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4124
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4125
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4126
     * <li>all characters that have the <code>FORMAT</code> general
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4127
     * category value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4128
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4129
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4130
     * <p><b>Note:</b> This method cannot handle <a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4131
     * href="#supplementary"> supplementary characters</a>. To support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4132
     * all Unicode characters, including supplementary characters, use
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4133
     * the {@link #isIdentifierIgnorable(int)} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4134
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4135
     * @param   ch      the character to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4136
     * @return  <code>true</code> if the character is an ignorable control
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4137
     *          character that may be part of a Java or Unicode identifier;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4138
     *           <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4139
     * @see     java.lang.Character#isJavaIdentifierPart(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4140
     * @see     java.lang.Character#isUnicodeIdentifierPart(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4141
     * @since   1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4142
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4143
    public static boolean isIdentifierIgnorable(char ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4144
        return isIdentifierIgnorable((int)ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4145
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4146
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4147
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4148
     * Determines if the specified character (Unicode code point) should be regarded as
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4149
     * an ignorable character in a Java identifier or a Unicode identifier.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4150
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4151
     * The following Unicode characters are ignorable in a Java identifier
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4152
     * or a Unicode identifier:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4153
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4154
     * <li>ISO control characters that are not whitespace
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4155
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4156
     * <li><code>'&#92;u0000'</code> through <code>'&#92;u0008'</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4157
     * <li><code>'&#92;u000E'</code> through <code>'&#92;u001B'</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4158
     * <li><code>'&#92;u007F'</code> through <code>'&#92;u009F'</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4159
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4160
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4161
     * <li>all characters that have the <code>FORMAT</code> general
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4162
     * category value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4163
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4164
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4165
     * @param   codePoint the character (Unicode code point) to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4166
     * @return  <code>true</code> if the character is an ignorable control
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4167
     *          character that may be part of a Java or Unicode identifier;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4168
     *          <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4169
     * @see     java.lang.Character#isJavaIdentifierPart(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4170
     * @see     java.lang.Character#isUnicodeIdentifierPart(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4171
     * @since   1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4172
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4173
    public static boolean isIdentifierIgnorable(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4174
        return CharacterData.of(codePoint).isIdentifierIgnorable(codePoint);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4175
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4176
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4177
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4178
     * Converts the character argument to lowercase using case
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4179
     * mapping information from the UnicodeData file.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4180
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4181
     * Note that
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4182
     * <code>Character.isLowerCase(Character.toLowerCase(ch))</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4183
     * does not always return <code>true</code> for some ranges of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4184
     * characters, particularly those that are symbols or ideographs.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4185
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4186
     * <p>In general, {@link java.lang.String#toLowerCase()} should be used to map
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4187
     * characters to lowercase. <code>String</code> case mapping methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4188
     * have several benefits over <code>Character</code> case mapping methods.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4189
     * <code>String</code> case mapping methods can perform locale-sensitive
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4190
     * mappings, context-sensitive mappings, and 1:M character mappings, whereas
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4191
     * the <code>Character</code> case mapping methods cannot.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4192
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4193
     * <p><b>Note:</b> This method cannot handle <a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4194
     * href="#supplementary"> supplementary characters</a>. To support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4195
     * all Unicode characters, including supplementary characters, use
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4196
     * the {@link #toLowerCase(int)} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4197
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4198
     * @param   ch   the character to be converted.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4199
     * @return  the lowercase equivalent of the character, if any;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4200
     *          otherwise, the character itself.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4201
     * @see     java.lang.Character#isLowerCase(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4202
     * @see     java.lang.String#toLowerCase()
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4203
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4204
    public static char toLowerCase(char ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4205
        return (char)toLowerCase((int)ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4206
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4207
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4208
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4209
     * Converts the character (Unicode code point) argument to
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4210
     * lowercase using case mapping information from the UnicodeData
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4211
     * file.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4212
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4213
     * <p> Note that
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4214
     * <code>Character.isLowerCase(Character.toLowerCase(codePoint))</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4215
     * does not always return <code>true</code> for some ranges of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4216
     * characters, particularly those that are symbols or ideographs.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4217
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4218
     * <p>In general, {@link java.lang.String#toLowerCase()} should be used to map
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4219
     * characters to lowercase. <code>String</code> case mapping methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4220
     * have several benefits over <code>Character</code> case mapping methods.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4221
     * <code>String</code> case mapping methods can perform locale-sensitive
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4222
     * mappings, context-sensitive mappings, and 1:M character mappings, whereas
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4223
     * the <code>Character</code> case mapping methods cannot.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4224
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4225
     * @param   codePoint   the character (Unicode code point) to be converted.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4226
     * @return  the lowercase equivalent of the character (Unicode code
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4227
     *          point), if any; otherwise, the character itself.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4228
     * @see     java.lang.Character#isLowerCase(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4229
     * @see     java.lang.String#toLowerCase()
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4230
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4231
     * @since   1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4232
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4233
    public static int toLowerCase(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4234
        return CharacterData.of(codePoint).toLowerCase(codePoint);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4235
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4236
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4237
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4238
     * Converts the character argument to uppercase using case mapping
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4239
     * information from the UnicodeData file.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4240
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4241
     * Note that
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4242
     * <code>Character.isUpperCase(Character.toUpperCase(ch))</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4243
     * does not always return <code>true</code> for some ranges of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4244
     * characters, particularly those that are symbols or ideographs.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4245
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4246
     * <p>In general, {@link java.lang.String#toUpperCase()} should be used to map
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4247
     * characters to uppercase. <code>String</code> case mapping methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4248
     * have several benefits over <code>Character</code> case mapping methods.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4249
     * <code>String</code> case mapping methods can perform locale-sensitive
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4250
     * mappings, context-sensitive mappings, and 1:M character mappings, whereas
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4251
     * the <code>Character</code> case mapping methods cannot.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4252
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4253
     * <p><b>Note:</b> This method cannot handle <a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4254
     * href="#supplementary"> supplementary characters</a>. To support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4255
     * all Unicode characters, including supplementary characters, use
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4256
     * the {@link #toUpperCase(int)} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4257
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4258
     * @param   ch   the character to be converted.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4259
     * @return  the uppercase equivalent of the character, if any;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4260
     *          otherwise, the character itself.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4261
     * @see     java.lang.Character#isUpperCase(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4262
     * @see     java.lang.String#toUpperCase()
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4263
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4264
    public static char toUpperCase(char ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4265
        return (char)toUpperCase((int)ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4266
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4267
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4268
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4269
     * Converts the character (Unicode code point) argument to
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4270
     * uppercase using case mapping information from the UnicodeData
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4271
     * file.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4272
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4273
     * <p>Note that
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4274
     * <code>Character.isUpperCase(Character.toUpperCase(codePoint))</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4275
     * does not always return <code>true</code> for some ranges of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4276
     * characters, particularly those that are symbols or ideographs.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4277
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4278
     * <p>In general, {@link java.lang.String#toUpperCase()} should be used to map
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4279
     * characters to uppercase. <code>String</code> case mapping methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4280
     * have several benefits over <code>Character</code> case mapping methods.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4281
     * <code>String</code> case mapping methods can perform locale-sensitive
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4282
     * mappings, context-sensitive mappings, and 1:M character mappings, whereas
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4283
     * the <code>Character</code> case mapping methods cannot.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4284
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4285
     * @param   codePoint   the character (Unicode code point) to be converted.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4286
     * @return  the uppercase equivalent of the character, if any;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4287
     *          otherwise, the character itself.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4288
     * @see     java.lang.Character#isUpperCase(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4289
     * @see     java.lang.String#toUpperCase()
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4290
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4291
     * @since   1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4292
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4293
    public static int toUpperCase(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4294
        return CharacterData.of(codePoint).toUpperCase(codePoint);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4295
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4296
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4297
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4298
     * Converts the character argument to titlecase using case mapping
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4299
     * information from the UnicodeData file. If a character has no
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4300
     * explicit titlecase mapping and is not itself a titlecase char
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4301
     * according to UnicodeData, then the uppercase mapping is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4302
     * returned as an equivalent titlecase mapping. If the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4303
     * <code>char</code> argument is already a titlecase
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4304
     * <code>char</code>, the same <code>char</code> value will be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4305
     * returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4306
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4307
     * Note that
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4308
     * <code>Character.isTitleCase(Character.toTitleCase(ch))</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4309
     * does not always return <code>true</code> for some ranges of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4310
     * characters.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4311
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4312
     * <p><b>Note:</b> This method cannot handle <a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4313
     * href="#supplementary"> supplementary characters</a>. To support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4314
     * all Unicode characters, including supplementary characters, use
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4315
     * the {@link #toTitleCase(int)} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4316
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4317
     * @param   ch   the character to be converted.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4318
     * @return  the titlecase equivalent of the character, if any;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4319
     *          otherwise, the character itself.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4320
     * @see     java.lang.Character#isTitleCase(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4321
     * @see     java.lang.Character#toLowerCase(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4322
     * @see     java.lang.Character#toUpperCase(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4323
     * @since   1.0.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4324
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4325
    public static char toTitleCase(char ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4326
        return (char)toTitleCase((int)ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4327
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4328
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4329
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4330
     * Converts the character (Unicode code point) argument to titlecase using case mapping
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4331
     * information from the UnicodeData file. If a character has no
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4332
     * explicit titlecase mapping and is not itself a titlecase char
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4333
     * according to UnicodeData, then the uppercase mapping is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4334
     * returned as an equivalent titlecase mapping. If the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4335
     * character argument is already a titlecase
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4336
     * character, the same character value will be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4337
     * returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4338
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4339
     * <p>Note that
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4340
     * <code>Character.isTitleCase(Character.toTitleCase(codePoint))</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4341
     * does not always return <code>true</code> for some ranges of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4342
     * characters.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4343
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4344
     * @param   codePoint   the character (Unicode code point) to be converted.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4345
     * @return  the titlecase equivalent of the character, if any;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4346
     *          otherwise, the character itself.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4347
     * @see     java.lang.Character#isTitleCase(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4348
     * @see     java.lang.Character#toLowerCase(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4349
     * @see     java.lang.Character#toUpperCase(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4350
     * @since   1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4351
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4352
    public static int toTitleCase(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4353
        return CharacterData.of(codePoint).toTitleCase(codePoint);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4354
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4355
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4356
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4357
     * Returns the numeric value of the character <code>ch</code> in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4358
     * specified radix.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4359
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4360
     * If the radix is not in the range <code>MIN_RADIX</code>&nbsp;&lt;=
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4361
     * <code>radix</code>&nbsp;&lt;= <code>MAX_RADIX</code> or if the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4362
     * value of <code>ch</code> is not a valid digit in the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4363
     * radix, <code>-1</code> is returned. A character is a valid digit
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4364
     * if at least one of the following is true:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4365
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4366
     * <li>The method <code>isDigit</code> is <code>true</code> of the character
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4367
     *     and the Unicode decimal digit value of the character (or its
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4368
     *     single-character decomposition) is less than the specified radix.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4369
     *     In this case the decimal digit value is returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4370
     * <li>The character is one of the uppercase Latin letters
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4371
     *     <code>'A'</code> through <code>'Z'</code> and its code is less than
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4372
     *     <code>radix&nbsp;+ 'A'&nbsp;-&nbsp;10</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4373
     *     In this case, <code>ch&nbsp;- 'A'&nbsp;+&nbsp;10</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4374
     *     is returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4375
     * <li>The character is one of the lowercase Latin letters
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4376
     *     <code>'a'</code> through <code>'z'</code> and its code is less than
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4377
     *     <code>radix&nbsp;+ 'a'&nbsp;-&nbsp;10</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4378
     *     In this case, <code>ch&nbsp;- 'a'&nbsp;+&nbsp;10</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4379
     *     is returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4380
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4381
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4382
     * <p><b>Note:</b> This method cannot handle <a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4383
     * href="#supplementary"> supplementary characters</a>. To support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4384
     * all Unicode characters, including supplementary characters, use
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4385
     * the {@link #digit(int, int)} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4386
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4387
     * @param   ch      the character to be converted.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4388
     * @param   radix   the radix.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4389
     * @return  the numeric value represented by the character in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4390
     *          specified radix.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4391
     * @see     java.lang.Character#forDigit(int, int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4392
     * @see     java.lang.Character#isDigit(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4393
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4394
    public static int digit(char ch, int radix) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4395
        return digit((int)ch, radix);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4396
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4397
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4398
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4399
     * Returns the numeric value of the specified character (Unicode
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4400
     * code point) in the specified radix.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4401
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4402
     * <p>If the radix is not in the range <code>MIN_RADIX</code>&nbsp;&lt;=
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4403
     * <code>radix</code>&nbsp;&lt;= <code>MAX_RADIX</code> or if the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4404
     * character is not a valid digit in the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4405
     * radix, <code>-1</code> is returned. A character is a valid digit
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4406
     * if at least one of the following is true:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4407
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4408
     * <li>The method {@link #isDigit(int) isDigit(codePoint)} is <code>true</code> of the character
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4409
     *     and the Unicode decimal digit value of the character (or its
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4410
     *     single-character decomposition) is less than the specified radix.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4411
     *     In this case the decimal digit value is returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4412
     * <li>The character is one of the uppercase Latin letters
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4413
     *     <code>'A'</code> through <code>'Z'</code> and its code is less than
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4414
     *     <code>radix&nbsp;+ 'A'&nbsp;-&nbsp;10</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4415
     *     In this case, <code>ch&nbsp;- 'A'&nbsp;+&nbsp;10</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4416
     *     is returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4417
     * <li>The character is one of the lowercase Latin letters
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4418
     *     <code>'a'</code> through <code>'z'</code> and its code is less than
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4419
     *     <code>radix&nbsp;+ 'a'&nbsp;-&nbsp;10</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4420
     *     In this case, <code>ch&nbsp;- 'a'&nbsp;+&nbsp;10</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4421
     *     is returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4422
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4423
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4424
     * @param   codePoint the character (Unicode code point) to be converted.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4425
     * @param   radix   the radix.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4426
     * @return  the numeric value represented by the character in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4427
     *          specified radix.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4428
     * @see     java.lang.Character#forDigit(int, int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4429
     * @see     java.lang.Character#isDigit(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4430
     * @since   1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4431
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4432
    public static int digit(int codePoint, int radix) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4433
        return CharacterData.of(codePoint).digit(codePoint, radix);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4434
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4435
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4436
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4437
     * Returns the <code>int</code> value that the specified Unicode
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4438
     * character represents. For example, the character
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4439
     * <code>'&#92;u216C'</code> (the roman numeral fifty) will return
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4440
     * an int with a value of 50.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4441
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4442
     * The letters A-Z in their uppercase (<code>'&#92;u0041'</code> through
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4443
     * <code>'&#92;u005A'</code>), lowercase
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4444
     * (<code>'&#92;u0061'</code> through <code>'&#92;u007A'</code>), and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4445
     * full width variant (<code>'&#92;uFF21'</code> through
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4446
     * <code>'&#92;uFF3A'</code> and <code>'&#92;uFF41'</code> through
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4447
     * <code>'&#92;uFF5A'</code>) forms have numeric values from 10
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4448
     * through 35. This is independent of the Unicode specification,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4449
     * which does not assign numeric values to these <code>char</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4450
     * values.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4451
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4452
     * If the character does not have a numeric value, then -1 is returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4453
     * If the character has a numeric value that cannot be represented as a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4454
     * nonnegative integer (for example, a fractional value), then -2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4455
     * is returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4456
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4457
     * <p><b>Note:</b> This method cannot handle <a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4458
     * href="#supplementary"> supplementary characters</a>. To support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4459
     * all Unicode characters, including supplementary characters, use
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4460
     * the {@link #getNumericValue(int)} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4461
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4462
     * @param   ch      the character to be converted.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4463
     * @return  the numeric value of the character, as a nonnegative <code>int</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4464
     *           value; -2 if the character has a numeric value that is not a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4465
     *          nonnegative integer; -1 if the character has no numeric value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4466
     * @see     java.lang.Character#forDigit(int, int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4467
     * @see     java.lang.Character#isDigit(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4468
     * @since   1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4469
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4470
    public static int getNumericValue(char ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4471
        return getNumericValue((int)ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4472
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4473
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4474
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4475
     * Returns the <code>int</code> value that the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4476
     * character (Unicode code point) represents. For example, the character
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4477
     * <code>'&#92;u216C'</code> (the Roman numeral fifty) will return
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4478
     * an <code>int</code> with a value of 50.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4479
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4480
     * The letters A-Z in their uppercase (<code>'&#92;u0041'</code> through
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4481
     * <code>'&#92;u005A'</code>), lowercase
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4482
     * (<code>'&#92;u0061'</code> through <code>'&#92;u007A'</code>), and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4483
     * full width variant (<code>'&#92;uFF21'</code> through
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4484
     * <code>'&#92;uFF3A'</code> and <code>'&#92;uFF41'</code> through
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4485
     * <code>'&#92;uFF5A'</code>) forms have numeric values from 10
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4486
     * through 35. This is independent of the Unicode specification,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4487
     * which does not assign numeric values to these <code>char</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4488
     * values.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4489
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4490
     * If the character does not have a numeric value, then -1 is returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4491
     * If the character has a numeric value that cannot be represented as a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4492
     * nonnegative integer (for example, a fractional value), then -2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4493
     * is returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4494
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4495
     * @param   codePoint the character (Unicode code point) to be converted.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4496
     * @return  the numeric value of the character, as a nonnegative <code>int</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4497
     *          value; -2 if the character has a numeric value that is not a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4498
     *          nonnegative integer; -1 if the character has no numeric value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4499
     * @see     java.lang.Character#forDigit(int, int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4500
     * @see     java.lang.Character#isDigit(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4501
     * @since   1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4502
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4503
    public static int getNumericValue(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4504
        return CharacterData.of(codePoint).getNumericValue(codePoint);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4505
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4506
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4507
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4508
     * Determines if the specified character is ISO-LATIN-1 white space.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4509
     * This method returns <code>true</code> for the following five
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4510
     * characters only:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4511
     * <table>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4512
     * <tr><td><code>'\t'</code></td>            <td><code>'&#92;u0009'</code></td>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4513
     *     <td><code>HORIZONTAL TABULATION</code></td></tr>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4514
     * <tr><td><code>'\n'</code></td>            <td><code>'&#92;u000A'</code></td>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4515
     *     <td><code>NEW LINE</code></td></tr>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4516
     * <tr><td><code>'\f'</code></td>            <td><code>'&#92;u000C'</code></td>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4517
     *     <td><code>FORM FEED</code></td></tr>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4518
     * <tr><td><code>'\r'</code></td>            <td><code>'&#92;u000D'</code></td>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4519
     *     <td><code>CARRIAGE RETURN</code></td></tr>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4520
     * <tr><td><code>'&nbsp;'</code></td>  <td><code>'&#92;u0020'</code></td>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4521
     *     <td><code>SPACE</code></td></tr>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4522
     * </table>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4523
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4524
     * @param      ch   the character to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4525
     * @return     <code>true</code> if the character is ISO-LATIN-1 white
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4526
     *             space; <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4527
     * @see        java.lang.Character#isSpaceChar(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4528
     * @see        java.lang.Character#isWhitespace(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4529
     * @deprecated Replaced by isWhitespace(char).
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4530
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4531
    @Deprecated
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4532
    public static boolean isSpace(char ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4533
        return (ch <= 0x0020) &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4534
            (((((1L << 0x0009) |
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4535
            (1L << 0x000A) |
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4536
            (1L << 0x000C) |
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4537
            (1L << 0x000D) |
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4538
            (1L << 0x0020)) >> ch) & 1L) != 0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4539
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4540
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4541
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4542
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4543
     * Determines if the specified character is a Unicode space character.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4544
     * A character is considered to be a space character if and only if
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4545
     * it is specified to be a space character by the Unicode standard. This
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4546
     * method returns true if the character's general category type is any of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4547
     * the following:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4548
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4549
     * <li> <code>SPACE_SEPARATOR</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4550
     * <li> <code>LINE_SEPARATOR</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4551
     * <li> <code>PARAGRAPH_SEPARATOR</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4552
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4553
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4554
     * <p><b>Note:</b> This method cannot handle <a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4555
     * href="#supplementary"> supplementary characters</a>. To support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4556
     * all Unicode characters, including supplementary characters, use
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4557
     * the {@link #isSpaceChar(int)} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4558
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4559
     * @param   ch      the character to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4560
     * @return  <code>true</code> if the character is a space character;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4561
     *          <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4562
     * @see     java.lang.Character#isWhitespace(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4563
     * @since   1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4564
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4565
    public static boolean isSpaceChar(char ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4566
        return isSpaceChar((int)ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4567
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4568
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4569
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4570
     * Determines if the specified character (Unicode code point) is a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4571
     * Unicode space character.  A character is considered to be a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4572
     * space character if and only if it is specified to be a space
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4573
     * character by the Unicode standard. This method returns true if
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4574
     * the character's general category type is any of the following:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4575
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4576
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4577
     * <li> {@link #SPACE_SEPARATOR}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4578
     * <li> {@link #LINE_SEPARATOR}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4579
     * <li> {@link #PARAGRAPH_SEPARATOR}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4580
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4581
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4582
     * @param   codePoint the character (Unicode code point) to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4583
     * @return  <code>true</code> if the character is a space character;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4584
     *          <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4585
     * @see     java.lang.Character#isWhitespace(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4586
     * @since   1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4587
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4588
    public static boolean isSpaceChar(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4589
        return ((((1 << Character.SPACE_SEPARATOR) |
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4590
                  (1 << Character.LINE_SEPARATOR) |
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4591
                  (1 << Character.PARAGRAPH_SEPARATOR)) >> getType(codePoint)) & 1)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4592
            != 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4593
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4594
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4595
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4596
     * Determines if the specified character is white space according to Java.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4597
     * A character is a Java whitespace character if and only if it satisfies
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4598
     * one of the following criteria:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4599
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4600
     * <li> It is a Unicode space character (<code>SPACE_SEPARATOR</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4601
     *      <code>LINE_SEPARATOR</code>, or <code>PARAGRAPH_SEPARATOR</code>)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4602
     *      but is not also a non-breaking space (<code>'&#92;u00A0'</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4603
     *      <code>'&#92;u2007'</code>, <code>'&#92;u202F'</code>).
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4604
     * <li> It is <code>'&#92;u0009'</code>, HORIZONTAL TABULATION.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4605
     * <li> It is <code>'&#92;u000A'</code>, LINE FEED.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4606
     * <li> It is <code>'&#92;u000B'</code>, VERTICAL TABULATION.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4607
     * <li> It is <code>'&#92;u000C'</code>, FORM FEED.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4608
     * <li> It is <code>'&#92;u000D'</code>, CARRIAGE RETURN.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4609
     * <li> It is <code>'&#92;u001C'</code>, FILE SEPARATOR.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4610
     * <li> It is <code>'&#92;u001D'</code>, GROUP SEPARATOR.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4611
     * <li> It is <code>'&#92;u001E'</code>, RECORD SEPARATOR.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4612
     * <li> It is <code>'&#92;u001F'</code>, UNIT SEPARATOR.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4613
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4614
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4615
     * <p><b>Note:</b> This method cannot handle <a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4616
     * href="#supplementary"> supplementary characters</a>. To support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4617
     * all Unicode characters, including supplementary characters, use
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4618
     * the {@link #isWhitespace(int)} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4619
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4620
     * @param   ch the character to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4621
     * @return  <code>true</code> if the character is a Java whitespace
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4622
     *          character; <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4623
     * @see     java.lang.Character#isSpaceChar(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4624
     * @since   1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4625
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4626
    public static boolean isWhitespace(char ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4627
        return isWhitespace((int)ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4628
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4629
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4630
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4631
     * Determines if the specified character (Unicode code point) is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4632
     * white space according to Java.  A character is a Java
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4633
     * whitespace character if and only if it satisfies one of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4634
     * following criteria:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4635
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4636
     * <li> It is a Unicode space character ({@link #SPACE_SEPARATOR},
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4637
     *      {@link #LINE_SEPARATOR}, or {@link #PARAGRAPH_SEPARATOR})
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4638
     *      but is not also a non-breaking space (<code>'&#92;u00A0'</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4639
     *      <code>'&#92;u2007'</code>, <code>'&#92;u202F'</code>).
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4640
     * <li> It is <code>'&#92;u0009'</code>, HORIZONTAL TABULATION.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4641
     * <li> It is <code>'&#92;u000A'</code>, LINE FEED.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4642
     * <li> It is <code>'&#92;u000B'</code>, VERTICAL TABULATION.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4643
     * <li> It is <code>'&#92;u000C'</code>, FORM FEED.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4644
     * <li> It is <code>'&#92;u000D'</code>, CARRIAGE RETURN.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4645
     * <li> It is <code>'&#92;u001C'</code>, FILE SEPARATOR.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4646
     * <li> It is <code>'&#92;u001D'</code>, GROUP SEPARATOR.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4647
     * <li> It is <code>'&#92;u001E'</code>, RECORD SEPARATOR.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4648
     * <li> It is <code>'&#92;u001F'</code>, UNIT SEPARATOR.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4649
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4650
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4651
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4652
     * @param   codePoint the character (Unicode code point) to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4653
     * @return  <code>true</code> if the character is a Java whitespace
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4654
     *          character; <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4655
     * @see     java.lang.Character#isSpaceChar(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4656
     * @since   1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4657
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4658
    public static boolean isWhitespace(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4659
        return CharacterData.of(codePoint).isWhitespace(codePoint);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4660
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4661
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4662
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4663
     * Determines if the specified character is an ISO control
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4664
     * character.  A character is considered to be an ISO control
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4665
     * character if its code is in the range <code>'&#92;u0000'</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4666
     * through <code>'&#92;u001F'</code> or in the range
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4667
     * <code>'&#92;u007F'</code> through <code>'&#92;u009F'</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4668
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4669
     * <p><b>Note:</b> This method cannot handle <a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4670
     * href="#supplementary"> supplementary characters</a>. To support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4671
     * all Unicode characters, including supplementary characters, use
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4672
     * the {@link #isISOControl(int)} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4673
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4674
     * @param   ch      the character to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4675
     * @return  <code>true</code> if the character is an ISO control character;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4676
     *          <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4677
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4678
     * @see     java.lang.Character#isSpaceChar(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4679
     * @see     java.lang.Character#isWhitespace(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4680
     * @since   1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4681
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4682
    public static boolean isISOControl(char ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4683
        return isISOControl((int)ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4684
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4685
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4686
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4687
     * Determines if the referenced character (Unicode code point) is an ISO control
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4688
     * character.  A character is considered to be an ISO control
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4689
     * character if its code is in the range <code>'&#92;u0000'</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4690
     * through <code>'&#92;u001F'</code> or in the range
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4691
     * <code>'&#92;u007F'</code> through <code>'&#92;u009F'</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4692
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4693
     * @param   codePoint the character (Unicode code point) to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4694
     * @return  <code>true</code> if the character is an ISO control character;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4695
     *          <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4696
     * @see     java.lang.Character#isSpaceChar(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4697
     * @see     java.lang.Character#isWhitespace(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4698
     * @since   1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4699
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4700
    public static boolean isISOControl(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4701
        return (codePoint >= 0x0000 && codePoint <= 0x001F) ||
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4702
            (codePoint >= 0x007F && codePoint <= 0x009F);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4703
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4704
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4705
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4706
     * Returns a value indicating a character's general category.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4707
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4708
     * <p><b>Note:</b> This method cannot handle <a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4709
     * href="#supplementary"> supplementary characters</a>. To support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4710
     * all Unicode characters, including supplementary characters, use
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4711
     * the {@link #getType(int)} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4712
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4713
     * @param   ch      the character to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4714
     * @return  a value of type <code>int</code> representing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4715
     *          character's general category.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4716
     * @see     java.lang.Character#COMBINING_SPACING_MARK
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4717
     * @see     java.lang.Character#CONNECTOR_PUNCTUATION
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4718
     * @see     java.lang.Character#CONTROL
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4719
     * @see     java.lang.Character#CURRENCY_SYMBOL
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4720
     * @see     java.lang.Character#DASH_PUNCTUATION
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4721
     * @see     java.lang.Character#DECIMAL_DIGIT_NUMBER
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4722
     * @see     java.lang.Character#ENCLOSING_MARK
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4723
     * @see     java.lang.Character#END_PUNCTUATION
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4724
     * @see     java.lang.Character#FINAL_QUOTE_PUNCTUATION
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4725
     * @see     java.lang.Character#FORMAT
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4726
     * @see     java.lang.Character#INITIAL_QUOTE_PUNCTUATION
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4727
     * @see     java.lang.Character#LETTER_NUMBER
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4728
     * @see     java.lang.Character#LINE_SEPARATOR
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4729
     * @see     java.lang.Character#LOWERCASE_LETTER
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4730
     * @see     java.lang.Character#MATH_SYMBOL
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4731
     * @see     java.lang.Character#MODIFIER_LETTER
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4732
     * @see     java.lang.Character#MODIFIER_SYMBOL
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4733
     * @see     java.lang.Character#NON_SPACING_MARK
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4734
     * @see     java.lang.Character#OTHER_LETTER
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4735
     * @see     java.lang.Character#OTHER_NUMBER
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4736
     * @see     java.lang.Character#OTHER_PUNCTUATION
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4737
     * @see     java.lang.Character#OTHER_SYMBOL
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4738
     * @see     java.lang.Character#PARAGRAPH_SEPARATOR
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4739
     * @see     java.lang.Character#PRIVATE_USE
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4740
     * @see     java.lang.Character#SPACE_SEPARATOR
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4741
     * @see     java.lang.Character#START_PUNCTUATION
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4742
     * @see     java.lang.Character#SURROGATE
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4743
     * @see     java.lang.Character#TITLECASE_LETTER
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4744
     * @see     java.lang.Character#UNASSIGNED
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4745
     * @see     java.lang.Character#UPPERCASE_LETTER
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4746
     * @since   1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4747
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4748
    public static int getType(char ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4749
        return getType((int)ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4750
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4751
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4752
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4753
     * Returns a value indicating a character's general category.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4754
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4755
     * @param   codePoint the character (Unicode code point) to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4756
     * @return  a value of type <code>int</code> representing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4757
     *          character's general category.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4758
     * @see     Character#COMBINING_SPACING_MARK COMBINING_SPACING_MARK
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4759
     * @see     Character#CONNECTOR_PUNCTUATION CONNECTOR_PUNCTUATION
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4760
     * @see     Character#CONTROL CONTROL
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4761
     * @see     Character#CURRENCY_SYMBOL CURRENCY_SYMBOL
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4762
     * @see     Character#DASH_PUNCTUATION DASH_PUNCTUATION
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4763
     * @see     Character#DECIMAL_DIGIT_NUMBER DECIMAL_DIGIT_NUMBER
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4764
     * @see     Character#ENCLOSING_MARK ENCLOSING_MARK
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4765
     * @see     Character#END_PUNCTUATION END_PUNCTUATION
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4766
     * @see     Character#FINAL_QUOTE_PUNCTUATION FINAL_QUOTE_PUNCTUATION
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4767
     * @see     Character#FORMAT FORMAT
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4768
     * @see     Character#INITIAL_QUOTE_PUNCTUATION INITIAL_QUOTE_PUNCTUATION
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4769
     * @see     Character#LETTER_NUMBER LETTER_NUMBER
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4770
     * @see     Character#LINE_SEPARATOR LINE_SEPARATOR
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4771
     * @see     Character#LOWERCASE_LETTER LOWERCASE_LETTER
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4772
     * @see     Character#MATH_SYMBOL MATH_SYMBOL
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4773
     * @see     Character#MODIFIER_LETTER MODIFIER_LETTER
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4774
     * @see     Character#MODIFIER_SYMBOL MODIFIER_SYMBOL
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4775
     * @see     Character#NON_SPACING_MARK NON_SPACING_MARK
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4776
     * @see     Character#OTHER_LETTER OTHER_LETTER
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4777
     * @see     Character#OTHER_NUMBER OTHER_NUMBER
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4778
     * @see     Character#OTHER_PUNCTUATION OTHER_PUNCTUATION
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4779
     * @see     Character#OTHER_SYMBOL OTHER_SYMBOL
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4780
     * @see     Character#PARAGRAPH_SEPARATOR PARAGRAPH_SEPARATOR
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4781
     * @see     Character#PRIVATE_USE PRIVATE_USE
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4782
     * @see     Character#SPACE_SEPARATOR SPACE_SEPARATOR
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4783
     * @see     Character#START_PUNCTUATION START_PUNCTUATION
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4784
     * @see     Character#SURROGATE SURROGATE
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4785
     * @see     Character#TITLECASE_LETTER TITLECASE_LETTER
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4786
     * @see     Character#UNASSIGNED UNASSIGNED
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4787
     * @see     Character#UPPERCASE_LETTER UPPERCASE_LETTER
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4788
     * @since   1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4789
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4790
    public static int getType(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4791
        return CharacterData.of(codePoint).getType(codePoint);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4792
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4793
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4794
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4795
     * Determines the character representation for a specific digit in
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4796
     * the specified radix. If the value of <code>radix</code> is not a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4797
     * valid radix, or the value of <code>digit</code> is not a valid
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4798
     * digit in the specified radix, the null character
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4799
     * (<code>'&#92;u0000'</code>) is returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4800
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4801
     * The <code>radix</code> argument is valid if it is greater than or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4802
     * equal to <code>MIN_RADIX</code> and less than or equal to
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4803
     * <code>MAX_RADIX</code>. The <code>digit</code> argument is valid if
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4804
     * <code>0&nbsp;&lt;=digit&nbsp;&lt;&nbsp;radix</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4805
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4806
     * If the digit is less than 10, then
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4807
     * <code>'0'&nbsp;+ digit</code> is returned. Otherwise, the value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4808
     * <code>'a'&nbsp;+ digit&nbsp;-&nbsp;10</code> is returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4809
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4810
     * @param   digit   the number to convert to a character.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4811
     * @param   radix   the radix.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4812
     * @return  the <code>char</code> representation of the specified digit
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4813
     *          in the specified radix.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4814
     * @see     java.lang.Character#MIN_RADIX
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4815
     * @see     java.lang.Character#MAX_RADIX
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4816
     * @see     java.lang.Character#digit(char, int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4817
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4818
    public static char forDigit(int digit, int radix) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4819
        if ((digit >= radix) || (digit < 0)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4820
            return '\0';
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4821
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4822
        if ((radix < Character.MIN_RADIX) || (radix > Character.MAX_RADIX)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4823
            return '\0';
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4824
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4825
        if (digit < 10) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4826
            return (char)('0' + digit);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4827
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4828
        return (char)('a' - 10 + digit);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4829
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4830
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4831
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4832
     * Returns the Unicode directionality property for the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4833
     * character.  Character directionality is used to calculate the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4834
     * visual ordering of text. The directionality value of undefined
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4835
     * <code>char</code> values is <code>DIRECTIONALITY_UNDEFINED</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4836
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4837
     * <p><b>Note:</b> This method cannot handle <a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4838
     * href="#supplementary"> supplementary characters</a>. To support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4839
     * all Unicode characters, including supplementary characters, use
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4840
     * the {@link #getDirectionality(int)} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4841
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4842
     * @param  ch <code>char</code> for which the directionality property
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4843
     *            is requested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4844
     * @return the directionality property of the <code>char</code> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4845
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4846
     * @see Character#DIRECTIONALITY_UNDEFINED
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4847
     * @see Character#DIRECTIONALITY_LEFT_TO_RIGHT
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4848
     * @see Character#DIRECTIONALITY_RIGHT_TO_LEFT
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4849
     * @see Character#DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4850
     * @see Character#DIRECTIONALITY_EUROPEAN_NUMBER
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4851
     * @see Character#DIRECTIONALITY_EUROPEAN_NUMBER_SEPARATOR
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4852
     * @see Character#DIRECTIONALITY_EUROPEAN_NUMBER_TERMINATOR
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4853
     * @see Character#DIRECTIONALITY_ARABIC_NUMBER
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4854
     * @see Character#DIRECTIONALITY_COMMON_NUMBER_SEPARATOR
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4855
     * @see Character#DIRECTIONALITY_NONSPACING_MARK
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4856
     * @see Character#DIRECTIONALITY_BOUNDARY_NEUTRAL
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4857
     * @see Character#DIRECTIONALITY_PARAGRAPH_SEPARATOR
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4858
     * @see Character#DIRECTIONALITY_SEGMENT_SEPARATOR
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4859
     * @see Character#DIRECTIONALITY_WHITESPACE
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4860
     * @see Character#DIRECTIONALITY_OTHER_NEUTRALS
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4861
     * @see Character#DIRECTIONALITY_LEFT_TO_RIGHT_EMBEDDING
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4862
     * @see Character#DIRECTIONALITY_LEFT_TO_RIGHT_OVERRIDE
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4863
     * @see Character#DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4864
     * @see Character#DIRECTIONALITY_RIGHT_TO_LEFT_OVERRIDE
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4865
     * @see Character#DIRECTIONALITY_POP_DIRECTIONAL_FORMAT
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4866
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4867
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4868
    public static byte getDirectionality(char ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4869
        return getDirectionality((int)ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4870
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4871
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4872
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4873
     * Returns the Unicode directionality property for the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4874
     * character (Unicode code point).  Character directionality is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4875
     * used to calculate the visual ordering of text. The
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4876
     * directionality value of undefined character is {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4877
     * #DIRECTIONALITY_UNDEFINED}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4878
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4879
     * @param   codePoint the character (Unicode code point) for which
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4880
     *          the directionality property is requested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4881
     * @return the directionality property of the character.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4882
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4883
     * @see Character#DIRECTIONALITY_UNDEFINED DIRECTIONALITY_UNDEFINED
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4884
     * @see Character#DIRECTIONALITY_LEFT_TO_RIGHT DIRECTIONALITY_LEFT_TO_RIGHT
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4885
     * @see Character#DIRECTIONALITY_RIGHT_TO_LEFT DIRECTIONALITY_RIGHT_TO_LEFT
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4886
     * @see Character#DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4887
     * @see Character#DIRECTIONALITY_EUROPEAN_NUMBER DIRECTIONALITY_EUROPEAN_NUMBER
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4888
     * @see Character#DIRECTIONALITY_EUROPEAN_NUMBER_SEPARATOR DIRECTIONALITY_EUROPEAN_NUMBER_SEPARATOR
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4889
     * @see Character#DIRECTIONALITY_EUROPEAN_NUMBER_TERMINATOR DIRECTIONALITY_EUROPEAN_NUMBER_TERMINATOR
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4890
     * @see Character#DIRECTIONALITY_ARABIC_NUMBER DIRECTIONALITY_ARABIC_NUMBER
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4891
     * @see Character#DIRECTIONALITY_COMMON_NUMBER_SEPARATOR DIRECTIONALITY_COMMON_NUMBER_SEPARATOR
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4892
     * @see Character#DIRECTIONALITY_NONSPACING_MARK DIRECTIONALITY_NONSPACING_MARK
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4893
     * @see Character#DIRECTIONALITY_BOUNDARY_NEUTRAL DIRECTIONALITY_BOUNDARY_NEUTRAL
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4894
     * @see Character#DIRECTIONALITY_PARAGRAPH_SEPARATOR DIRECTIONALITY_PARAGRAPH_SEPARATOR
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4895
     * @see Character#DIRECTIONALITY_SEGMENT_SEPARATOR DIRECTIONALITY_SEGMENT_SEPARATOR
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4896
     * @see Character#DIRECTIONALITY_WHITESPACE DIRECTIONALITY_WHITESPACE
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4897
     * @see Character#DIRECTIONALITY_OTHER_NEUTRALS DIRECTIONALITY_OTHER_NEUTRALS
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4898
     * @see Character#DIRECTIONALITY_LEFT_TO_RIGHT_EMBEDDING DIRECTIONALITY_LEFT_TO_RIGHT_EMBEDDING
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4899
     * @see Character#DIRECTIONALITY_LEFT_TO_RIGHT_OVERRIDE DIRECTIONALITY_LEFT_TO_RIGHT_OVERRIDE
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4900
     * @see Character#DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4901
     * @see Character#DIRECTIONALITY_RIGHT_TO_LEFT_OVERRIDE DIRECTIONALITY_RIGHT_TO_LEFT_OVERRIDE
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4902
     * @see Character#DIRECTIONALITY_POP_DIRECTIONAL_FORMAT DIRECTIONALITY_POP_DIRECTIONAL_FORMAT
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4903
     * @since    1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4904
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4905
    public static byte getDirectionality(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4906
        return CharacterData.of(codePoint).getDirectionality(codePoint);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4907
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4908
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4909
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4910
     * Determines whether the character is mirrored according to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4911
     * Unicode specification.  Mirrored characters should have their
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4912
     * glyphs horizontally mirrored when displayed in text that is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4913
     * right-to-left.  For example, <code>'&#92;u0028'</code> LEFT
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4914
     * PARENTHESIS is semantically defined to be an <i>opening
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4915
     * parenthesis</i>.  This will appear as a "(" in text that is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4916
     * left-to-right but as a ")" in text that is right-to-left.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4917
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4918
     * <p><b>Note:</b> This method cannot handle <a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4919
     * href="#supplementary"> supplementary characters</a>. To support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4920
     * all Unicode characters, including supplementary characters, use
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4921
     * the {@link #isMirrored(int)} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4922
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4923
     * @param  ch <code>char</code> for which the mirrored property is requested
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4924
     * @return <code>true</code> if the char is mirrored, <code>false</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4925
     *         if the <code>char</code> is not mirrored or is not defined.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4926
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4927
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4928
    public static boolean isMirrored(char ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4929
        return isMirrored((int)ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4930
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4931
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4932
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4933
     * Determines whether the specified character (Unicode code point)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4934
     * is mirrored according to the Unicode specification.  Mirrored
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4935
     * characters should have their glyphs horizontally mirrored when
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4936
     * displayed in text that is right-to-left.  For example,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4937
     * <code>'&#92;u0028'</code> LEFT PARENTHESIS is semantically
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4938
     * defined to be an <i>opening parenthesis</i>.  This will appear
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4939
     * as a "(" in text that is left-to-right but as a ")" in text
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4940
     * that is right-to-left.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4941
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4942
     * @param   codePoint the character (Unicode code point) to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4943
     * @return  <code>true</code> if the character is mirrored, <code>false</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4944
     *          if the character is not mirrored or is not defined.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4945
     * @since   1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4946
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4947
    public static boolean isMirrored(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4948
        return CharacterData.of(codePoint).isMirrored(codePoint);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4949
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4950
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4951
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4952
     * Compares two <code>Character</code> objects numerically.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4953
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4954
     * @param   anotherCharacter   the <code>Character</code> to be compared.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4955
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4956
     * @return  the value <code>0</code> if the argument <code>Character</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4957
     *          is equal to this <code>Character</code>; a value less than
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4958
     *          <code>0</code> if this <code>Character</code> is numerically less
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4959
     *          than the <code>Character</code> argument; and a value greater than
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4960
     *          <code>0</code> if this <code>Character</code> is numerically greater
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4961
     *          than the <code>Character</code> argument (unsigned comparison).
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4962
     *          Note that this is strictly a numerical comparison; it is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4963
     *          locale-dependent.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4964
     * @since   1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4965
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4966
    public int compareTo(Character anotherCharacter) {
3943
11abf5578222 6582946: Add suite of compare(T, T) methods for ints, longs etc
martin
parents: 3942
diff changeset
  4967
        return compare(this.value, anotherCharacter.value);
11abf5578222 6582946: Add suite of compare(T, T) methods for ints, longs etc
martin
parents: 3942
diff changeset
  4968
    }
11abf5578222 6582946: Add suite of compare(T, T) methods for ints, longs etc
martin
parents: 3942
diff changeset
  4969
11abf5578222 6582946: Add suite of compare(T, T) methods for ints, longs etc
martin
parents: 3942
diff changeset
  4970
    /**
11abf5578222 6582946: Add suite of compare(T, T) methods for ints, longs etc
martin
parents: 3942
diff changeset
  4971
     * Compares two {@code char} values numerically.
11abf5578222 6582946: Add suite of compare(T, T) methods for ints, longs etc
martin
parents: 3942
diff changeset
  4972
     * The value returned is identical to what would be returned by:
11abf5578222 6582946: Add suite of compare(T, T) methods for ints, longs etc
martin
parents: 3942
diff changeset
  4973
     * <pre>
11abf5578222 6582946: Add suite of compare(T, T) methods for ints, longs etc
martin
parents: 3942
diff changeset
  4974
     *    Character.valueOf(x).compareTo(Character.valueOf(y))
11abf5578222 6582946: Add suite of compare(T, T) methods for ints, longs etc
martin
parents: 3942
diff changeset
  4975
     * </pre>
11abf5578222 6582946: Add suite of compare(T, T) methods for ints, longs etc
martin
parents: 3942
diff changeset
  4976
     *
11abf5578222 6582946: Add suite of compare(T, T) methods for ints, longs etc
martin
parents: 3942
diff changeset
  4977
     * @param  x the first {@code char} to compare
11abf5578222 6582946: Add suite of compare(T, T) methods for ints, longs etc
martin
parents: 3942
diff changeset
  4978
     * @param  y the second {@code char} to compare
11abf5578222 6582946: Add suite of compare(T, T) methods for ints, longs etc
martin
parents: 3942
diff changeset
  4979
     * @return the value {@code 0} if {@code x == y};
11abf5578222 6582946: Add suite of compare(T, T) methods for ints, longs etc
martin
parents: 3942
diff changeset
  4980
     *         a value less than {@code 0} if {@code x < y}; and
11abf5578222 6582946: Add suite of compare(T, T) methods for ints, longs etc
martin
parents: 3942
diff changeset
  4981
     *         a value greater than {@code 0} if {@code x > y}
11abf5578222 6582946: Add suite of compare(T, T) methods for ints, longs etc
martin
parents: 3942
diff changeset
  4982
     * @since 1.7
11abf5578222 6582946: Add suite of compare(T, T) methods for ints, longs etc
martin
parents: 3942
diff changeset
  4983
     */
11abf5578222 6582946: Add suite of compare(T, T) methods for ints, longs etc
martin
parents: 3942
diff changeset
  4984
    public static int compare(char x, char y) {
11abf5578222 6582946: Add suite of compare(T, T) methods for ints, longs etc
martin
parents: 3942
diff changeset
  4985
        return x - y;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4986
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4987
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4988
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4989
     * Converts the character (Unicode code point) argument to uppercase using
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4990
     * information from the UnicodeData file.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4991
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4992
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4993
     * @param   codePoint   the character (Unicode code point) to be converted.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4994
     * @return  either the uppercase equivalent of the character, if
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4995
     *          any, or an error flag (<code>Character.ERROR</code>)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4996
     *          that indicates that a 1:M <code>char</code> mapping exists.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4997
     * @see     java.lang.Character#isLowerCase(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4998
     * @see     java.lang.Character#isUpperCase(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4999
     * @see     java.lang.Character#toLowerCase(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  5000
     * @see     java.lang.Character#toTitleCase(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  5001
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  5002
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  5003
    static int toUpperCaseEx(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  5004
        assert isValidCodePoint(codePoint);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  5005
        return CharacterData.of(codePoint).toUpperCaseEx(codePoint);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  5006
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  5007
90ce3da70b43 Initial load
duke
parents:
diff changeset
  5008
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  5009
     * Converts the character (Unicode code point) argument to uppercase using case
90ce3da70b43 Initial load
duke
parents:
diff changeset
  5010
     * mapping information from the SpecialCasing file in the Unicode
90ce3da70b43 Initial load
duke
parents:
diff changeset
  5011
     * specification. If a character has no explicit uppercase
90ce3da70b43 Initial load
duke
parents:
diff changeset
  5012
     * mapping, then the <code>char</code> itself is returned in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  5013
     * <code>char[]</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  5014
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  5015
     * @param   codePoint   the character (Unicode code point) to be converted.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  5016
     * @return a <code>char[]</code> with the uppercased character.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  5017
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  5018
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  5019
    static char[] toUpperCaseCharArray(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  5020
        // As of Unicode 4.0, 1:M uppercasings only happen in the BMP.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  5021
        assert isValidCodePoint(codePoint) &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
  5022
               !isSupplementaryCodePoint(codePoint);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  5023
        return CharacterData.of(codePoint).toUpperCaseCharArray(codePoint);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  5024
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  5025
90ce3da70b43 Initial load
duke
parents:
diff changeset
  5026
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  5027
     * The number of bits used to represent a <tt>char</tt> value in unsigned
3714
6a4eb8f53f91 6860431: Character.isSurrogate(char ch)
martin
parents: 3505
diff changeset
  5028
     * binary form, constant {@code 16}.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  5029
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  5030
     * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  5031
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  5032
    public static final int SIZE = 16;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  5033
90ce3da70b43 Initial load
duke
parents:
diff changeset
  5034
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  5035
     * Returns the value obtained by reversing the order of the bytes in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  5036
     * specified <tt>char</tt> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  5037
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  5038
     * @return the value obtained by reversing (or, equivalently, swapping)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  5039
     *     the bytes in the specified <tt>char</tt> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  5040
     * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  5041
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  5042
    public static char reverseBytes(char ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  5043
        return (char) (((ch & 0xFF00) >> 8) | (ch << 8));
90ce3da70b43 Initial load
duke
parents:
diff changeset
  5044
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  5045
}