jdk/src/share/classes/java/lang/Character.java
author martin
Mon, 10 Mar 2008 14:32:51 -0700
changeset 48 dc5744ca15ea
parent 2 90ce3da70b43
child 2497 903fd9d785ef
permissions -rw-r--r--
4960438: (process) Need IO redirection API for subprocesses Reviewed-by: alanb, iris
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
 * Copyright 2002-2006 Sun Microsystems, Inc.  All Rights Reserved.
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>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * Character information is based on the Unicode Standard, version 4.0.
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
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
    public static final char   MAX_VALUE = '\uffff';
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
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   521
     * The minimum value of a Unicode high-surrogate code unit in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   522
     * UTF-16 encoding. A high-surrogate is also known as a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   523
     * <i>leading-surrogate</i>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   524
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   525
     * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
   526
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   527
    public static final char MIN_HIGH_SURROGATE = '\uD800';
90ce3da70b43 Initial load
duke
parents:
diff changeset
   528
90ce3da70b43 Initial load
duke
parents:
diff changeset
   529
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   530
     * The maximum value of a Unicode high-surrogate code unit in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   531
     * UTF-16 encoding. A high-surrogate is also known as a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   532
     * <i>leading-surrogate</i>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   533
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   534
     * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
   535
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   536
    public static final char MAX_HIGH_SURROGATE = '\uDBFF';
90ce3da70b43 Initial load
duke
parents:
diff changeset
   537
90ce3da70b43 Initial load
duke
parents:
diff changeset
   538
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   539
     * The minimum value of a Unicode low-surrogate code unit in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   540
     * UTF-16 encoding. A low-surrogate is also known as a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   541
     * <i>trailing-surrogate</i>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   542
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   543
     * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
   544
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   545
    public static final char MIN_LOW_SURROGATE  = '\uDC00';
90ce3da70b43 Initial load
duke
parents:
diff changeset
   546
90ce3da70b43 Initial load
duke
parents:
diff changeset
   547
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   548
     * The maximum value of a Unicode low-surrogate code unit in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   549
     * UTF-16 encoding. A low-surrogate is also known as a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   550
     * <i>trailing-surrogate</i>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   551
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   552
     * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
   553
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   554
    public static final char MAX_LOW_SURROGATE  = '\uDFFF';
90ce3da70b43 Initial load
duke
parents:
diff changeset
   555
90ce3da70b43 Initial load
duke
parents:
diff changeset
   556
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   557
     * The minimum value of a Unicode surrogate code unit in the UTF-16 encoding.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   558
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   559
     * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
   560
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   561
    public static final char MIN_SURROGATE = MIN_HIGH_SURROGATE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   562
90ce3da70b43 Initial load
duke
parents:
diff changeset
   563
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   564
     * The maximum value of a Unicode surrogate code unit in the UTF-16 encoding.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   565
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   566
     * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
   567
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   568
    public static final char MAX_SURROGATE = MAX_LOW_SURROGATE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   569
90ce3da70b43 Initial load
duke
parents:
diff changeset
   570
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   571
     * The minimum value of a supplementary code point.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   572
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   573
     * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
   574
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   575
    public static final int MIN_SUPPLEMENTARY_CODE_POINT = 0x010000;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   576
90ce3da70b43 Initial load
duke
parents:
diff changeset
   577
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   578
     * The minimum value of a Unicode code point.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   579
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   580
     * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
   581
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   582
    public static final int MIN_CODE_POINT = 0x000000;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   583
90ce3da70b43 Initial load
duke
parents:
diff changeset
   584
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   585
     * The maximum value of a Unicode code point.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   586
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   587
     * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
   588
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   589
    public static final int MAX_CODE_POINT = 0x10ffff;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   590
90ce3da70b43 Initial load
duke
parents:
diff changeset
   591
90ce3da70b43 Initial load
duke
parents:
diff changeset
   592
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   593
     * Instances of this class represent particular subsets of the Unicode
90ce3da70b43 Initial load
duke
parents:
diff changeset
   594
     * character set.  The only family of subsets defined in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   595
     * <code>Character</code> class is <code>{@link Character.UnicodeBlock
90ce3da70b43 Initial load
duke
parents:
diff changeset
   596
     * UnicodeBlock}</code>.  Other portions of the Java API may define other
90ce3da70b43 Initial load
duke
parents:
diff changeset
   597
     * subsets for their own purposes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   598
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   599
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   600
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   601
    public static class Subset  {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   602
90ce3da70b43 Initial load
duke
parents:
diff changeset
   603
        private String name;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   604
90ce3da70b43 Initial load
duke
parents:
diff changeset
   605
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   606
         * Constructs a new <code>Subset</code> instance.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   607
         *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   608
         * @exception NullPointerException if name is <code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   609
         * @param  name  The name of this subset
90ce3da70b43 Initial load
duke
parents:
diff changeset
   610
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   611
        protected Subset(String name) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   612
            if (name == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   613
                throw new NullPointerException("name");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   614
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   615
            this.name = name;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   616
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   617
90ce3da70b43 Initial load
duke
parents:
diff changeset
   618
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   619
         * Compares two <code>Subset</code> objects for equality.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   620
         * This method returns <code>true</code> if and only if
90ce3da70b43 Initial load
duke
parents:
diff changeset
   621
         * <code>this</code> and the argument refer to the same
90ce3da70b43 Initial load
duke
parents:
diff changeset
   622
         * object; since this method is <code>final</code>, this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   623
         * guarantee holds for all subclasses.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   624
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   625
        public final boolean equals(Object obj) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   626
            return (this == obj);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   627
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   628
90ce3da70b43 Initial load
duke
parents:
diff changeset
   629
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   630
         * Returns the standard hash code as defined by the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   631
         * <code>{@link Object#hashCode}</code> method.  This method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   632
         * is <code>final</code> in order to ensure that the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   633
         * <code>equals</code> and <code>hashCode</code> methods will
90ce3da70b43 Initial load
duke
parents:
diff changeset
   634
         * be consistent in all subclasses.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   635
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   636
        public final int hashCode() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   637
            return super.hashCode();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   638
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   639
90ce3da70b43 Initial load
duke
parents:
diff changeset
   640
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   641
         * Returns the name of this subset.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   642
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   643
        public final String toString() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   644
            return name;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   645
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   646
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   647
90ce3da70b43 Initial load
duke
parents:
diff changeset
   648
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   649
     * A family of character subsets representing the character blocks in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   650
     * Unicode specification. Character blocks generally define characters
90ce3da70b43 Initial load
duke
parents:
diff changeset
   651
     * used for a specific script or purpose. A character is contained by
90ce3da70b43 Initial load
duke
parents:
diff changeset
   652
     * at most one Unicode block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   653
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   654
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   655
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   656
    public static final class UnicodeBlock extends Subset {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   657
90ce3da70b43 Initial load
duke
parents:
diff changeset
   658
        private static Map map = new HashMap();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   659
90ce3da70b43 Initial load
duke
parents:
diff changeset
   660
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   661
         * Create a UnicodeBlock with the given identifier name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   662
         * This name must be the same as the block identifier.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   663
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   664
        private UnicodeBlock(String idName) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   665
            super(idName);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   666
            map.put(idName.toUpperCase(Locale.US), this);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   667
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   668
90ce3da70b43 Initial load
duke
parents:
diff changeset
   669
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   670
         * Create a UnicodeBlock with the given identifier name and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   671
         * alias name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   672
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   673
        private UnicodeBlock(String idName, String alias) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   674
            this(idName);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   675
            map.put(alias.toUpperCase(Locale.US), this);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   676
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   677
90ce3da70b43 Initial load
duke
parents:
diff changeset
   678
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   679
         * Create a UnicodeBlock with the given identifier name and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   680
         * alias names.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   681
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   682
        private UnicodeBlock(String idName, String[] aliasName) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   683
            this(idName);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   684
            if (aliasName != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   685
                for(int x=0; x<aliasName.length; ++x) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   686
                    map.put(aliasName[x].toUpperCase(Locale.US), this);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   687
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   688
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   689
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   690
90ce3da70b43 Initial load
duke
parents:
diff changeset
   691
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   692
         * Constant for the "Basic Latin" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   693
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   694
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   695
        public static final UnicodeBlock  BASIC_LATIN =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   696
            new UnicodeBlock("BASIC_LATIN", new String[] {"Basic Latin", "BasicLatin" });
90ce3da70b43 Initial load
duke
parents:
diff changeset
   697
90ce3da70b43 Initial load
duke
parents:
diff changeset
   698
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   699
         * Constant for the "Latin-1 Supplement" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   700
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   701
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   702
        public static final UnicodeBlock LATIN_1_SUPPLEMENT =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   703
            new UnicodeBlock("LATIN_1_SUPPLEMENT", new String[]{ "Latin-1 Supplement", "Latin-1Supplement"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
   704
90ce3da70b43 Initial load
duke
parents:
diff changeset
   705
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   706
         * Constant for the "Latin Extended-A" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   707
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   708
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   709
        public static final UnicodeBlock LATIN_EXTENDED_A =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   710
            new UnicodeBlock("LATIN_EXTENDED_A", new String[]{ "Latin Extended-A", "LatinExtended-A"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
   711
90ce3da70b43 Initial load
duke
parents:
diff changeset
   712
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   713
         * Constant for the "Latin Extended-B" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   714
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   715
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   716
        public static final UnicodeBlock LATIN_EXTENDED_B =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   717
            new UnicodeBlock("LATIN_EXTENDED_B", new String[] {"Latin Extended-B", "LatinExtended-B"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
   718
90ce3da70b43 Initial load
duke
parents:
diff changeset
   719
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   720
         * Constant for the "IPA Extensions" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   721
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   722
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   723
        public static final UnicodeBlock IPA_EXTENSIONS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   724
            new UnicodeBlock("IPA_EXTENSIONS", new String[] {"IPA Extensions", "IPAExtensions"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
   725
90ce3da70b43 Initial load
duke
parents:
diff changeset
   726
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   727
         * Constant for the "Spacing Modifier Letters" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   728
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   729
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   730
        public static final UnicodeBlock SPACING_MODIFIER_LETTERS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   731
            new UnicodeBlock("SPACING_MODIFIER_LETTERS", new String[] { "Spacing Modifier Letters",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   732
                                                                        "SpacingModifierLetters"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
   733
90ce3da70b43 Initial load
duke
parents:
diff changeset
   734
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   735
         * Constant for the "Combining Diacritical Marks" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   736
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   737
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   738
        public static final UnicodeBlock COMBINING_DIACRITICAL_MARKS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   739
            new UnicodeBlock("COMBINING_DIACRITICAL_MARKS", new String[] {"Combining Diacritical Marks",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   740
                                                                          "CombiningDiacriticalMarks" });
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 "Greek and Coptic" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   744
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   745
         * This block was previously known as the "Greek" block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   746
         *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   747
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   748
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   749
        public static final UnicodeBlock GREEK
90ce3da70b43 Initial load
duke
parents:
diff changeset
   750
            = new UnicodeBlock("GREEK", new String[] {"Greek and Coptic", "GreekandCoptic"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
   751
90ce3da70b43 Initial load
duke
parents:
diff changeset
   752
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   753
         * Constant for the "Cyrillic" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   754
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   755
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   756
        public static final UnicodeBlock CYRILLIC =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   757
            new UnicodeBlock("CYRILLIC");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   758
90ce3da70b43 Initial load
duke
parents:
diff changeset
   759
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   760
         * Constant for the "Armenian" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   761
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   762
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   763
        public static final UnicodeBlock ARMENIAN =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   764
            new UnicodeBlock("ARMENIAN");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   765
90ce3da70b43 Initial load
duke
parents:
diff changeset
   766
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   767
         * Constant for the "Hebrew" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   768
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   769
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   770
        public static final UnicodeBlock HEBREW =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   771
            new UnicodeBlock("HEBREW");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   772
90ce3da70b43 Initial load
duke
parents:
diff changeset
   773
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   774
         * Constant for the "Arabic" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   775
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   776
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   777
        public static final UnicodeBlock ARABIC =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   778
            new UnicodeBlock("ARABIC");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   779
90ce3da70b43 Initial load
duke
parents:
diff changeset
   780
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   781
         * Constant for the "Devanagari" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   782
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   783
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   784
        public static final UnicodeBlock DEVANAGARI =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   785
            new UnicodeBlock("DEVANAGARI");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   786
90ce3da70b43 Initial load
duke
parents:
diff changeset
   787
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   788
         * Constant for the "Bengali" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   789
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   790
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   791
        public static final UnicodeBlock BENGALI =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   792
            new UnicodeBlock("BENGALI");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   793
90ce3da70b43 Initial load
duke
parents:
diff changeset
   794
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   795
         * Constant for the "Gurmukhi" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   796
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   797
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   798
        public static final UnicodeBlock GURMUKHI =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   799
            new UnicodeBlock("GURMUKHI");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   800
90ce3da70b43 Initial load
duke
parents:
diff changeset
   801
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   802
         * Constant for the "Gujarati" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   803
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   804
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   805
        public static final UnicodeBlock GUJARATI =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   806
            new UnicodeBlock("GUJARATI");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   807
90ce3da70b43 Initial load
duke
parents:
diff changeset
   808
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   809
         * Constant for the "Oriya" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   810
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   811
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   812
        public static final UnicodeBlock ORIYA =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   813
            new UnicodeBlock("ORIYA");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   814
90ce3da70b43 Initial load
duke
parents:
diff changeset
   815
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   816
         * Constant for the "Tamil" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   817
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   818
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   819
        public static final UnicodeBlock TAMIL =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   820
            new UnicodeBlock("TAMIL");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   821
90ce3da70b43 Initial load
duke
parents:
diff changeset
   822
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   823
         * Constant for the "Telugu" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   824
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   825
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   826
        public static final UnicodeBlock TELUGU =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   827
            new UnicodeBlock("TELUGU");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   828
90ce3da70b43 Initial load
duke
parents:
diff changeset
   829
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   830
         * Constant for the "Kannada" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   831
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   832
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   833
        public static final UnicodeBlock KANNADA =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   834
            new UnicodeBlock("KANNADA");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   835
90ce3da70b43 Initial load
duke
parents:
diff changeset
   836
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   837
         * Constant for the "Malayalam" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   838
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   839
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   840
        public static final UnicodeBlock MALAYALAM =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   841
            new UnicodeBlock("MALAYALAM");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   842
90ce3da70b43 Initial load
duke
parents:
diff changeset
   843
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   844
         * Constant for the "Thai" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   845
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   846
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   847
        public static final UnicodeBlock THAI =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   848
            new UnicodeBlock("THAI");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   849
90ce3da70b43 Initial load
duke
parents:
diff changeset
   850
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   851
         * Constant for the "Lao" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   852
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   853
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   854
        public static final UnicodeBlock LAO =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   855
            new UnicodeBlock("LAO");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   856
90ce3da70b43 Initial load
duke
parents:
diff changeset
   857
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   858
         * Constant for the "Tibetan" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   859
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   860
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   861
        public static final UnicodeBlock TIBETAN =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   862
            new UnicodeBlock("TIBETAN");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   863
90ce3da70b43 Initial load
duke
parents:
diff changeset
   864
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   865
         * Constant for the "Georgian" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   866
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   867
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   868
        public static final UnicodeBlock GEORGIAN =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   869
            new UnicodeBlock("GEORGIAN");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   870
90ce3da70b43 Initial load
duke
parents:
diff changeset
   871
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   872
         * Constant for the "Hangul Jamo" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   873
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   874
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   875
        public static final UnicodeBlock HANGUL_JAMO =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   876
            new UnicodeBlock("HANGUL_JAMO", new String[] {"Hangul Jamo", "HangulJamo"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
   877
90ce3da70b43 Initial load
duke
parents:
diff changeset
   878
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   879
         * Constant for the "Latin Extended Additional" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   880
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   881
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   882
        public static final UnicodeBlock LATIN_EXTENDED_ADDITIONAL =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   883
            new UnicodeBlock("LATIN_EXTENDED_ADDITIONAL", new String[] {"Latin Extended Additional",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   884
                                                                        "LatinExtendedAdditional"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
   885
90ce3da70b43 Initial load
duke
parents:
diff changeset
   886
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   887
         * Constant for the "Greek Extended" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   888
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   889
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   890
        public static final UnicodeBlock GREEK_EXTENDED =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   891
            new UnicodeBlock("GREEK_EXTENDED", new String[] {"Greek Extended", "GreekExtended"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
   892
90ce3da70b43 Initial load
duke
parents:
diff changeset
   893
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   894
         * Constant for the "General Punctuation" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   895
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   896
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   897
        public static final UnicodeBlock GENERAL_PUNCTUATION =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   898
            new UnicodeBlock("GENERAL_PUNCTUATION", new String[] {"General Punctuation", "GeneralPunctuation"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
   899
90ce3da70b43 Initial load
duke
parents:
diff changeset
   900
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   901
         * Constant for the "Superscripts and Subscripts" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   902
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   903
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   904
        public static final UnicodeBlock SUPERSCRIPTS_AND_SUBSCRIPTS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   905
            new UnicodeBlock("SUPERSCRIPTS_AND_SUBSCRIPTS", new String[] {"Superscripts and Subscripts",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   906
                                                                          "SuperscriptsandSubscripts" });
90ce3da70b43 Initial load
duke
parents:
diff changeset
   907
90ce3da70b43 Initial load
duke
parents:
diff changeset
   908
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   909
         * Constant for the "Currency Symbols" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   910
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   911
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   912
        public static final UnicodeBlock CURRENCY_SYMBOLS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   913
            new UnicodeBlock("CURRENCY_SYMBOLS", new String[] { "Currency Symbols", "CurrencySymbols"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
   914
90ce3da70b43 Initial load
duke
parents:
diff changeset
   915
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   916
         * Constant for the "Combining Diacritical Marks for Symbols" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   917
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   918
         * This block was previously known as "Combining Marks for Symbols".
90ce3da70b43 Initial load
duke
parents:
diff changeset
   919
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   920
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   921
        public static final UnicodeBlock COMBINING_MARKS_FOR_SYMBOLS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   922
            new UnicodeBlock("COMBINING_MARKS_FOR_SYMBOLS", new String[] {"Combining Diacritical Marks for Symbols",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   923
                                                                                                                                                  "CombiningDiacriticalMarksforSymbols",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   924
                                                                          "Combining Marks for Symbols",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   925
                                                                          "CombiningMarksforSymbols" });
90ce3da70b43 Initial load
duke
parents:
diff changeset
   926
90ce3da70b43 Initial load
duke
parents:
diff changeset
   927
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   928
         * Constant for the "Letterlike Symbols" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   929
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   930
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   931
        public static final UnicodeBlock LETTERLIKE_SYMBOLS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   932
            new UnicodeBlock("LETTERLIKE_SYMBOLS", new String[] { "Letterlike Symbols", "LetterlikeSymbols"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
   933
90ce3da70b43 Initial load
duke
parents:
diff changeset
   934
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   935
         * Constant for the "Number Forms" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   936
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   937
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   938
        public static final UnicodeBlock NUMBER_FORMS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   939
            new UnicodeBlock("NUMBER_FORMS", new String[] {"Number Forms", "NumberForms"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
   940
90ce3da70b43 Initial load
duke
parents:
diff changeset
   941
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   942
         * Constant for the "Arrows" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   943
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   944
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   945
        public static final UnicodeBlock ARROWS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   946
            new UnicodeBlock("ARROWS");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   947
90ce3da70b43 Initial load
duke
parents:
diff changeset
   948
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   949
         * Constant for the "Mathematical Operators" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   950
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   951
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   952
        public static final UnicodeBlock MATHEMATICAL_OPERATORS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   953
            new UnicodeBlock("MATHEMATICAL_OPERATORS", new String[] {"Mathematical Operators",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   954
                                                                     "MathematicalOperators"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
   955
90ce3da70b43 Initial load
duke
parents:
diff changeset
   956
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   957
         * Constant for the "Miscellaneous Technical" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   958
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   959
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   960
        public static final UnicodeBlock MISCELLANEOUS_TECHNICAL =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   961
            new UnicodeBlock("MISCELLANEOUS_TECHNICAL", new String[] {"Miscellaneous Technical",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   962
                                                                      "MiscellaneousTechnical"});
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 "Control Pictures" 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 CONTROL_PICTURES =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   969
            new UnicodeBlock("CONTROL_PICTURES", new String[] {"Control Pictures", "ControlPictures"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
   970
90ce3da70b43 Initial load
duke
parents:
diff changeset
   971
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   972
         * Constant for the "Optical Character Recognition" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   973
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   974
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   975
        public static final UnicodeBlock OPTICAL_CHARACTER_RECOGNITION =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   976
            new UnicodeBlock("OPTICAL_CHARACTER_RECOGNITION", new String[] {"Optical Character Recognition",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   977
                                                                            "OpticalCharacterRecognition"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
   978
90ce3da70b43 Initial load
duke
parents:
diff changeset
   979
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   980
         * Constant for the "Enclosed Alphanumerics" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   981
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   982
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   983
        public static final UnicodeBlock ENCLOSED_ALPHANUMERICS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   984
            new UnicodeBlock("ENCLOSED_ALPHANUMERICS", new String[] {"Enclosed Alphanumerics",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   985
                                                                     "EnclosedAlphanumerics"});
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 "Box Drawing" 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 BOX_DRAWING =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   992
            new UnicodeBlock("BOX_DRAWING", new String[] {"Box Drawing", "BoxDrawing"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
   993
90ce3da70b43 Initial load
duke
parents:
diff changeset
   994
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   995
         * Constant for the "Block Elements" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   996
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   997
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   998
        public static final UnicodeBlock BLOCK_ELEMENTS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   999
            new UnicodeBlock("BLOCK_ELEMENTS", new String[] {"Block Elements", "BlockElements"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1000
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1001
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1002
         * Constant for the "Geometric Shapes" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1003
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1004
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1005
        public static final UnicodeBlock GEOMETRIC_SHAPES =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1006
            new UnicodeBlock("GEOMETRIC_SHAPES", new String[] {"Geometric Shapes", "GeometricShapes"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1007
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1008
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1009
         * Constant for the "Miscellaneous Symbols" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1010
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1011
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1012
        public static final UnicodeBlock MISCELLANEOUS_SYMBOLS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1013
            new UnicodeBlock("MISCELLANEOUS_SYMBOLS", new String[] {"Miscellaneous Symbols",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1014
                                                                    "MiscellaneousSymbols"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1015
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1016
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1017
         * Constant for the "Dingbats" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1018
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1019
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1020
        public static final UnicodeBlock DINGBATS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1021
            new UnicodeBlock("DINGBATS");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1022
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1023
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1024
         * Constant for the "CJK Symbols and Punctuation" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1025
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1026
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1027
        public static final UnicodeBlock CJK_SYMBOLS_AND_PUNCTUATION =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1028
            new UnicodeBlock("CJK_SYMBOLS_AND_PUNCTUATION", new String[] {"CJK Symbols and Punctuation",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1029
                                                                          "CJKSymbolsandPunctuation"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1030
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1031
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1032
         * Constant for the "Hiragana" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1033
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1034
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1035
        public static final UnicodeBlock HIRAGANA =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1036
            new UnicodeBlock("HIRAGANA");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1037
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1038
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1039
         * Constant for the "Katakana" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1040
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1041
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1042
        public static final UnicodeBlock KATAKANA =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1043
            new UnicodeBlock("KATAKANA");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1044
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1045
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1046
         * Constant for the "Bopomofo" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1047
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1048
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1049
        public static final UnicodeBlock BOPOMOFO =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1050
            new UnicodeBlock("BOPOMOFO");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1051
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1052
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1053
         * Constant for the "Hangul Compatibility Jamo" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1054
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1055
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1056
        public static final UnicodeBlock HANGUL_COMPATIBILITY_JAMO =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1057
            new UnicodeBlock("HANGUL_COMPATIBILITY_JAMO", new String[] {"Hangul Compatibility Jamo",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1058
                                                                        "HangulCompatibilityJamo"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1059
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1060
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1061
         * Constant for the "Kanbun" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1062
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1063
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1064
        public static final UnicodeBlock KANBUN =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1065
            new UnicodeBlock("KANBUN");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1066
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1067
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1068
         * Constant for the "Enclosed CJK Letters and Months" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1069
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1070
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1071
        public static final UnicodeBlock ENCLOSED_CJK_LETTERS_AND_MONTHS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1072
            new UnicodeBlock("ENCLOSED_CJK_LETTERS_AND_MONTHS", new String[] {"Enclosed CJK Letters and Months",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1073
                                                                              "EnclosedCJKLettersandMonths"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1074
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1075
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1076
         * Constant for the "CJK Compatibility" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1077
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1078
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1079
        public static final UnicodeBlock CJK_COMPATIBILITY =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1080
            new UnicodeBlock("CJK_COMPATIBILITY", new String[] {"CJK Compatibility", "CJKCompatibility"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1081
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1082
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1083
         * Constant for the "CJK Unified Ideographs" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1084
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1085
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1086
        public static final UnicodeBlock CJK_UNIFIED_IDEOGRAPHS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1087
            new UnicodeBlock("CJK_UNIFIED_IDEOGRAPHS", new String[] {"CJK Unified Ideographs",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1088
                                                                     "CJKUnifiedIdeographs"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1089
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1090
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1091
         * Constant for the "Hangul Syllables" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1092
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1093
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1094
        public static final UnicodeBlock HANGUL_SYLLABLES =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1095
            new UnicodeBlock("HANGUL_SYLLABLES", new String[] {"Hangul Syllables", "HangulSyllables"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1096
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1097
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1098
         * Constant for the "Private Use Area" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1099
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1100
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1101
        public static final UnicodeBlock PRIVATE_USE_AREA =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1102
            new UnicodeBlock("PRIVATE_USE_AREA", new String[] {"Private Use Area", "PrivateUseArea"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1103
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1104
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1105
         * Constant for the "CJK Compatibility Ideographs" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1106
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1107
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1108
        public static final UnicodeBlock CJK_COMPATIBILITY_IDEOGRAPHS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1109
            new UnicodeBlock("CJK_COMPATIBILITY_IDEOGRAPHS",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1110
                             new String[] {"CJK Compatibility Ideographs",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1111
                                           "CJKCompatibilityIdeographs"});
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 "Alphabetic Presentation Forms" 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 ALPHABETIC_PRESENTATION_FORMS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1118
            new UnicodeBlock("ALPHABETIC_PRESENTATION_FORMS", new String[] {"Alphabetic Presentation Forms",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1119
                                                                            "AlphabeticPresentationForms"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1120
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1121
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1122
         * Constant for the "Arabic Presentation Forms-A" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1123
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1124
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1125
        public static final UnicodeBlock ARABIC_PRESENTATION_FORMS_A =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1126
            new UnicodeBlock("ARABIC_PRESENTATION_FORMS_A", new String[] {"Arabic Presentation Forms-A",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1127
                                                                          "ArabicPresentationForms-A"});
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 "Combining Half Marks" 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 COMBINING_HALF_MARKS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1134
            new UnicodeBlock("COMBINING_HALF_MARKS", new String[] {"Combining Half Marks",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1135
                                                                   "CombiningHalfMarks"});
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 "CJK Compatibility Forms" 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 CJK_COMPATIBILITY_FORMS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1142
            new UnicodeBlock("CJK_COMPATIBILITY_FORMS", new String[] {"CJK Compatibility Forms",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1143
                                                                      "CJKCompatibilityForms"});
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 "Small Form Variants" 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 SMALL_FORM_VARIANTS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1150
            new UnicodeBlock("SMALL_FORM_VARIANTS", new String[] {"Small Form Variants",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1151
                                                                  "SmallFormVariants"});
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 "Arabic Presentation Forms-B" 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 ARABIC_PRESENTATION_FORMS_B =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1158
            new UnicodeBlock("ARABIC_PRESENTATION_FORMS_B", new String[] {"Arabic Presentation Forms-B",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1159
                                                                          "ArabicPresentationForms-B"});
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 "Halfwidth and Fullwidth Forms" 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 HALFWIDTH_AND_FULLWIDTH_FORMS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1166
            new UnicodeBlock("HALFWIDTH_AND_FULLWIDTH_FORMS",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1167
                             new String[] {"Halfwidth and Fullwidth Forms",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1168
                                           "HalfwidthandFullwidthForms"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1169
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1170
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1171
         * Constant for the "Specials" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1172
         * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1173
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1174
        public static final UnicodeBlock SPECIALS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1175
            new UnicodeBlock("SPECIALS");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1176
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1177
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1178
         * @deprecated As of J2SE 5, use {@link #HIGH_SURROGATES},
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1179
         *             {@link #HIGH_PRIVATE_USE_SURROGATES}, and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1180
         *             {@link #LOW_SURROGATES}. These new constants match
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1181
         *             the block definitions of the Unicode Standard.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1182
         *             The {@link #of(char)} and {@link #of(int)} methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1183
         *             return the new constants, not SURROGATES_AREA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1184
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1185
        @Deprecated
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1186
        public static final UnicodeBlock SURROGATES_AREA =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1187
            new UnicodeBlock("SURROGATES_AREA");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1188
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1189
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1190
         * Constant for the "Syriac" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1191
         * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1192
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1193
        public static final UnicodeBlock SYRIAC =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1194
            new UnicodeBlock("SYRIAC");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1195
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1196
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1197
         * Constant for the "Thaana" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1198
         * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1199
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1200
        public static final UnicodeBlock THAANA =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1201
            new UnicodeBlock("THAANA");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1202
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1203
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1204
         * Constant for the "Sinhala" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1205
         * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1206
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1207
        public static final UnicodeBlock SINHALA =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1208
            new UnicodeBlock("SINHALA");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1209
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1210
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1211
         * Constant for the "Myanmar" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1212
         * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1213
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1214
        public static final UnicodeBlock MYANMAR =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1215
            new UnicodeBlock("MYANMAR");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1216
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1217
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1218
         * Constant for the "Ethiopic" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1219
         * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1220
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1221
        public static final UnicodeBlock ETHIOPIC =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1222
            new UnicodeBlock("ETHIOPIC");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1223
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1224
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1225
         * Constant for the "Cherokee" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1226
         * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1227
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1228
        public static final UnicodeBlock CHEROKEE =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1229
            new UnicodeBlock("CHEROKEE");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1230
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1231
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1232
         * Constant for the "Unified Canadian Aboriginal Syllabics" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1233
         * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1234
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1235
        public static final UnicodeBlock UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1236
            new UnicodeBlock("UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1237
                             new String[] {"Unified Canadian Aboriginal Syllabics",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1238
                                           "UnifiedCanadianAboriginalSyllabics"});
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 "Ogham" 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 OGHAM =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1245
                             new UnicodeBlock("OGHAM");
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 "Runic" 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 RUNIC =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1252
                             new UnicodeBlock("RUNIC");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1253
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1254
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1255
         * Constant for the "Khmer" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1256
         * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1257
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1258
        public static final UnicodeBlock KHMER =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1259
                             new UnicodeBlock("KHMER");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1260
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1261
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1262
         * Constant for the "Mongolian" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1263
         * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1264
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1265
        public static final UnicodeBlock MONGOLIAN =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1266
                             new UnicodeBlock("MONGOLIAN");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1267
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1268
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1269
         * Constant for the "Braille Patterns" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1270
         * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1271
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1272
        public static final UnicodeBlock BRAILLE_PATTERNS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1273
            new UnicodeBlock("BRAILLE_PATTERNS", new String[] {"Braille Patterns",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1274
                                                               "BraillePatterns"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1275
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1276
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1277
         * Constant for the "CJK Radicals Supplement" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1278
         * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1279
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1280
        public static final UnicodeBlock CJK_RADICALS_SUPPLEMENT =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1281
             new UnicodeBlock("CJK_RADICALS_SUPPLEMENT", new String[] {"CJK Radicals Supplement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1282
                                                                       "CJKRadicalsSupplement"});
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 "Kangxi Radicals" 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 KANGXI_RADICALS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1289
            new UnicodeBlock("KANGXI_RADICALS", new String[] {"Kangxi Radicals", "KangxiRadicals"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1290
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1291
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1292
         * Constant for the "Ideographic Description Characters" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1293
         * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1294
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1295
        public static final UnicodeBlock IDEOGRAPHIC_DESCRIPTION_CHARACTERS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1296
            new UnicodeBlock("IDEOGRAPHIC_DESCRIPTION_CHARACTERS", new String[] {"Ideographic Description Characters",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1297
                                                                                 "IdeographicDescriptionCharacters"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1298
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1299
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1300
         * Constant for the "Bopomofo Extended" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1301
         * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1302
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1303
        public static final UnicodeBlock BOPOMOFO_EXTENDED =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1304
            new UnicodeBlock("BOPOMOFO_EXTENDED", new String[] {"Bopomofo Extended",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1305
                                                                "BopomofoExtended"});
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 "CJK Unified Ideographs Extension A" 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 CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1312
            new UnicodeBlock("CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A", new String[] {"CJK Unified Ideographs Extension A",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1313
                                                                                 "CJKUnifiedIdeographsExtensionA"});
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 "Yi Syllables" 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 YI_SYLLABLES =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1320
            new UnicodeBlock("YI_SYLLABLES", new String[] {"Yi Syllables", "YiSyllables"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1321
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1322
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1323
         * Constant for the "Yi Radicals" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1324
         * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1325
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1326
        public static final UnicodeBlock YI_RADICALS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1327
            new UnicodeBlock("YI_RADICALS", new String[] {"Yi Radicals", "YiRadicals"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1328
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1329
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1330
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1331
         * Constant for the "Cyrillic Supplementary" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1332
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1333
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1334
        public static final UnicodeBlock CYRILLIC_SUPPLEMENTARY =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1335
            new UnicodeBlock("CYRILLIC_SUPPLEMENTARY", new String[] {"Cyrillic Supplementary",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1336
                                                                     "CyrillicSupplementary"});
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 "Tagalog" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1340
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1341
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1342
        public static final UnicodeBlock TAGALOG =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1343
            new UnicodeBlock("TAGALOG");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1344
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1345
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1346
         * Constant for the "Hanunoo" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1347
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1348
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1349
        public static final UnicodeBlock HANUNOO =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1350
            new UnicodeBlock("HANUNOO");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1351
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1352
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1353
         * Constant for the "Buhid" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1354
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1355
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1356
        public static final UnicodeBlock BUHID =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1357
            new UnicodeBlock("BUHID");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1358
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1359
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1360
         * Constant for the "Tagbanwa" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1361
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1362
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1363
        public static final UnicodeBlock TAGBANWA =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1364
            new UnicodeBlock("TAGBANWA");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1365
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1366
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1367
         * Constant for the "Limbu" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1368
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1369
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1370
        public static final UnicodeBlock LIMBU =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1371
            new UnicodeBlock("LIMBU");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1372
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1373
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1374
         * Constant for the "Tai Le" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1375
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1376
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1377
        public static final UnicodeBlock TAI_LE =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1378
            new UnicodeBlock("TAI_LE", new String[] {"Tai Le", "TaiLe"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1379
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1380
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1381
         * Constant for the "Khmer Symbols" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1382
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1383
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1384
        public static final UnicodeBlock KHMER_SYMBOLS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1385
            new UnicodeBlock("KHMER_SYMBOLS", new String[] {"Khmer Symbols", "KhmerSymbols"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1386
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1387
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1388
         * Constant for the "Phonetic Extensions" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1389
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1390
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1391
        public static final UnicodeBlock PHONETIC_EXTENSIONS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1392
            new UnicodeBlock("PHONETIC_EXTENSIONS", new String[] {"Phonetic Extensions", "PhoneticExtensions"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1393
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1394
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1395
         * Constant for the "Miscellaneous Mathematical Symbols-A" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1396
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1397
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1398
        public static final UnicodeBlock MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1399
            new UnicodeBlock("MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1400
                             new String[]{"Miscellaneous Mathematical Symbols-A",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1401
                                          "MiscellaneousMathematicalSymbols-A"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1402
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1403
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1404
         * Constant for the "Supplemental Arrows-A" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1405
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1406
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1407
        public static final UnicodeBlock SUPPLEMENTAL_ARROWS_A =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1408
            new UnicodeBlock("SUPPLEMENTAL_ARROWS_A", new String[] {"Supplemental Arrows-A",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1409
                                                                    "SupplementalArrows-A"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1410
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1411
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1412
         * Constant for the "Supplemental Arrows-B" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1413
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1414
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1415
        public static final UnicodeBlock SUPPLEMENTAL_ARROWS_B =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1416
            new UnicodeBlock("SUPPLEMENTAL_ARROWS_B", new String[] {"Supplemental Arrows-B",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1417
                                                                    "SupplementalArrows-B"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1418
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1419
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1420
         * Constant for the "Miscellaneous Mathematical Symbols-B" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1421
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1422
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1423
        public static final UnicodeBlock MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1424
                = new UnicodeBlock("MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1425
                                   new String[] {"Miscellaneous Mathematical Symbols-B",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1426
                                                 "MiscellaneousMathematicalSymbols-B"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1427
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1428
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1429
         * Constant for the "Supplemental Mathematical Operators" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1430
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1431
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1432
        public static final UnicodeBlock SUPPLEMENTAL_MATHEMATICAL_OPERATORS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1433
            new UnicodeBlock("SUPPLEMENTAL_MATHEMATICAL_OPERATORS",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1434
                             new String[]{"Supplemental Mathematical Operators",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1435
                                          "SupplementalMathematicalOperators"} );
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1436
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1437
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1438
         * Constant for the "Miscellaneous Symbols and Arrows" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1439
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1440
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1441
        public static final UnicodeBlock MISCELLANEOUS_SYMBOLS_AND_ARROWS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1442
            new UnicodeBlock("MISCELLANEOUS_SYMBOLS_AND_ARROWS", new String[] {"Miscellaneous Symbols and Arrows",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1443
                                                                               "MiscellaneousSymbolsandArrows"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1444
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1445
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1446
         * Constant for the "Katakana Phonetic Extensions" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1447
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1448
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1449
        public static final UnicodeBlock KATAKANA_PHONETIC_EXTENSIONS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1450
            new UnicodeBlock("KATAKANA_PHONETIC_EXTENSIONS", new String[] {"Katakana Phonetic Extensions",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1451
                                                                           "KatakanaPhoneticExtensions"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1452
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1453
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1454
         * Constant for the "Yijing Hexagram Symbols" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1455
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1456
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1457
        public static final UnicodeBlock YIJING_HEXAGRAM_SYMBOLS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1458
            new UnicodeBlock("YIJING_HEXAGRAM_SYMBOLS", new String[] {"Yijing Hexagram Symbols",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1459
                                                                      "YijingHexagramSymbols"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1460
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1461
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1462
         * Constant for the "Variation Selectors" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1463
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1464
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1465
        public static final UnicodeBlock VARIATION_SELECTORS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1466
            new UnicodeBlock("VARIATION_SELECTORS", new String[] {"Variation Selectors", "VariationSelectors"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1467
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1468
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1469
         * Constant for the "Linear B Syllabary" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1470
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1471
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1472
        public static final UnicodeBlock LINEAR_B_SYLLABARY =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1473
            new UnicodeBlock("LINEAR_B_SYLLABARY", new String[] {"Linear B Syllabary", "LinearBSyllabary"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1474
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1475
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1476
         * Constant for the "Linear B Ideograms" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1477
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1478
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1479
        public static final UnicodeBlock LINEAR_B_IDEOGRAMS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1480
            new UnicodeBlock("LINEAR_B_IDEOGRAMS", new String[] {"Linear B Ideograms", "LinearBIdeograms"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1481
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1482
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1483
         * Constant for the "Aegean Numbers" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1484
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1485
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1486
        public static final UnicodeBlock AEGEAN_NUMBERS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1487
            new UnicodeBlock("AEGEAN_NUMBERS", new String[] {"Aegean Numbers", "AegeanNumbers"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1488
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1489
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1490
         * Constant for the "Old Italic" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1491
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1492
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1493
        public static final UnicodeBlock OLD_ITALIC =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1494
            new UnicodeBlock("OLD_ITALIC", new String[] {"Old Italic", "OldItalic"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1495
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1496
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1497
         * Constant for the "Gothic" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1498
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1499
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1500
        public static final UnicodeBlock GOTHIC = new UnicodeBlock("GOTHIC");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1501
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1502
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1503
         * Constant for the "Ugaritic" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1504
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1505
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1506
        public static final UnicodeBlock UGARITIC = new UnicodeBlock("UGARITIC");
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 "Deseret" 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 DESERET = new UnicodeBlock("DESERET");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1513
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1514
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1515
         * Constant for the "Shavian" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1516
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1517
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1518
        public static final UnicodeBlock SHAVIAN = new UnicodeBlock("SHAVIAN");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1519
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1520
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1521
         * Constant for the "Osmanya" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1522
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1523
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1524
        public static final UnicodeBlock OSMANYA = new UnicodeBlock("OSMANYA");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1525
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1526
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1527
         * Constant for the "Cypriot Syllabary" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1528
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1529
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1530
        public static final UnicodeBlock CYPRIOT_SYLLABARY =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1531
            new UnicodeBlock("CYPRIOT_SYLLABARY", new String[] {"Cypriot Syllabary", "CypriotSyllabary"});
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 "Byzantine Musical Symbols" 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 BYZANTINE_MUSICAL_SYMBOLS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1538
            new UnicodeBlock("BYZANTINE_MUSICAL_SYMBOLS", new String[] {"Byzantine Musical Symbols",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1539
                                                                        "ByzantineMusicalSymbols"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1540
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1541
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1542
         * Constant for the "Musical Symbols" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1543
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1544
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1545
        public static final UnicodeBlock MUSICAL_SYMBOLS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1546
            new UnicodeBlock("MUSICAL_SYMBOLS", new String[] {"Musical Symbols", "MusicalSymbols"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1547
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1548
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1549
         * Constant for the "Tai Xuan Jing Symbols" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1550
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1551
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1552
        public static final UnicodeBlock TAI_XUAN_JING_SYMBOLS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1553
            new UnicodeBlock("TAI_XUAN_JING_SYMBOLS", new String[] {"Tai Xuan Jing Symbols",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1554
                                                                     "TaiXuanJingSymbols"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1555
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1556
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1557
         * Constant for the "Mathematical Alphanumeric Symbols" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1558
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1559
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1560
        public static final UnicodeBlock MATHEMATICAL_ALPHANUMERIC_SYMBOLS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1561
            new UnicodeBlock("MATHEMATICAL_ALPHANUMERIC_SYMBOLS",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1562
                             new String[] {"Mathematical Alphanumeric Symbols", "MathematicalAlphanumericSymbols"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1563
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1564
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1565
         * Constant for the "CJK Unified Ideographs Extension B" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1566
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1567
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1568
        public static final UnicodeBlock CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1569
            new UnicodeBlock("CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1570
                             new String[] {"CJK Unified Ideographs Extension B", "CJKUnifiedIdeographsExtensionB"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1571
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1572
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1573
         * Constant for the "CJK Compatibility Ideographs Supplement" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1574
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1575
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1576
        public static final UnicodeBlock CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1577
            new UnicodeBlock("CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1578
                             new String[]{"CJK Compatibility Ideographs Supplement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1579
                                          "CJKCompatibilityIdeographsSupplement"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1580
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1581
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1582
         * Constant for the "Tags" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1583
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1584
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1585
        public static final UnicodeBlock TAGS = new UnicodeBlock("TAGS");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1586
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1587
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1588
         * Constant for the "Variation Selectors Supplement" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1589
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1590
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1591
        public static final UnicodeBlock VARIATION_SELECTORS_SUPPLEMENT =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1592
            new UnicodeBlock("VARIATION_SELECTORS_SUPPLEMENT", new String[] {"Variation Selectors Supplement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1593
                                                                             "VariationSelectorsSupplement"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1594
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1595
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1596
         * Constant for the "Supplementary Private Use Area-A" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1597
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1598
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1599
        public static final UnicodeBlock SUPPLEMENTARY_PRIVATE_USE_AREA_A =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1600
            new UnicodeBlock("SUPPLEMENTARY_PRIVATE_USE_AREA_A",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1601
                             new String[] {"Supplementary Private Use Area-A",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1602
                                           "SupplementaryPrivateUseArea-A"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1603
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1604
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1605
         * Constant for the "Supplementary Private Use Area-B" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1606
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1607
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1608
        public static final UnicodeBlock SUPPLEMENTARY_PRIVATE_USE_AREA_B =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1609
            new UnicodeBlock("SUPPLEMENTARY_PRIVATE_USE_AREA_B",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1610
                             new String[] {"Supplementary Private Use Area-B",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1611
                                           "SupplementaryPrivateUseArea-B"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1612
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1613
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1614
         * Constant for the "High Surrogates" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1615
         * This block represents codepoint values in the high surrogate
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1616
         * range: 0xD800 through 0xDB7F
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1617
         *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1618
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1619
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1620
        public static final UnicodeBlock HIGH_SURROGATES =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1621
            new UnicodeBlock("HIGH_SURROGATES", new String[] {"High Surrogates", "HighSurrogates"});
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 "High Private Use Surrogates" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1625
         * This block represents codepoint values in the high surrogate
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1626
         * range: 0xDB80 through 0xDBFF
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1627
         *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1628
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1629
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1630
        public static final UnicodeBlock HIGH_PRIVATE_USE_SURROGATES =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1631
            new UnicodeBlock("HIGH_PRIVATE_USE_SURROGATES", new String[] { "High Private Use Surrogates",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1632
                                                                           "HighPrivateUseSurrogates"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1633
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1634
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1635
         * Constant for the "Low Surrogates" Unicode character block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1636
         * This block represents codepoint values in the high surrogate
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1637
         * range: 0xDC00 through 0xDFFF
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1638
         *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1639
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1640
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1641
        public static final UnicodeBlock LOW_SURROGATES =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1642
            new UnicodeBlock("LOW_SURROGATES", new String[] {"Low Surrogates", "LowSurrogates"});
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1643
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1644
        private static final int blockStarts[] = {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1645
            0x0000, // Basic Latin
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1646
            0x0080, // Latin-1 Supplement
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1647
            0x0100, // Latin Extended-A
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1648
            0x0180, // Latin Extended-B
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1649
            0x0250, // IPA Extensions
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1650
            0x02B0, // Spacing Modifier Letters
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1651
            0x0300, // Combining Diacritical Marks
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1652
            0x0370, // Greek and Coptic
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1653
            0x0400, // Cyrillic
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1654
            0x0500, // Cyrillic Supplementary
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1655
            0x0530, // Armenian
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1656
            0x0590, // Hebrew
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1657
            0x0600, // Arabic
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1658
            0x0700, // Syriac
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1659
            0x0750, // unassigned
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1660
            0x0780, // Thaana
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1661
            0x07C0, // unassigned
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1662
            0x0900, // Devanagari
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1663
            0x0980, // Bengali
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1664
            0x0A00, // Gurmukhi
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1665
            0x0A80, // Gujarati
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1666
            0x0B00, // Oriya
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1667
            0x0B80, // Tamil
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1668
            0x0C00, // Telugu
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1669
            0x0C80, // Kannada
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1670
            0x0D00, // Malayalam
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1671
            0x0D80, // Sinhala
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1672
            0x0E00, // Thai
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1673
            0x0E80, // Lao
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1674
            0x0F00, // Tibetan
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1675
            0x1000, // Myanmar
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1676
            0x10A0, // Georgian
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1677
            0x1100, // Hangul Jamo
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1678
            0x1200, // Ethiopic
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1679
            0x1380, // unassigned
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1680
            0x13A0, // Cherokee
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1681
            0x1400, // Unified Canadian Aboriginal Syllabics
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1682
            0x1680, // Ogham
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1683
            0x16A0, // Runic
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1684
            0x1700, // Tagalog
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1685
            0x1720, // Hanunoo
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1686
            0x1740, // Buhid
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1687
            0x1760, // Tagbanwa
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1688
            0x1780, // Khmer
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1689
            0x1800, // Mongolian
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1690
            0x18B0, // unassigned
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1691
            0x1900, // Limbu
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1692
            0x1950, // Tai Le
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1693
            0x1980, // unassigned
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1694
            0x19E0, // Khmer Symbols
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1695
            0x1A00, // unassigned
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1696
            0x1D00, // Phonetic Extensions
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1697
            0x1D80, // unassigned
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1698
            0x1E00, // Latin Extended Additional
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1699
            0x1F00, // Greek Extended
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1700
            0x2000, // General Punctuation
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1701
            0x2070, // Superscripts and Subscripts
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1702
            0x20A0, // Currency Symbols
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1703
            0x20D0, // Combining Diacritical Marks for Symbols
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1704
            0x2100, // Letterlike Symbols
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1705
            0x2150, // Number Forms
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1706
            0x2190, // Arrows
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1707
            0x2200, // Mathematical Operators
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1708
            0x2300, // Miscellaneous Technical
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1709
            0x2400, // Control Pictures
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1710
            0x2440, // Optical Character Recognition
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1711
            0x2460, // Enclosed Alphanumerics
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1712
            0x2500, // Box Drawing
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1713
            0x2580, // Block Elements
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1714
            0x25A0, // Geometric Shapes
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1715
            0x2600, // Miscellaneous Symbols
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1716
            0x2700, // Dingbats
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1717
            0x27C0, // Miscellaneous Mathematical Symbols-A
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1718
            0x27F0, // Supplemental Arrows-A
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1719
            0x2800, // Braille Patterns
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1720
            0x2900, // Supplemental Arrows-B
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1721
            0x2980, // Miscellaneous Mathematical Symbols-B
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1722
            0x2A00, // Supplemental Mathematical Operators
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1723
            0x2B00, // Miscellaneous Symbols and Arrows
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1724
            0x2C00, // unassigned
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1725
            0x2E80, // CJK Radicals Supplement
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1726
            0x2F00, // Kangxi Radicals
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1727
            0x2FE0, // unassigned
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1728
            0x2FF0, // Ideographic Description Characters
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1729
            0x3000, // CJK Symbols and Punctuation
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1730
            0x3040, // Hiragana
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1731
            0x30A0, // Katakana
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1732
            0x3100, // Bopomofo
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1733
            0x3130, // Hangul Compatibility Jamo
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1734
            0x3190, // Kanbun
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1735
            0x31A0, // Bopomofo Extended
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1736
            0x31C0, // unassigned
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1737
            0x31F0, // Katakana Phonetic Extensions
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1738
            0x3200, // Enclosed CJK Letters and Months
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1739
            0x3300, // CJK Compatibility
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1740
            0x3400, // CJK Unified Ideographs Extension A
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1741
            0x4DC0, // Yijing Hexagram Symbols
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1742
            0x4E00, // CJK Unified Ideographs
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1743
            0xA000, // Yi Syllables
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1744
            0xA490, // Yi Radicals
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1745
            0xA4D0, // unassigned
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1746
            0xAC00, // Hangul Syllables
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1747
            0xD7B0, // unassigned
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1748
            0xD800, // High Surrogates
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1749
            0xDB80, // High Private Use Surrogates
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1750
            0xDC00, // Low Surrogates
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1751
            0xE000, // Private Use
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1752
            0xF900, // CJK Compatibility Ideographs
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1753
            0xFB00, // Alphabetic Presentation Forms
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1754
            0xFB50, // Arabic Presentation Forms-A
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1755
            0xFE00, // Variation Selectors
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1756
            0xFE10, // unassigned
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1757
            0xFE20, // Combining Half Marks
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1758
            0xFE30, // CJK Compatibility Forms
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1759
            0xFE50, // Small Form Variants
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1760
            0xFE70, // Arabic Presentation Forms-B
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1761
            0xFF00, // Halfwidth and Fullwidth Forms
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1762
            0xFFF0, // Specials
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1763
            0x10000, // Linear B Syllabary
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1764
            0x10080, // Linear B Ideograms
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1765
            0x10100, // Aegean Numbers
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1766
            0x10140, // unassigned
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1767
            0x10300, // Old Italic
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1768
            0x10330, // Gothic
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1769
            0x10350, // unassigned
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1770
            0x10380, // Ugaritic
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1771
            0x103A0, // unassigned
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1772
            0x10400, // Deseret
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1773
            0x10450, // Shavian
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1774
            0x10480, // Osmanya
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1775
            0x104B0, // unassigned
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1776
            0x10800, // Cypriot Syllabary
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1777
            0x10840, // unassigned
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1778
            0x1D000, // Byzantine Musical Symbols
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1779
            0x1D100, // Musical Symbols
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1780
            0x1D200, // unassigned
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1781
            0x1D300, // Tai Xuan Jing Symbols
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1782
            0x1D360, // unassigned
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1783
            0x1D400, // Mathematical Alphanumeric Symbols
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1784
            0x1D800, // unassigned
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1785
            0x20000, // CJK Unified Ideographs Extension B
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1786
            0x2A6E0, // unassigned
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1787
            0x2F800, // CJK Compatibility Ideographs Supplement
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1788
            0x2FA20, // unassigned
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1789
            0xE0000, // Tags
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1790
            0xE0080, // unassigned
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1791
            0xE0100, // Variation Selectors Supplement
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1792
            0xE01F0, // unassigned
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1793
            0xF0000, // Supplementary Private Use Area-A
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1794
            0x100000, // Supplementary Private Use Area-B
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1795
        };
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1796
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1797
        private static final UnicodeBlock[] blocks = {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1798
            BASIC_LATIN,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1799
            LATIN_1_SUPPLEMENT,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1800
            LATIN_EXTENDED_A,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1801
            LATIN_EXTENDED_B,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1802
            IPA_EXTENSIONS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1803
            SPACING_MODIFIER_LETTERS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1804
            COMBINING_DIACRITICAL_MARKS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1805
            GREEK,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1806
            CYRILLIC,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1807
            CYRILLIC_SUPPLEMENTARY,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1808
            ARMENIAN,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1809
            HEBREW,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1810
            ARABIC,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1811
            SYRIAC,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1812
            null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1813
            THAANA,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1814
            null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1815
            DEVANAGARI,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1816
            BENGALI,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1817
            GURMUKHI,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1818
            GUJARATI,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1819
            ORIYA,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1820
            TAMIL,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1821
            TELUGU,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1822
            KANNADA,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1823
            MALAYALAM,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1824
            SINHALA,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1825
            THAI,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1826
            LAO,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1827
            TIBETAN,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1828
            MYANMAR,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1829
            GEORGIAN,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1830
            HANGUL_JAMO,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1831
            ETHIOPIC,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1832
            null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1833
            CHEROKEE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1834
            UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1835
            OGHAM,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1836
            RUNIC,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1837
            TAGALOG,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1838
            HANUNOO,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1839
            BUHID,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1840
            TAGBANWA,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1841
            KHMER,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1842
            MONGOLIAN,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1843
            null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1844
            LIMBU,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1845
            TAI_LE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1846
            null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1847
            KHMER_SYMBOLS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1848
            null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1849
            PHONETIC_EXTENSIONS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1850
            null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1851
            LATIN_EXTENDED_ADDITIONAL,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1852
            GREEK_EXTENDED,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1853
            GENERAL_PUNCTUATION,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1854
            SUPERSCRIPTS_AND_SUBSCRIPTS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1855
            CURRENCY_SYMBOLS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1856
            COMBINING_MARKS_FOR_SYMBOLS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1857
            LETTERLIKE_SYMBOLS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1858
            NUMBER_FORMS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1859
            ARROWS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1860
            MATHEMATICAL_OPERATORS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1861
            MISCELLANEOUS_TECHNICAL,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1862
            CONTROL_PICTURES,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1863
            OPTICAL_CHARACTER_RECOGNITION,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1864
            ENCLOSED_ALPHANUMERICS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1865
            BOX_DRAWING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1866
            BLOCK_ELEMENTS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1867
            GEOMETRIC_SHAPES,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1868
            MISCELLANEOUS_SYMBOLS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1869
            DINGBATS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1870
            MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1871
            SUPPLEMENTAL_ARROWS_A,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1872
            BRAILLE_PATTERNS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1873
            SUPPLEMENTAL_ARROWS_B,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1874
            MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1875
            SUPPLEMENTAL_MATHEMATICAL_OPERATORS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1876
            MISCELLANEOUS_SYMBOLS_AND_ARROWS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1877
            null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1878
            CJK_RADICALS_SUPPLEMENT,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1879
            KANGXI_RADICALS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1880
            null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1881
            IDEOGRAPHIC_DESCRIPTION_CHARACTERS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1882
            CJK_SYMBOLS_AND_PUNCTUATION,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1883
            HIRAGANA,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1884
            KATAKANA,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1885
            BOPOMOFO,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1886
            HANGUL_COMPATIBILITY_JAMO,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1887
            KANBUN,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1888
            BOPOMOFO_EXTENDED,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1889
            null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1890
            KATAKANA_PHONETIC_EXTENSIONS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1891
            ENCLOSED_CJK_LETTERS_AND_MONTHS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1892
            CJK_COMPATIBILITY,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1893
            CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1894
            YIJING_HEXAGRAM_SYMBOLS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1895
            CJK_UNIFIED_IDEOGRAPHS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1896
            YI_SYLLABLES,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1897
            YI_RADICALS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1898
            null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1899
            HANGUL_SYLLABLES,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1900
            null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1901
            HIGH_SURROGATES,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1902
            HIGH_PRIVATE_USE_SURROGATES,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1903
            LOW_SURROGATES,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1904
            PRIVATE_USE_AREA,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1905
            CJK_COMPATIBILITY_IDEOGRAPHS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1906
            ALPHABETIC_PRESENTATION_FORMS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1907
            ARABIC_PRESENTATION_FORMS_A,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1908
            VARIATION_SELECTORS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1909
            null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1910
            COMBINING_HALF_MARKS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1911
            CJK_COMPATIBILITY_FORMS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1912
            SMALL_FORM_VARIANTS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1913
            ARABIC_PRESENTATION_FORMS_B,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1914
            HALFWIDTH_AND_FULLWIDTH_FORMS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1915
            SPECIALS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1916
            LINEAR_B_SYLLABARY,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1917
            LINEAR_B_IDEOGRAMS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1918
            AEGEAN_NUMBERS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1919
            null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1920
            OLD_ITALIC,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1921
            GOTHIC,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1922
            null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1923
            UGARITIC,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1924
            null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1925
            DESERET,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1926
            SHAVIAN,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1927
            OSMANYA,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1928
            null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1929
            CYPRIOT_SYLLABARY,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1930
            null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1931
            BYZANTINE_MUSICAL_SYMBOLS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1932
            MUSICAL_SYMBOLS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1933
            null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1934
            TAI_XUAN_JING_SYMBOLS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1935
            null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1936
            MATHEMATICAL_ALPHANUMERIC_SYMBOLS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1937
            null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1938
            CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1939
            null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1940
            CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1941
            null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1942
            TAGS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1943
            null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1944
            VARIATION_SELECTORS_SUPPLEMENT,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1945
            null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1946
            SUPPLEMENTARY_PRIVATE_USE_AREA_A,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1947
            SUPPLEMENTARY_PRIVATE_USE_AREA_B
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1948
        };
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1949
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1950
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1951
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1952
         * Returns the object representing the Unicode block containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1953
         * given character, or <code>null</code> if the character is not a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1954
         * member of a defined block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1955
         *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1956
                 * <p><b>Note:</b> This method cannot handle <a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1957
                 * href="Character.html#supplementary"> supplementary
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1958
                 * characters</a>. To support all Unicode characters,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1959
                 * including supplementary characters, use the {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1960
                 * #of(int)} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1961
         *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1962
         * @param   c  The character in question
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1963
         * @return  The <code>UnicodeBlock</code> instance representing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1964
         *          Unicode block of which this character is a member, or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1965
         *          <code>null</code> if the character is not a member of any
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1966
         *          Unicode block
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1967
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1968
        public static UnicodeBlock of(char c) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1969
            return of((int)c);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1970
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1971
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1972
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1973
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1974
         * Returns the object representing the Unicode block
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1975
         * containing the given character (Unicode code point), or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1976
         * <code>null</code> if the character is not a member of a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1977
         * defined block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1978
         *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1979
                 * @param   codePoint the character (Unicode code point) in question.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1980
         * @return  The <code>UnicodeBlock</code> instance representing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1981
         *          Unicode block of which this character is a member, or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1982
         *          <code>null</code> if the character is not a member of any
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1983
         *          Unicode block
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1984
                 * @exception IllegalArgumentException if the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1985
                 * <code>codePoint</code> is an invalid Unicode code point.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1986
                 * @see Character#isValidCodePoint(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1987
                 * @since   1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1988
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1989
        public static UnicodeBlock of(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1990
            if (!isValidCodePoint(codePoint)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1991
                throw new IllegalArgumentException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1992
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1993
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1994
            int top, bottom, current;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1995
            bottom = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1996
            top = blockStarts.length;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1997
            current = top/2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1998
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1999
            // invariant: top > current >= bottom && codePoint >= unicodeBlockStarts[bottom]
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2000
            while (top - bottom > 1) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2001
                if (codePoint >= blockStarts[current]) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2002
                    bottom = current;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2003
                } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2004
                    top = current;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2005
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2006
                current = (top + bottom) / 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2007
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2008
            return blocks[current];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2009
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2010
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2011
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2012
         * Returns the UnicodeBlock with the given name. Block
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2013
         * names are determined by The Unicode Standard. The file
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2014
         * Blocks-&lt;version&gt;.txt defines blocks for a particular
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2015
         * version of the standard. The {@link Character} class specifies
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2016
         * the version of the standard that it supports.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2017
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2018
         * This method accepts block names in the following forms:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2019
         * <ol>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2020
         * <li> Canonical block names as defined by the Unicode Standard.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2021
         * For example, the standard defines a "Basic Latin" block. Therefore, this
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2022
         * method accepts "Basic Latin" as a valid block name. The documentation of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2023
         * each UnicodeBlock provides the canonical name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2024
         * <li>Canonical block names with all spaces removed. For example, "BasicLatin"
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2025
         * is a valid block name for the "Basic Latin" block.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2026
         * <li>The text representation of each constant UnicodeBlock identifier.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2027
         * For example, this method will return the {@link #BASIC_LATIN} block if
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2028
         * provided with the "BASIC_LATIN" name. This form replaces all spaces and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2029
         *  hyphens in the canonical name with underscores.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2030
         * </ol>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2031
         * Finally, character case is ignored for all of the valid block name forms.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2032
         * For example, "BASIC_LATIN" and "basic_latin" are both valid block names.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2033
         * The en_US locale's case mapping rules are used to provide case-insensitive
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2034
         * string comparisons for block name validation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2035
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2036
         * If the Unicode Standard changes block names, both the previous and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2037
         * current names will be accepted.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2038
         *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2039
         * @param blockName A <code>UnicodeBlock</code> name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2040
         * @return The <code>UnicodeBlock</code> instance identified
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2041
         *         by <code>blockName</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2042
         * @throws IllegalArgumentException if <code>blockName</code> is an
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2043
         *         invalid name
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2044
         * @throws NullPointerException if <code>blockName</code> is null
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2045
         * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2046
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2047
        public static final UnicodeBlock forName(String blockName) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2048
            UnicodeBlock block = (UnicodeBlock)map.get(blockName.toUpperCase(Locale.US));
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2049
            if (block == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2050
                throw new IllegalArgumentException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2051
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2052
            return block;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2053
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2054
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2055
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2056
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2057
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2058
     * The value of the <code>Character</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2059
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2060
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2061
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2062
    private final char value;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2063
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2064
    /** use serialVersionUID from JDK 1.0.2 for interoperability */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2065
    private static final long serialVersionUID = 3786198910865385080L;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2066
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2067
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2068
     * Constructs a newly allocated <code>Character</code> object that
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2069
     * represents the specified <code>char</code> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2070
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2071
     * @param  value   the value to be represented by the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2072
     *                  <code>Character</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2073
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2074
    public Character(char value) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2075
        this.value = value;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2076
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2077
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2078
    private static class CharacterCache {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2079
        private CharacterCache(){}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2080
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2081
        static final Character cache[] = new Character[127 + 1];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2082
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2083
        static {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2084
            for(int i = 0; i < cache.length; i++)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2085
                cache[i] = new Character((char)i);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2086
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2087
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2088
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2089
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2090
     * Returns a <tt>Character</tt> instance representing the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2091
     * <tt>char</tt> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2092
     * If a new <tt>Character</tt> instance is not required, this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2093
     * should generally be used in preference to the constructor
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2094
     * {@link #Character(char)}, as this method is likely to yield
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2095
     * significantly better space and time performance by caching
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2096
     * frequently requested values.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2097
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2098
     * @param  c a char value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2099
     * @return a <tt>Character</tt> instance representing <tt>c</tt>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2100
     * @since  1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2101
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2102
    public static Character valueOf(char c) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2103
        if(c <= 127) { // must cache
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2104
            return CharacterCache.cache[(int)c];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2105
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2106
        return new Character(c);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2107
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2108
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2109
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2110
     * Returns the value of this <code>Character</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2111
     * @return  the primitive <code>char</code> value represented by
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2112
     *          this object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2113
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2114
    public char charValue() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2115
        return value;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2116
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2117
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2118
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2119
     * Returns a hash code for this <code>Character</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2120
     * @return  a hash code value for this object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2121
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2122
    public int hashCode() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2123
        return (int)value;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2124
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2125
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2126
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2127
     * Compares this object against the specified object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2128
     * The result is <code>true</code> if and only if the argument is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2129
     * <code>null</code> and is a <code>Character</code> object that
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2130
     * represents the same <code>char</code> value as this object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2131
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2132
     * @param   obj   the object to compare with.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2133
     * @return  <code>true</code> if the objects are the same;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2134
     *          <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2135
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2136
    public boolean equals(Object obj) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2137
        if (obj instanceof Character) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2138
            return value == ((Character)obj).charValue();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2139
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2140
        return false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2141
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2142
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2143
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2144
     * Returns a <code>String</code> object representing this
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2145
     * <code>Character</code>'s value.  The result is a string of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2146
     * length 1 whose sole component is the primitive
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2147
     * <code>char</code> value represented by this
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2148
     * <code>Character</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2149
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2150
     * @return  a string representation of this object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2151
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2152
    public String toString() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2153
        char buf[] = {value};
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2154
        return String.valueOf(buf);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2155
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2156
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2157
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2158
     * Returns a <code>String</code> object representing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2159
     * specified <code>char</code>.  The result is a string of length
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2160
     * 1 consisting solely of the specified <code>char</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2161
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2162
     * @param c the <code>char</code> to be converted
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2163
     * @return the string representation of the specified <code>char</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2164
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2165
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2166
    public static String toString(char c) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2167
        return String.valueOf(c);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2168
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2169
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2170
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2171
     * Determines whether the specified code point is a valid Unicode
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2172
     * code point value in the range of <code>0x0000</code> to
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2173
     * <code>0x10FFFF</code> inclusive. This method is equivalent to
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2174
     * the expression:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2175
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2176
     * <blockquote><pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2177
     * codePoint >= 0x0000 && codePoint <= 0x10FFFF
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2178
     * </pre></blockquote>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2179
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2180
     * @param  codePoint the Unicode code point to be tested
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2181
     * @return <code>true</code> if the specified code point value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2182
     * is a valid code point value;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2183
     * <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2184
     * @since  1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2185
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2186
    public static boolean isValidCodePoint(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2187
        return codePoint >= MIN_CODE_POINT && codePoint <= MAX_CODE_POINT;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2188
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2189
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2190
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2191
     * Determines whether the specified character (Unicode code point)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2192
     * is in the supplementary character range. The method call is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2193
     * equivalent to the expression:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2194
     * <blockquote><pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2195
     * codePoint >= 0x10000 && codePoint <= 0x10FFFF
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2196
     * </pre></blockquote>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2197
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2198
     * @param  codePoint the character (Unicode code point) to be tested
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2199
     * @return <code>true</code> if the specified character is in the Unicode
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2200
     *         supplementary character range; <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2201
     * @since  1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2202
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2203
    public static boolean isSupplementaryCodePoint(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2204
        return codePoint >= MIN_SUPPLEMENTARY_CODE_POINT
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2205
            && codePoint <= MAX_CODE_POINT;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2206
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2207
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2208
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2209
     * Determines if the given <code>char</code> value is a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2210
     * high-surrogate code unit (also known as <i>leading-surrogate
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2211
     * code unit</i>). Such values do not represent characters by
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2212
     * themselves, but are used in the representation of <a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2213
     * href="#supplementary">supplementary characters</a> in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2214
     * UTF-16 encoding.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2215
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2216
     * <p>This method returns <code>true</code> if and only if
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2217
     * <blockquote><pre>ch >= '&#92;uD800' && ch <= '&#92;uDBFF'
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2218
     * </pre></blockquote>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2219
     * is <code>true</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2220
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2221
     * @param   ch   the <code>char</code> value to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2222
     * @return  <code>true</code> if the <code>char</code> value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2223
     *          is between '&#92;uD800' and '&#92;uDBFF' inclusive;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2224
     *          <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2225
     * @see     java.lang.Character#isLowSurrogate(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2226
     * @see     Character.UnicodeBlock#of(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2227
     * @since   1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2228
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2229
    public static boolean isHighSurrogate(char ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2230
        return ch >= MIN_HIGH_SURROGATE && ch <= MAX_HIGH_SURROGATE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2231
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2232
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2233
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2234
     * Determines if the given <code>char</code> value is a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2235
     * low-surrogate code unit (also known as <i>trailing-surrogate code
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2236
     * unit</i>). Such values do not represent characters by themselves,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2237
     * but are used in the representation of <a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2238
     * href="#supplementary">supplementary characters</a> in the UTF-16 encoding.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2239
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2240
     * <p> This method returns <code>true</code> if and only if
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2241
     * <blockquote><pre>ch >= '&#92;uDC00' && ch <= '&#92;uDFFF'
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2242
     * </pre></blockquote> is <code>true</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2243
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2244
     * @param   ch   the <code>char</code> value to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2245
     * @return  <code>true</code> if the <code>char</code> value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2246
     *          is between '&#92;uDC00' and '&#92;uDFFF' inclusive;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2247
     *          <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2248
     * @see java.lang.Character#isHighSurrogate(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2249
     * @since   1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2250
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2251
    public static boolean isLowSurrogate(char ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2252
        return ch >= MIN_LOW_SURROGATE && ch <= MAX_LOW_SURROGATE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2253
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2254
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2255
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2256
     * Determines whether the specified pair of <code>char</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2257
     * values is a valid surrogate pair. This method is equivalent to
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2258
     * the expression:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2259
     * <blockquote><pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2260
     * isHighSurrogate(high) && isLowSurrogate(low)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2261
     * </pre></blockquote>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2262
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2263
     * @param  high the high-surrogate code value to be tested
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2264
     * @param  low the low-surrogate code value to be tested
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2265
     * @return <code>true</code> if the specified high and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2266
     * low-surrogate code values represent a valid surrogate pair;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2267
     * <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2268
     * @since  1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2269
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2270
    public static boolean isSurrogatePair(char high, char low) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2271
        return isHighSurrogate(high) && isLowSurrogate(low);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2272
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2273
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2274
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2275
     * Determines the number of <code>char</code> values needed to
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2276
     * represent the specified character (Unicode code point). If the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2277
     * specified character is equal to or greater than 0x10000, then
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2278
     * the method returns 2. Otherwise, the method returns 1.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2279
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2280
     * <p>This method doesn't validate the specified character to be a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2281
     * valid Unicode code point. The caller must validate the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2282
     * character value using {@link #isValidCodePoint(int) isValidCodePoint}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2283
     * if necessary.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2284
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2285
     * @param   codePoint the character (Unicode code point) to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2286
     * @return  2 if the character is a valid supplementary character; 1 otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2287
     * @see     #isSupplementaryCodePoint(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2288
     * @since   1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2289
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2290
    public static int charCount(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2291
        return codePoint >= MIN_SUPPLEMENTARY_CODE_POINT? 2 : 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2292
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2293
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2294
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2295
     * Converts the specified surrogate pair to its supplementary code
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2296
     * point value. This method does not validate the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2297
     * surrogate pair. The caller must validate it using {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2298
     * #isSurrogatePair(char, char) isSurrogatePair} if necessary.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2299
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2300
     * @param  high the high-surrogate code unit
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2301
     * @param  low the low-surrogate code unit
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2302
     * @return the supplementary code point composed from the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2303
     *         specified surrogate pair.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2304
     * @since  1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2305
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2306
    public static int toCodePoint(char high, char low) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2307
        return ((high - MIN_HIGH_SURROGATE) << 10)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2308
            + (low - MIN_LOW_SURROGATE) + MIN_SUPPLEMENTARY_CODE_POINT;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2309
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2310
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2311
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2312
     * Returns the code point at the given index of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2313
     * <code>CharSequence</code>. If the <code>char</code> value at
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2314
     * the given index in the <code>CharSequence</code> is in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2315
     * high-surrogate range, the following index is less than the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2316
     * length of the <code>CharSequence</code>, and the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2317
     * <code>char</code> value at the following index is in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2318
     * low-surrogate range, then the supplementary code point
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2319
     * corresponding to this surrogate pair is returned. Otherwise,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2320
     * the <code>char</code> value at the given index is returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2321
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2322
     * @param seq a sequence of <code>char</code> values (Unicode code
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2323
     * units)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2324
     * @param index the index to the <code>char</code> values (Unicode
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2325
     * code units) in <code>seq</code> to be converted
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2326
     * @return the Unicode code point at the given index
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2327
     * @exception NullPointerException if <code>seq</code> is null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2328
     * @exception IndexOutOfBoundsException if the value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2329
     * <code>index</code> is negative or not less than
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2330
     * {@link CharSequence#length() seq.length()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2331
     * @since  1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2332
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2333
    public static int codePointAt(CharSequence seq, int index) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2334
        char c1 = seq.charAt(index++);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2335
        if (isHighSurrogate(c1)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2336
            if (index < seq.length()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2337
                char c2 = seq.charAt(index);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2338
                if (isLowSurrogate(c2)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2339
                    return toCodePoint(c1, c2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2340
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2341
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2342
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2343
        return c1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2344
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2345
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2346
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2347
     * Returns the code point at the given index of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2348
     * <code>char</code> array. If the <code>char</code> value at
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2349
     * the given index in the <code>char</code> array is in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2350
     * high-surrogate range, the following index is less than the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2351
     * length of the <code>char</code> array, and the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2352
     * <code>char</code> value at the following index is in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2353
     * low-surrogate range, then the supplementary code point
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2354
     * corresponding to this surrogate pair is returned. Otherwise,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2355
     * the <code>char</code> value at the given index is returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2356
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2357
     * @param a the <code>char</code> array
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2358
     * @param index the index to the <code>char</code> values (Unicode
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2359
     * code units) in the <code>char</code> array to be converted
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2360
     * @return the Unicode code point at the given index
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2361
     * @exception NullPointerException if <code>a</code> is null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2362
     * @exception IndexOutOfBoundsException if the value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2363
     * <code>index</code> is negative or not less than
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2364
     * the length of the <code>char</code> array.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2365
     * @since  1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2366
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2367
    public static int codePointAt(char[] a, int index) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2368
        return codePointAtImpl(a, index, a.length);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2369
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2370
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2371
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2372
     * Returns the code point at the given index of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2373
     * <code>char</code> array, where only array elements with
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2374
     * <code>index</code> less than <code>limit</code> can be used. If
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2375
     * the <code>char</code> value at the given index in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2376
     * <code>char</code> array is in the high-surrogate range, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2377
     * following index is less than the <code>limit</code>, and the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2378
     * <code>char</code> value at the following index is in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2379
     * low-surrogate range, then the supplementary code point
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2380
     * corresponding to this surrogate pair is returned. Otherwise,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2381
     * the <code>char</code> value at the given index is returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2382
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2383
     * @param a the <code>char</code> array
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2384
     * @param index the index to the <code>char</code> values (Unicode
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2385
     * code units) in the <code>char</code> array to be converted
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2386
     * @param limit the index after the last array element that can be used in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2387
     * <code>char</code> array
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2388
     * @return the Unicode code point at the given index
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2389
     * @exception NullPointerException if <code>a</code> is null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2390
     * @exception IndexOutOfBoundsException if the <code>index</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2391
     * argument is negative or not less than the <code>limit</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2392
     * argument, or if the <code>limit</code> argument is negative or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2393
     * greater than the length of the <code>char</code> array.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2394
     * @since  1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2395
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2396
    public static int codePointAt(char[] a, int index, int limit) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2397
        if (index >= limit || limit < 0 || limit > a.length) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2398
            throw new IndexOutOfBoundsException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2399
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2400
        return codePointAtImpl(a, index, limit);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2401
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2402
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2403
    static int codePointAtImpl(char[] a, int index, int limit) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2404
        char c1 = a[index++];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2405
        if (isHighSurrogate(c1)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2406
            if (index < limit) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2407
                char c2 = a[index];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2408
                if (isLowSurrogate(c2)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2409
                    return toCodePoint(c1, c2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2410
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2411
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2412
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2413
        return c1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2414
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2415
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2416
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2417
     * Returns the code point preceding the given index of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2418
     * <code>CharSequence</code>. If the <code>char</code> value at
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2419
     * <code>(index - 1)</code> in the <code>CharSequence</code> is in
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2420
     * the low-surrogate range, <code>(index - 2)</code> is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2421
     * negative, and the <code>char</code> value at <code>(index -
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2422
     * 2)</code> in the <code>CharSequence</code> is in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2423
     * high-surrogate range, then the supplementary code point
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2424
     * corresponding to this surrogate pair is returned. Otherwise,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2425
     * the <code>char</code> value at <code>(index - 1)</code> is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2426
     * returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2427
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2428
     * @param seq the <code>CharSequence</code> instance
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2429
     * @param index the index following the code point that should be returned
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2430
     * @return the Unicode code point value before the given index.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2431
     * @exception NullPointerException if <code>seq</code> is null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2432
     * @exception IndexOutOfBoundsException if the <code>index</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2433
     * argument is less than 1 or greater than {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2434
     * CharSequence#length() seq.length()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2435
     * @since  1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2436
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2437
    public static int codePointBefore(CharSequence seq, int index) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2438
        char c2 = seq.charAt(--index);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2439
        if (isLowSurrogate(c2)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2440
            if (index > 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2441
                char c1 = seq.charAt(--index);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2442
                if (isHighSurrogate(c1)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2443
                    return toCodePoint(c1, c2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2444
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2445
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2446
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2447
        return c2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2448
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2449
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2450
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2451
     * Returns the code point preceding the given index of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2452
     * <code>char</code> array. If the <code>char</code> value at
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2453
     * <code>(index - 1)</code> in the <code>char</code> array is in
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2454
     * the low-surrogate range, <code>(index - 2)</code> is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2455
     * negative, and the <code>char</code> value at <code>(index -
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2456
     * 2)</code> in the <code>char</code> array is in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2457
     * high-surrogate range, then the supplementary code point
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2458
     * corresponding to this surrogate pair is returned. Otherwise,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2459
     * the <code>char</code> value at <code>(index - 1)</code> is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2460
     * returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2461
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2462
     * @param a the <code>char</code> array
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2463
     * @param index the index following the code point that should be returned
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2464
     * @return the Unicode code point value before the given index.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2465
     * @exception NullPointerException if <code>a</code> is null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2466
     * @exception IndexOutOfBoundsException if the <code>index</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2467
     * argument is less than 1 or greater than the length of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2468
     * <code>char</code> array
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2469
     * @since  1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2470
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2471
    public static int codePointBefore(char[] a, int index) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2472
        return codePointBeforeImpl(a, index, 0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2473
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2474
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2475
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2476
     * Returns the code point preceding the given index of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2477
     * <code>char</code> array, where only array elements with
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2478
     * <code>index</code> greater than or equal to <code>start</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2479
     * can be used. If the <code>char</code> value at <code>(index -
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2480
     * 1)</code> in the <code>char</code> array is in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2481
     * low-surrogate range, <code>(index - 2)</code> is not less than
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2482
     * <code>start</code>, and the <code>char</code> value at
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2483
     * <code>(index - 2)</code> in the <code>char</code> array is in
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2484
     * the high-surrogate range, then the supplementary code point
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2485
     * corresponding to this surrogate pair is returned. Otherwise,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2486
     * the <code>char</code> value at <code>(index - 1)</code> is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2487
     * returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2488
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2489
     * @param a the <code>char</code> array
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2490
     * @param index the index following the code point that should be returned
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2491
     * @param start the index of the first array element in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2492
     * <code>char</code> array
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2493
     * @return the Unicode code point value before the given index.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2494
     * @exception NullPointerException if <code>a</code> is null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2495
     * @exception IndexOutOfBoundsException if the <code>index</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2496
     * argument is not greater than the <code>start</code> argument or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2497
     * is greater than the length of the <code>char</code> array, or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2498
     * if the <code>start</code> argument is negative or not less than
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2499
     * the length of the <code>char</code> array.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2500
     * @since  1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2501
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2502
    public static int codePointBefore(char[] a, int index, int start) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2503
        if (index <= start || start < 0 || start >= a.length) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2504
            throw new IndexOutOfBoundsException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2505
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2506
        return codePointBeforeImpl(a, index, start);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2507
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2508
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2509
    static int codePointBeforeImpl(char[] a, int index, int start) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2510
        char c2 = a[--index];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2511
        if (isLowSurrogate(c2)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2512
            if (index > start) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2513
                char c1 = a[--index];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2514
                if (isHighSurrogate(c1)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2515
                    return toCodePoint(c1, c2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2516
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2517
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2518
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2519
        return c2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2520
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2521
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2522
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2523
     * Converts the specified character (Unicode code point) to its
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2524
     * UTF-16 representation. If the specified code point is a BMP
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2525
     * (Basic Multilingual Plane or Plane 0) value, the same value is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2526
     * stored in <code>dst[dstIndex]</code>, and 1 is returned. If the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2527
     * specified code point is a supplementary character, its
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2528
     * surrogate values are stored in <code>dst[dstIndex]</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2529
     * (high-surrogate) and <code>dst[dstIndex+1]</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2530
     * (low-surrogate), and 2 is returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2531
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2532
     * @param  codePoint the character (Unicode code point) to be converted.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2533
     * @param  dst an array of <code>char</code> in which the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2534
     * <code>codePoint</code>'s UTF-16 value is stored.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2535
     * @param dstIndex the start index into the <code>dst</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2536
     * array where the converted value is stored.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2537
     * @return 1 if the code point is a BMP code point, 2 if the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2538
     * code point is a supplementary code point.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2539
     * @exception IllegalArgumentException if the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2540
     * <code>codePoint</code> is not a valid Unicode code point.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2541
     * @exception NullPointerException if the specified <code>dst</code> is null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2542
     * @exception IndexOutOfBoundsException if <code>dstIndex</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2543
     * is negative or not less than <code>dst.length</code>, or if
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2544
     * <code>dst</code> at <code>dstIndex</code> doesn't have enough
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2545
     * array element(s) to store the resulting <code>char</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2546
     * value(s). (If <code>dstIndex</code> is equal to
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2547
     * <code>dst.length-1</code> and the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2548
     * <code>codePoint</code> is a supplementary character, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2549
     * high-surrogate value is not stored in
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2550
     * <code>dst[dstIndex]</code>.)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2551
     * @since  1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2552
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2553
    public static int toChars(int codePoint, char[] dst, int dstIndex) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2554
        if (codePoint < 0 || codePoint > MAX_CODE_POINT) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2555
            throw new IllegalArgumentException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2556
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2557
        if (codePoint < MIN_SUPPLEMENTARY_CODE_POINT) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2558
            dst[dstIndex] = (char) codePoint;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2559
            return 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2560
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2561
        toSurrogates(codePoint, dst, dstIndex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2562
        return 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2563
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2564
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2565
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2566
     * Converts the specified character (Unicode code point) to its
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2567
     * UTF-16 representation stored in a <code>char</code> array. If
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2568
     * the specified code point is a BMP (Basic Multilingual Plane or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2569
     * Plane 0) value, the resulting <code>char</code> array has
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2570
     * the same value as <code>codePoint</code>. If the specified code
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2571
     * point is a supplementary code point, the resulting
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2572
     * <code>char</code> array has the corresponding surrogate pair.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2573
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2574
     * @param  codePoint a Unicode code point
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2575
     * @return a <code>char</code> array having
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2576
     *         <code>codePoint</code>'s UTF-16 representation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2577
     * @exception IllegalArgumentException if the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2578
     * <code>codePoint</code> is not a valid Unicode code point.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2579
     * @since  1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2580
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2581
    public static char[] toChars(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2582
        if (codePoint < 0 || codePoint > MAX_CODE_POINT) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2583
            throw new IllegalArgumentException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2584
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2585
        if (codePoint < MIN_SUPPLEMENTARY_CODE_POINT) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2586
                return new char[] { (char) codePoint };
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2587
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2588
        char[] result = new char[2];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2589
        toSurrogates(codePoint, result, 0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2590
        return result;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2591
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2592
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2593
    static void toSurrogates(int codePoint, char[] dst, int index) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2594
        int offset = codePoint - MIN_SUPPLEMENTARY_CODE_POINT;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2595
        dst[index+1] = (char)((offset & 0x3ff) + MIN_LOW_SURROGATE);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2596
        dst[index] = (char)((offset >>> 10) + MIN_HIGH_SURROGATE);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2597
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2598
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2599
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2600
     * Returns the number of Unicode code points in the text range of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2601
     * the specified char sequence. The text range begins at the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2602
     * specified <code>beginIndex</code> and extends to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2603
     * <code>char</code> at index <code>endIndex - 1</code>. Thus the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2604
     * length (in <code>char</code>s) of the text range is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2605
     * <code>endIndex-beginIndex</code>. Unpaired surrogates within
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2606
     * the text range count as one code point each.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2607
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2608
     * @param seq the char sequence
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2609
     * @param beginIndex the index to the first <code>char</code> of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2610
     * the text range.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2611
     * @param endIndex the index after the last <code>char</code> of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2612
     * the text range.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2613
     * @return the number of Unicode code points in the specified text
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2614
     * range
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2615
     * @exception NullPointerException if <code>seq</code> is null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2616
     * @exception IndexOutOfBoundsException if the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2617
     * <code>beginIndex</code> is negative, or <code>endIndex</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2618
     * is larger than the length of the given sequence, or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2619
     * <code>beginIndex</code> is larger than <code>endIndex</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2620
     * @since  1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2621
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2622
    public static int codePointCount(CharSequence seq, int beginIndex, int endIndex) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2623
        int length = seq.length();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2624
        if (beginIndex < 0 || endIndex > length || beginIndex > endIndex) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2625
            throw new IndexOutOfBoundsException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2626
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2627
        int n = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2628
        for (int i = beginIndex; i < endIndex; ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2629
            n++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2630
            if (isHighSurrogate(seq.charAt(i++))) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2631
                if (i < endIndex && isLowSurrogate(seq.charAt(i))) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2632
                    i++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2633
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2634
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2635
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2636
        return n;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2637
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2638
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2639
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2640
     * Returns the number of Unicode code points in a subarray of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2641
     * <code>char</code> array argument. The <code>offset</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2642
     * argument is the index of the first <code>char</code> of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2643
     * subarray and the <code>count</code> argument specifies the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2644
     * length of the subarray in <code>char</code>s. Unpaired
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2645
     * surrogates within the subarray count as one code point each.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2646
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2647
     * @param a the <code>char</code> array
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2648
     * @param offset the index of the first <code>char</code> in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2649
     * given <code>char</code> array
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2650
     * @param count the length of the subarray in <code>char</code>s
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2651
     * @return the number of Unicode code points in the specified subarray
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2652
     * @exception NullPointerException if <code>a</code> is null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2653
     * @exception IndexOutOfBoundsException if <code>offset</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2654
     * <code>count</code> is negative, or if <code>offset +
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2655
     * count</code> is larger than the length of the given array.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2656
     * @since  1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2657
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2658
    public static int codePointCount(char[] a, int offset, int count) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2659
        if (count > a.length - offset || offset < 0 || count < 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2660
            throw new IndexOutOfBoundsException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2661
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2662
        return codePointCountImpl(a, offset, count);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2663
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2664
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2665
    static int codePointCountImpl(char[] a, int offset, int count) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2666
        int endIndex = offset + count;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2667
        int n = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2668
        for (int i = offset; i < endIndex; ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2669
            n++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2670
            if (isHighSurrogate(a[i++])) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2671
                if (i < endIndex && isLowSurrogate(a[i])) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2672
                    i++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2673
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2674
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2675
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2676
        return n;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2677
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2678
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2679
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2680
     * Returns the index within the given char sequence that is offset
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2681
     * from the given <code>index</code> by <code>codePointOffset</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2682
     * code points. Unpaired surrogates within the text range given by
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2683
     * <code>index</code> and <code>codePointOffset</code> count as
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2684
     * one code point each.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2685
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2686
     * @param seq the char sequence
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2687
     * @param index the index to be offset
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2688
     * @param codePointOffset the offset in code points
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2689
     * @return the index within the char sequence
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2690
     * @exception NullPointerException if <code>seq</code> is null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2691
     * @exception IndexOutOfBoundsException if <code>index</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2692
     *   is negative or larger then the length of the char sequence,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2693
     *   or if <code>codePointOffset</code> is positive and the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2694
     *   subsequence starting with <code>index</code> has fewer than
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2695
     *   <code>codePointOffset</code> code points, or if
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2696
     *   <code>codePointOffset</code> is negative and the subsequence
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2697
     *   before <code>index</code> has fewer than the absolute value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2698
     *   of <code>codePointOffset</code> code points.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2699
     * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2700
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2701
    public static int offsetByCodePoints(CharSequence seq, int index,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2702
                                         int codePointOffset) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2703
        int length = seq.length();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2704
        if (index < 0 || index > length) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2705
            throw new IndexOutOfBoundsException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2706
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2707
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2708
        int x = index;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2709
        if (codePointOffset >= 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2710
            int i;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2711
            for (i = 0; x < length && i < codePointOffset; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2712
                if (isHighSurrogate(seq.charAt(x++))) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2713
                    if (x < length && isLowSurrogate(seq.charAt(x))) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2714
                        x++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2715
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2716
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2717
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2718
            if (i < codePointOffset) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2719
                throw new IndexOutOfBoundsException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2720
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2721
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2722
            int i;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2723
            for (i = codePointOffset; x > 0 && i < 0; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2724
                if (isLowSurrogate(seq.charAt(--x))) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2725
                    if (x > 0 && isHighSurrogate(seq.charAt(x-1))) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2726
                        x--;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2727
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2728
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2729
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2730
            if (i < 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2731
                throw new IndexOutOfBoundsException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2732
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2733
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2734
        return x;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2735
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2736
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2737
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2738
     * Returns the index within the given <code>char</code> subarray
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2739
     * that is offset from the given <code>index</code> by
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2740
     * <code>codePointOffset</code> code points. The
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2741
     * <code>start</code> and <code>count</code> arguments specify a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2742
     * subarray of the <code>char</code> array. Unpaired surrogates
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2743
     * within the text range given by <code>index</code> and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2744
     * <code>codePointOffset</code> count as one code point each.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2745
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2746
     * @param a the <code>char</code> array
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2747
     * @param start the index of the first <code>char</code> of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2748
     * subarray
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2749
     * @param count the length of the subarray in <code>char</code>s
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2750
     * @param index the index to be offset
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2751
     * @param codePointOffset the offset in code points
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2752
     * @return the index within the subarray
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2753
     * @exception NullPointerException if <code>a</code> is null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2754
     * @exception IndexOutOfBoundsException
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2755
     *   if <code>start</code> or <code>count</code> is negative,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2756
     *   or if <code>start + count</code> is larger than the length of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2757
     *   the given array,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2758
     *   or if <code>index</code> is less than <code>start</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2759
     *   larger then <code>start + count</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2760
     *   or if <code>codePointOffset</code> is positive and the text range
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2761
     *   starting with <code>index</code> and ending with <code>start
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2762
     *   + count - 1</code> has fewer than <code>codePointOffset</code> code
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2763
     *   points,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2764
     *   or if <code>codePointOffset</code> is negative and the text range
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2765
     *   starting with <code>start</code> and ending with <code>index
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2766
     *   - 1</code> has fewer than the absolute value of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2767
     *   <code>codePointOffset</code> code points.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2768
     * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2769
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2770
    public static int offsetByCodePoints(char[] a, int start, int count,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2771
                                         int index, int codePointOffset) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2772
        if (count > a.length-start || start < 0 || count < 0
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2773
            || index < start || index > start+count) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2774
            throw new IndexOutOfBoundsException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2775
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2776
        return offsetByCodePointsImpl(a, start, count, index, codePointOffset);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2777
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2778
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2779
    static int offsetByCodePointsImpl(char[]a, int start, int count,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2780
                                      int index, int codePointOffset) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2781
        int x = index;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2782
        if (codePointOffset >= 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2783
            int limit = start + count;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2784
            int i;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2785
            for (i = 0; x < limit && i < codePointOffset; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2786
                if (isHighSurrogate(a[x++])) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2787
                    if (x < limit && isLowSurrogate(a[x])) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2788
                        x++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2789
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2790
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2791
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2792
            if (i < codePointOffset) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2793
                throw new IndexOutOfBoundsException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2794
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2795
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2796
            int i;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2797
            for (i = codePointOffset; x > start && i < 0; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2798
                if (isLowSurrogate(a[--x])) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2799
                    if (x > start && isHighSurrogate(a[x-1])) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2800
                        x--;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2801
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2802
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2803
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2804
            if (i < 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2805
                throw new IndexOutOfBoundsException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2806
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2807
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2808
        return x;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2809
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2810
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2811
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2812
     * Determines if the specified character is a lowercase character.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2813
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2814
     * A character is lowercase if its general category type, provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2815
     * by <code>Character.getType(ch)</code>, is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2816
     * <code>LOWERCASE_LETTER</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2817
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2818
     * The following are examples of lowercase characters:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2819
     * <p><blockquote><pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2820
     * 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
  2821
     * '&#92;u00DF' '&#92;u00E0' '&#92;u00E1' '&#92;u00E2' '&#92;u00E3' '&#92;u00E4' '&#92;u00E5' '&#92;u00E6'
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2822
     * '&#92;u00E7' '&#92;u00E8' '&#92;u00E9' '&#92;u00EA' '&#92;u00EB' '&#92;u00EC' '&#92;u00ED' '&#92;u00EE'
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2823
     * '&#92;u00EF' '&#92;u00F0' '&#92;u00F1' '&#92;u00F2' '&#92;u00F3' '&#92;u00F4' '&#92;u00F5' '&#92;u00F6'
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2824
     * '&#92;u00F8' '&#92;u00F9' '&#92;u00FA' '&#92;u00FB' '&#92;u00FC' '&#92;u00FD' '&#92;u00FE' '&#92;u00FF'
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2825
     * </pre></blockquote>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2826
     * <p> Many other Unicode characters are lowercase too.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2827
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2828
     * <p><b>Note:</b> This method cannot handle <a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2829
     * href="#supplementary"> supplementary characters</a>. To support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2830
     * all Unicode characters, including supplementary characters, use
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2831
     * the {@link #isLowerCase(int)} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2832
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2833
     * @param   ch   the character to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2834
     * @return  <code>true</code> if the character is lowercase;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2835
     *          <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2836
     * @see     java.lang.Character#isLowerCase(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2837
     * @see     java.lang.Character#isTitleCase(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2838
     * @see     java.lang.Character#toLowerCase(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2839
     * @see     java.lang.Character#getType(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2840
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2841
    public static boolean isLowerCase(char ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2842
        return isLowerCase((int)ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2843
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2844
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2845
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2846
     * Determines if the specified character (Unicode code point) is a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2847
     * lowercase character.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2848
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2849
     * A character is lowercase if its general category type, provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2850
     * by {@link Character#getType getType(codePoint)}, is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2851
     * <code>LOWERCASE_LETTER</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2852
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2853
     * The following are examples of lowercase characters:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2854
     * <p><blockquote><pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2855
     * 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
  2856
     * '&#92;u00DF' '&#92;u00E0' '&#92;u00E1' '&#92;u00E2' '&#92;u00E3' '&#92;u00E4' '&#92;u00E5' '&#92;u00E6'
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2857
     * '&#92;u00E7' '&#92;u00E8' '&#92;u00E9' '&#92;u00EA' '&#92;u00EB' '&#92;u00EC' '&#92;u00ED' '&#92;u00EE'
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2858
     * '&#92;u00EF' '&#92;u00F0' '&#92;u00F1' '&#92;u00F2' '&#92;u00F3' '&#92;u00F4' '&#92;u00F5' '&#92;u00F6'
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2859
     * '&#92;u00F8' '&#92;u00F9' '&#92;u00FA' '&#92;u00FB' '&#92;u00FC' '&#92;u00FD' '&#92;u00FE' '&#92;u00FF'
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2860
     * </pre></blockquote>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2861
     * <p> Many other Unicode characters are lowercase too.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2862
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2863
     * @param   codePoint the character (Unicode code point) to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2864
     * @return  <code>true</code> if the character is lowercase;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2865
     *          <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2866
     * @see     java.lang.Character#isLowerCase(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2867
     * @see     java.lang.Character#isTitleCase(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2868
     * @see     java.lang.Character#toLowerCase(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2869
     * @see     java.lang.Character#getType(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2870
     * @since   1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2871
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2872
    public static boolean isLowerCase(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2873
        return getType(codePoint) == Character.LOWERCASE_LETTER;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2874
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2875
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2876
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2877
     * Determines if the specified character is an uppercase character.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2878
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2879
     * A character is uppercase if its general category type, provided by
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2880
     * <code>Character.getType(ch)</code>, is <code>UPPERCASE_LETTER</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2881
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2882
     * The following are examples of uppercase characters:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2883
     * <p><blockquote><pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2884
     * 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
  2885
     * '&#92;u00C0' '&#92;u00C1' '&#92;u00C2' '&#92;u00C3' '&#92;u00C4' '&#92;u00C5' '&#92;u00C6' '&#92;u00C7'
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2886
     * '&#92;u00C8' '&#92;u00C9' '&#92;u00CA' '&#92;u00CB' '&#92;u00CC' '&#92;u00CD' '&#92;u00CE' '&#92;u00CF'
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2887
     * '&#92;u00D0' '&#92;u00D1' '&#92;u00D2' '&#92;u00D3' '&#92;u00D4' '&#92;u00D5' '&#92;u00D6' '&#92;u00D8'
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2888
     * '&#92;u00D9' '&#92;u00DA' '&#92;u00DB' '&#92;u00DC' '&#92;u00DD' '&#92;u00DE'
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2889
     * </pre></blockquote>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2890
     * <p> Many other Unicode characters are uppercase too.<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2891
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2892
     * <p><b>Note:</b> This method cannot handle <a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2893
     * href="#supplementary"> supplementary characters</a>. To support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2894
     * all Unicode characters, including supplementary characters, use
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2895
     * the {@link #isUpperCase(int)} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2896
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2897
     * @param   ch   the character to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2898
     * @return  <code>true</code> if the character is uppercase;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2899
     *          <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2900
     * @see     java.lang.Character#isLowerCase(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2901
     * @see     java.lang.Character#isTitleCase(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2902
     * @see     java.lang.Character#toUpperCase(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2903
     * @see     java.lang.Character#getType(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2904
     * @since   1.0
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2905
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2906
    public static boolean isUpperCase(char ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2907
        return isUpperCase((int)ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2908
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2909
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2910
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2911
     * Determines if the specified character (Unicode code point) is an uppercase character.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2912
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2913
     * A character is uppercase if its general category type, provided by
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2914
     * {@link Character#getType(int) getType(codePoint)}, is <code>UPPERCASE_LETTER</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2915
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2916
     * The following are examples of uppercase characters:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2917
     * <p><blockquote><pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2918
     * 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
  2919
     * '&#92;u00C0' '&#92;u00C1' '&#92;u00C2' '&#92;u00C3' '&#92;u00C4' '&#92;u00C5' '&#92;u00C6' '&#92;u00C7'
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2920
     * '&#92;u00C8' '&#92;u00C9' '&#92;u00CA' '&#92;u00CB' '&#92;u00CC' '&#92;u00CD' '&#92;u00CE' '&#92;u00CF'
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2921
     * '&#92;u00D0' '&#92;u00D1' '&#92;u00D2' '&#92;u00D3' '&#92;u00D4' '&#92;u00D5' '&#92;u00D6' '&#92;u00D8'
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2922
     * '&#92;u00D9' '&#92;u00DA' '&#92;u00DB' '&#92;u00DC' '&#92;u00DD' '&#92;u00DE'
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2923
     * </pre></blockquote>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2924
     * <p> Many other Unicode characters are uppercase too.<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2925
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2926
     * @param   codePoint the character (Unicode code point) to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2927
     * @return  <code>true</code> if the character is uppercase;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2928
     *          <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2929
     * @see     java.lang.Character#isLowerCase(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2930
     * @see     java.lang.Character#isTitleCase(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2931
     * @see     java.lang.Character#toUpperCase(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2932
     * @see     java.lang.Character#getType(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2933
     * @since   1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2934
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2935
    public static boolean isUpperCase(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2936
        return getType(codePoint) == Character.UPPERCASE_LETTER;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2937
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2938
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2939
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2940
     * Determines if the specified character is a titlecase character.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2941
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2942
     * A character is a titlecase character if its general
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2943
     * category type, provided by <code>Character.getType(ch)</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2944
     * is <code>TITLECASE_LETTER</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2945
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2946
     * Some characters look like pairs of Latin letters. For example, there
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2947
     * is an uppercase letter that looks like "LJ" and has a corresponding
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2948
     * lowercase letter that looks like "lj". A third form, which looks like "Lj",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2949
     * is the appropriate form to use when rendering a word in lowercase
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2950
     * with initial capitals, as for a book title.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2951
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2952
     * These are some of the Unicode characters for which this method returns
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2953
     * <code>true</code>:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2954
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2955
     * <li><code>LATIN CAPITAL LETTER D WITH SMALL LETTER Z WITH CARON</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2956
     * <li><code>LATIN CAPITAL LETTER L WITH SMALL LETTER J</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2957
     * <li><code>LATIN CAPITAL LETTER N WITH SMALL LETTER J</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2958
     * <li><code>LATIN CAPITAL LETTER D WITH SMALL LETTER Z</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2959
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2960
     * <p> Many other Unicode characters are titlecase too.<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2961
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2962
     * <p><b>Note:</b> This method cannot handle <a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2963
     * href="#supplementary"> supplementary characters</a>. To support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2964
     * all Unicode characters, including supplementary characters, use
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2965
     * the {@link #isTitleCase(int)} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2966
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2967
     * @param   ch   the character to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2968
     * @return  <code>true</code> if the character is titlecase;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2969
     *          <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2970
     * @see     java.lang.Character#isLowerCase(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2971
     * @see     java.lang.Character#isUpperCase(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2972
     * @see     java.lang.Character#toTitleCase(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2973
     * @see     java.lang.Character#getType(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2974
     * @since   1.0.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2975
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2976
    public static boolean isTitleCase(char ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2977
        return isTitleCase((int)ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2978
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2979
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2980
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2981
     * Determines if the specified character (Unicode code point) is a titlecase character.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2982
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2983
     * A character is a titlecase character if its general
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2984
     * category type, provided by {@link Character#getType(int) getType(codePoint)},
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2985
     * is <code>TITLECASE_LETTER</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2986
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2987
     * Some characters look like pairs of Latin letters. For example, there
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2988
     * is an uppercase letter that looks like "LJ" and has a corresponding
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2989
     * lowercase letter that looks like "lj". A third form, which looks like "Lj",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2990
     * is the appropriate form to use when rendering a word in lowercase
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2991
     * with initial capitals, as for a book title.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2992
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2993
     * These are some of the Unicode characters for which this method returns
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2994
     * <code>true</code>:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2995
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2996
     * <li><code>LATIN CAPITAL LETTER D WITH SMALL LETTER Z WITH CARON</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2997
     * <li><code>LATIN CAPITAL LETTER L WITH SMALL LETTER J</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2998
     * <li><code>LATIN CAPITAL LETTER N WITH SMALL LETTER J</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2999
     * <li><code>LATIN CAPITAL LETTER D WITH SMALL LETTER Z</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3000
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3001
     * <p> Many other Unicode characters are titlecase too.<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3002
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3003
     * @param   codePoint the character (Unicode code point) to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3004
     * @return  <code>true</code> if the character is titlecase;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3005
     *          <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3006
     * @see     java.lang.Character#isLowerCase(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3007
     * @see     java.lang.Character#isUpperCase(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3008
     * @see     java.lang.Character#toTitleCase(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3009
     * @see     java.lang.Character#getType(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3010
     * @since   1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3011
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3012
    public static boolean isTitleCase(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3013
        return getType(codePoint) == Character.TITLECASE_LETTER;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3014
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3015
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3016
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3017
     * Determines if the specified character is a digit.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3018
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3019
     * A character is a digit if its general category type, provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3020
     * by <code>Character.getType(ch)</code>, is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3021
     * <code>DECIMAL_DIGIT_NUMBER</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3022
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3023
     * Some Unicode character ranges that contain digits:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3024
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3025
     * <li><code>'&#92;u0030'</code> through <code>'&#92;u0039'</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3026
     *     ISO-LATIN-1 digits (<code>'0'</code> through <code>'9'</code>)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3027
     * <li><code>'&#92;u0660'</code> through <code>'&#92;u0669'</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3028
     *     Arabic-Indic digits
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3029
     * <li><code>'&#92;u06F0'</code> through <code>'&#92;u06F9'</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3030
     *     Extended Arabic-Indic digits
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3031
     * <li><code>'&#92;u0966'</code> through <code>'&#92;u096F'</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3032
     *     Devanagari digits
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3033
     * <li><code>'&#92;uFF10'</code> through <code>'&#92;uFF19'</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3034
     *     Fullwidth digits
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3035
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3036
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3037
     * Many other character ranges contain digits as well.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3038
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3039
     * <p><b>Note:</b> This method cannot handle <a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3040
     * href="#supplementary"> supplementary characters</a>. To support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3041
     * all Unicode characters, including supplementary characters, use
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3042
     * the {@link #isDigit(int)} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3043
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3044
     * @param   ch   the character to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3045
     * @return  <code>true</code> if the character is a digit;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3046
     *          <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3047
     * @see     java.lang.Character#digit(char, int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3048
     * @see     java.lang.Character#forDigit(int, int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3049
     * @see     java.lang.Character#getType(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3050
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3051
    public static boolean isDigit(char ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3052
        return isDigit((int)ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3053
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3054
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3055
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3056
     * Determines if the specified character (Unicode code point) is a digit.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3057
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3058
     * A character is a digit if its general category type, provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3059
     * by {@link Character#getType(int) getType(codePoint)}, is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3060
     * <code>DECIMAL_DIGIT_NUMBER</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3061
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3062
     * Some Unicode character ranges that contain digits:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3063
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3064
     * <li><code>'&#92;u0030'</code> through <code>'&#92;u0039'</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3065
     *     ISO-LATIN-1 digits (<code>'0'</code> through <code>'9'</code>)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3066
     * <li><code>'&#92;u0660'</code> through <code>'&#92;u0669'</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3067
     *     Arabic-Indic digits
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3068
     * <li><code>'&#92;u06F0'</code> through <code>'&#92;u06F9'</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3069
     *     Extended Arabic-Indic digits
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3070
     * <li><code>'&#92;u0966'</code> through <code>'&#92;u096F'</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3071
     *     Devanagari digits
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3072
     * <li><code>'&#92;uFF10'</code> through <code>'&#92;uFF19'</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3073
     *     Fullwidth digits
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3074
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3075
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3076
     * Many other character ranges contain digits as well.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3077
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3078
     * @param   codePoint the character (Unicode code point) to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3079
     * @return  <code>true</code> if the character is a digit;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3080
     *          <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3081
     * @see     java.lang.Character#forDigit(int, int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3082
     * @see     java.lang.Character#getType(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3083
     * @since   1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3084
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3085
    public static boolean isDigit(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3086
        return getType(codePoint) == Character.DECIMAL_DIGIT_NUMBER;
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
     * Determines if a character is defined in Unicode.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3091
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3092
     * A character is defined if at least one of the following is true:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3093
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3094
     * <li>It has an entry in the UnicodeData file.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3095
     * <li>It has a value in a range defined by the UnicodeData file.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3096
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3097
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3098
     * <p><b>Note:</b> This method cannot handle <a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3099
     * href="#supplementary"> supplementary characters</a>. To support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3100
     * all Unicode characters, including supplementary characters, use
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3101
     * the {@link #isDefined(int)} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3102
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3103
     * @param   ch   the character to be tested
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3104
     * @return  <code>true</code> if the character has a defined meaning
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3105
     *          in Unicode; <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3106
     * @see     java.lang.Character#isDigit(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3107
     * @see     java.lang.Character#isLetter(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3108
     * @see     java.lang.Character#isLetterOrDigit(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3109
     * @see     java.lang.Character#isLowerCase(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3110
     * @see     java.lang.Character#isTitleCase(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3111
     * @see     java.lang.Character#isUpperCase(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3112
     * @since   1.0.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3113
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3114
    public static boolean isDefined(char ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3115
        return isDefined((int)ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3116
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3117
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3118
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3119
     * Determines if a character (Unicode code point) is defined in Unicode.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3120
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3121
     * A character is defined if at least one of the following is true:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3122
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3123
     * <li>It has an entry in the UnicodeData file.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3124
     * <li>It has a value in a range defined by the UnicodeData file.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3125
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3126
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3127
     * @param   codePoint the character (Unicode code point) to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3128
     * @return  <code>true</code> if the character has a defined meaning
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3129
     *          in Unicode; <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3130
     * @see     java.lang.Character#isDigit(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3131
     * @see     java.lang.Character#isLetter(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3132
     * @see     java.lang.Character#isLetterOrDigit(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3133
     * @see     java.lang.Character#isLowerCase(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3134
     * @see     java.lang.Character#isTitleCase(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3135
     * @see     java.lang.Character#isUpperCase(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3136
     * @since   1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3137
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3138
    public static boolean isDefined(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3139
        return getType(codePoint) != Character.UNASSIGNED;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3140
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3141
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3142
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3143
     * Determines if the specified character is a letter.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3144
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3145
     * A character is considered to be a letter if its general
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3146
     * category type, provided by <code>Character.getType(ch)</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3147
     * is any of the following:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3148
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3149
     * <li> <code>UPPERCASE_LETTER</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3150
     * <li> <code>LOWERCASE_LETTER</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3151
     * <li> <code>TITLECASE_LETTER</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3152
     * <li> <code>MODIFIER_LETTER</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3153
     * <li> <code>OTHER_LETTER</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3154
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3155
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3156
     * Not all letters have case. Many characters are
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3157
     * letters but are neither uppercase nor lowercase nor titlecase.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3158
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3159
     * <p><b>Note:</b> This method cannot handle <a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3160
     * href="#supplementary"> supplementary characters</a>. To support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3161
     * all Unicode characters, including supplementary characters, use
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3162
     * the {@link #isLetter(int)} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3163
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3164
     * @param   ch   the character to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3165
     * @return  <code>true</code> if the character is a letter;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3166
     *          <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3167
     * @see     java.lang.Character#isDigit(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3168
     * @see     java.lang.Character#isJavaIdentifierStart(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3169
     * @see     java.lang.Character#isJavaLetter(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3170
     * @see     java.lang.Character#isJavaLetterOrDigit(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3171
     * @see     java.lang.Character#isLetterOrDigit(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3172
     * @see     java.lang.Character#isLowerCase(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3173
     * @see     java.lang.Character#isTitleCase(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3174
     * @see     java.lang.Character#isUnicodeIdentifierStart(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3175
     * @see     java.lang.Character#isUpperCase(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3176
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3177
    public static boolean isLetter(char ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3178
        return isLetter((int)ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3179
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3180
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3181
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3182
     * Determines if the specified character (Unicode code point) is a letter.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3183
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3184
     * A character is considered to be a letter if its general
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3185
     * category type, provided by {@link Character#getType(int) getType(codePoint)},
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3186
     * is any of the following:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3187
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3188
     * <li> <code>UPPERCASE_LETTER</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3189
     * <li> <code>LOWERCASE_LETTER</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3190
     * <li> <code>TITLECASE_LETTER</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3191
     * <li> <code>MODIFIER_LETTER</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3192
     * <li> <code>OTHER_LETTER</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3193
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3194
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3195
     * Not all letters have case. Many characters are
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3196
     * letters but are neither uppercase nor lowercase nor titlecase.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3197
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3198
     * @param   codePoint the character (Unicode code point) to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3199
     * @return  <code>true</code> if the character is a letter;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3200
     *          <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3201
     * @see     java.lang.Character#isDigit(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3202
     * @see     java.lang.Character#isJavaIdentifierStart(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3203
     * @see     java.lang.Character#isLetterOrDigit(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3204
     * @see     java.lang.Character#isLowerCase(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3205
     * @see     java.lang.Character#isTitleCase(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3206
     * @see     java.lang.Character#isUnicodeIdentifierStart(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3207
     * @see     java.lang.Character#isUpperCase(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3208
     * @since   1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3209
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3210
    public static boolean isLetter(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3211
        return ((((1 << Character.UPPERCASE_LETTER) |
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3212
            (1 << Character.LOWERCASE_LETTER) |
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3213
            (1 << Character.TITLECASE_LETTER) |
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3214
            (1 << Character.MODIFIER_LETTER) |
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3215
            (1 << Character.OTHER_LETTER)) >> getType(codePoint)) & 1)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3216
            != 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3217
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3218
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3219
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3220
     * Determines if the specified character is a letter or digit.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3221
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3222
     * A character is considered to be a letter or digit if either
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3223
     * <code>Character.isLetter(char ch)</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3224
     * <code>Character.isDigit(char ch)</code> returns
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3225
     * <code>true</code> for the character.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3226
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3227
     * <p><b>Note:</b> This method cannot handle <a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3228
     * href="#supplementary"> supplementary characters</a>. To support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3229
     * all Unicode characters, including supplementary characters, use
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3230
     * the {@link #isLetterOrDigit(int)} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3231
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3232
     * @param   ch   the character to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3233
     * @return  <code>true</code> if the character is a letter or digit;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3234
     *          <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3235
     * @see     java.lang.Character#isDigit(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3236
     * @see     java.lang.Character#isJavaIdentifierPart(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3237
     * @see     java.lang.Character#isJavaLetter(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3238
     * @see     java.lang.Character#isJavaLetterOrDigit(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3239
     * @see     java.lang.Character#isLetter(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3240
     * @see     java.lang.Character#isUnicodeIdentifierPart(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3241
     * @since   1.0.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3242
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3243
    public static boolean isLetterOrDigit(char ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3244
        return isLetterOrDigit((int)ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3245
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3246
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3247
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3248
     * Determines if the specified character (Unicode code point) is a letter or digit.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3249
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3250
     * A character is considered to be a letter or digit if either
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3251
     * {@link #isLetter(int) isLetter(codePoint)} or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3252
     * {@link #isDigit(int) isDigit(codePoint)} returns
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3253
     * <code>true</code> for the character.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3254
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3255
     * @param   codePoint the character (Unicode code point) to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3256
     * @return  <code>true</code> if the character is a letter or digit;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3257
     *          <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3258
     * @see     java.lang.Character#isDigit(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3259
     * @see     java.lang.Character#isJavaIdentifierPart(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3260
     * @see     java.lang.Character#isLetter(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3261
     * @see     java.lang.Character#isUnicodeIdentifierPart(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3262
     * @since   1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3263
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3264
    public static boolean isLetterOrDigit(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3265
        return ((((1 << Character.UPPERCASE_LETTER) |
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3266
            (1 << Character.LOWERCASE_LETTER) |
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3267
            (1 << Character.TITLECASE_LETTER) |
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3268
            (1 << Character.MODIFIER_LETTER) |
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3269
            (1 << Character.OTHER_LETTER) |
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3270
            (1 << Character.DECIMAL_DIGIT_NUMBER)) >> getType(codePoint)) & 1)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3271
            != 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3272
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3273
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3274
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3275
     * Determines if the specified character is permissible as the first
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3276
     * character in a Java identifier.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3277
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3278
     * A character may start a Java identifier if and only if
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3279
     * one of the following is true:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3280
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3281
     * <li> {@link #isLetter(char) isLetter(ch)} returns <code>true</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3282
     * <li> {@link #getType(char) getType(ch)} returns <code>LETTER_NUMBER</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3283
     * <li> ch is a currency symbol (such as "$")
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3284
     * <li> ch is a connecting punctuation character (such as "_").
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3285
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3286
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3287
     * @param   ch the character to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3288
     * @return  <code>true</code> if the character may start a Java
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3289
     *          identifier; <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3290
     * @see     java.lang.Character#isJavaLetterOrDigit(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3291
     * @see     java.lang.Character#isJavaIdentifierStart(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3292
     * @see     java.lang.Character#isJavaIdentifierPart(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3293
     * @see     java.lang.Character#isLetter(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3294
     * @see     java.lang.Character#isLetterOrDigit(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3295
     * @see     java.lang.Character#isUnicodeIdentifierStart(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3296
     * @since   1.02
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3297
     * @deprecated Replaced by isJavaIdentifierStart(char).
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3298
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3299
    @Deprecated
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3300
    public static boolean isJavaLetter(char ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3301
        return isJavaIdentifierStart(ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3302
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3303
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3304
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3305
     * Determines if the specified character may be part of a Java
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3306
     * identifier as other than the first character.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3307
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3308
     * A character may be part of a Java identifier if and only if any
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3309
     * of the following are true:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3310
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3311
     * <li>  it is a letter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3312
     * <li>  it is a currency symbol (such as <code>'$'</code>)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3313
     * <li>  it is a connecting punctuation character (such as <code>'_'</code>)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3314
     * <li>  it is a digit
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3315
     * <li>  it is a numeric letter (such as a Roman numeral character)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3316
     * <li>  it is a combining mark
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3317
     * <li>  it is a non-spacing mark
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3318
     * <li> <code>isIdentifierIgnorable</code> returns
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3319
     * <code>true</code> for the character.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3320
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3321
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3322
     * @param   ch the character to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3323
     * @return  <code>true</code> if the character may be part of a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3324
     *          Java identifier; <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3325
     * @see     java.lang.Character#isJavaLetter(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3326
     * @see     java.lang.Character#isJavaIdentifierStart(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3327
     * @see     java.lang.Character#isJavaIdentifierPart(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3328
     * @see     java.lang.Character#isLetter(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3329
     * @see     java.lang.Character#isLetterOrDigit(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3330
     * @see     java.lang.Character#isUnicodeIdentifierPart(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3331
     * @see     java.lang.Character#isIdentifierIgnorable(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3332
     * @since   1.02
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3333
     * @deprecated Replaced by isJavaIdentifierPart(char).
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3334
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3335
    @Deprecated
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3336
    public static boolean isJavaLetterOrDigit(char ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3337
        return isJavaIdentifierPart(ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3338
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3339
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3340
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3341
     * Determines if the specified character is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3342
     * permissible as the first character in a Java identifier.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3343
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3344
     * A character may start a Java identifier if and only if
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3345
     * one of the following conditions is true:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3346
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3347
     * <li> {@link #isLetter(char) isLetter(ch)} returns <code>true</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3348
     * <li> {@link #getType(char) getType(ch)} returns <code>LETTER_NUMBER</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3349
     * <li> ch is a currency symbol (such as "$")
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3350
     * <li> ch is a connecting punctuation character (such as "_").
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3351
     * </ul>
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 #isJavaIdentifierStart(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 may start a Java identifier;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3360
     *          <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3361
     * @see     java.lang.Character#isJavaIdentifierPart(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3362
     * @see     java.lang.Character#isLetter(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3363
     * @see     java.lang.Character#isUnicodeIdentifierStart(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3364
     * @see     javax.lang.model.SourceVersion#isIdentifier(CharSequence)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3365
     * @since   1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3366
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3367
    public static boolean isJavaIdentifierStart(char ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3368
        return isJavaIdentifierStart((int)ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3369
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3370
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3371
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3372
     * Determines if the character (Unicode code point) is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3373
     * permissible as the first character in a Java identifier.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3374
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3375
     * A character may start a Java identifier if and only if
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3376
     * one of the following conditions is true:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3377
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3378
     * <li> {@link #isLetter(int) isLetter(codePoint)}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3379
     *      returns <code>true</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3380
     * <li> {@link #getType(int) getType(codePoint)}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3381
     *      returns <code>LETTER_NUMBER</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3382
     * <li> the referenced character is a currency symbol (such as "$")
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3383
     * <li> the referenced character is a connecting punctuation character
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3384
     *      (such as "_").
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3385
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3386
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3387
     * @param   codePoint the character (Unicode code point) to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3388
     * @return  <code>true</code> if the character may start a Java identifier;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3389
     *          <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3390
     * @see     java.lang.Character#isJavaIdentifierPart(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3391
     * @see     java.lang.Character#isLetter(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3392
     * @see     java.lang.Character#isUnicodeIdentifierStart(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3393
     * @see     javax.lang.model.SourceVersion#isIdentifier(CharSequence)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3394
     * @since   1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3395
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3396
    public static boolean isJavaIdentifierStart(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3397
        return CharacterData.of(codePoint).isJavaIdentifierStart(codePoint);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3398
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3399
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3400
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3401
     * Determines if the specified character may be part of a Java
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3402
     * identifier as other than the first character.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3403
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3404
     * A character may be part of a Java identifier if any of the following
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3405
     * are true:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3406
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3407
     * <li>  it is a letter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3408
     * <li>  it is a currency symbol (such as <code>'$'</code>)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3409
     * <li>  it is a connecting punctuation character (such as <code>'_'</code>)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3410
     * <li>  it is a digit
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3411
     * <li>  it is a numeric letter (such as a Roman numeral character)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3412
     * <li>  it is a combining mark
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3413
     * <li>  it is a non-spacing mark
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3414
     * <li> <code>isIdentifierIgnorable</code> returns
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3415
     * <code>true</code> for the character
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3416
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3417
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3418
     * <p><b>Note:</b> This method cannot handle <a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3419
     * href="#supplementary"> supplementary characters</a>. To support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3420
     * all Unicode characters, including supplementary characters, use
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3421
     * the {@link #isJavaIdentifierPart(int)} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3422
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3423
     * @param   ch      the character to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3424
     * @return <code>true</code> if the character may be part of a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3425
     *          Java identifier; <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3426
     * @see     java.lang.Character#isIdentifierIgnorable(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3427
     * @see     java.lang.Character#isJavaIdentifierStart(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3428
     * @see     java.lang.Character#isLetterOrDigit(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3429
     * @see     java.lang.Character#isUnicodeIdentifierPart(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3430
     * @see     javax.lang.model.SourceVersion#isIdentifier(CharSequence)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3431
     * @since   1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3432
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3433
    public static boolean isJavaIdentifierPart(char ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3434
        return isJavaIdentifierPart((int)ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3435
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3436
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3437
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3438
     * Determines if the character (Unicode code point) may be part of a Java
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3439
     * identifier as other than the first character.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3440
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3441
     * A character may be part of a Java identifier if any of the following
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3442
     * are true:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3443
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3444
     * <li>  it is a letter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3445
     * <li>  it is a currency symbol (such as <code>'$'</code>)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3446
     * <li>  it is a connecting punctuation character (such as <code>'_'</code>)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3447
     * <li>  it is a digit
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3448
     * <li>  it is a numeric letter (such as a Roman numeral character)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3449
     * <li>  it is a combining mark
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3450
     * <li>  it is a non-spacing mark
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3451
     * <li> {@link #isIdentifierIgnorable(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3452
     * isIdentifierIgnorable(codePoint)} returns <code>true</code> for
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3453
     * the character
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3454
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3455
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3456
     * @param   codePoint the character (Unicode code point) to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3457
     * @return <code>true</code> if the character may be part of a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3458
     *          Java identifier; <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3459
     * @see     java.lang.Character#isIdentifierIgnorable(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3460
     * @see     java.lang.Character#isJavaIdentifierStart(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3461
     * @see     java.lang.Character#isLetterOrDigit(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3462
     * @see     java.lang.Character#isUnicodeIdentifierPart(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3463
     * @see     javax.lang.model.SourceVersion#isIdentifier(CharSequence)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3464
     * @since   1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3465
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3466
    public static boolean isJavaIdentifierPart(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3467
        return CharacterData.of(codePoint).isJavaIdentifierPart(codePoint);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3468
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3469
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3470
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3471
     * Determines if the specified character is permissible as the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3472
     * first character in a Unicode identifier.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3473
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3474
     * A character may start a Unicode identifier if and only if
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3475
     * one of the following conditions is true:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3476
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3477
     * <li> {@link #isLetter(char) isLetter(ch)} returns <code>true</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3478
     * <li> {@link #getType(char) getType(ch)} returns
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3479
     *      <code>LETTER_NUMBER</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3480
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3481
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3482
     * <p><b>Note:</b> This method cannot handle <a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3483
     * href="#supplementary"> supplementary characters</a>. To support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3484
     * all Unicode characters, including supplementary characters, use
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3485
     * the {@link #isUnicodeIdentifierStart(int)} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3486
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3487
     * @param   ch      the character to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3488
     * @return  <code>true</code> if the character may start a Unicode
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3489
     *          identifier; <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3490
     * @see     java.lang.Character#isJavaIdentifierStart(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3491
     * @see     java.lang.Character#isLetter(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3492
     * @see     java.lang.Character#isUnicodeIdentifierPart(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3493
     * @since   1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3494
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3495
    public static boolean isUnicodeIdentifierStart(char ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3496
        return isUnicodeIdentifierStart((int)ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3497
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3498
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3499
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3500
     * Determines if the specified character (Unicode code point) is permissible as the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3501
     * first character in a Unicode identifier.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3502
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3503
     * A character may start a Unicode identifier if and only if
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3504
     * one of the following conditions is true:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3505
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3506
     * <li> {@link #isLetter(int) isLetter(codePoint)}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3507
     *      returns <code>true</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3508
     * <li> {@link #getType(int) getType(codePoint)}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3509
     *      returns <code>LETTER_NUMBER</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3510
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3511
     * @param   codePoint the character (Unicode code point) to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3512
     * @return  <code>true</code> if the character may start a Unicode
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3513
     *          identifier; <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3514
     * @see     java.lang.Character#isJavaIdentifierStart(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3515
     * @see     java.lang.Character#isLetter(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3516
     * @see     java.lang.Character#isUnicodeIdentifierPart(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3517
     * @since   1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3518
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3519
    public static boolean isUnicodeIdentifierStart(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3520
        return CharacterData.of(codePoint).isUnicodeIdentifierStart(codePoint);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3521
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3522
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3523
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3524
     * Determines if the specified character may be part of a Unicode
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3525
     * identifier as other than the first character.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3526
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3527
     * A character may be part of a Unicode identifier if and only if
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3528
     * one of the following statements is true:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3529
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3530
     * <li>  it is a letter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3531
     * <li>  it is a connecting punctuation character (such as <code>'_'</code>)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3532
     * <li>  it is a digit
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3533
     * <li>  it is a numeric letter (such as a Roman numeral character)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3534
     * <li>  it is a combining mark
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3535
     * <li>  it is a non-spacing mark
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3536
     * <li> <code>isIdentifierIgnorable</code> returns
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3537
     * <code>true</code> for this character.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3538
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3539
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3540
     * <p><b>Note:</b> This method cannot handle <a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3541
     * href="#supplementary"> supplementary characters</a>. To support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3542
     * all Unicode characters, including supplementary characters, use
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3543
     * the {@link #isUnicodeIdentifierPart(int)} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3544
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3545
     * @param   ch      the character to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3546
     * @return  <code>true</code> if the character may be part of a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3547
     *          Unicode identifier; <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3548
     * @see     java.lang.Character#isIdentifierIgnorable(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3549
     * @see     java.lang.Character#isJavaIdentifierPart(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3550
     * @see     java.lang.Character#isLetterOrDigit(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3551
     * @see     java.lang.Character#isUnicodeIdentifierStart(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3552
     * @since   1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3553
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3554
    public static boolean isUnicodeIdentifierPart(char ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3555
        return isUnicodeIdentifierPart((int)ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3556
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3557
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3558
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3559
     * Determines if the specified character (Unicode code point) may be part of a Unicode
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3560
     * identifier as other than the first character.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3561
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3562
     * A character may be part of a Unicode identifier if and only if
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3563
     * one of the following statements is true:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3564
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3565
     * <li>  it is a letter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3566
     * <li>  it is a connecting punctuation character (such as <code>'_'</code>)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3567
     * <li>  it is a digit
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3568
     * <li>  it is a numeric letter (such as a Roman numeral character)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3569
     * <li>  it is a combining mark
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3570
     * <li>  it is a non-spacing mark
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3571
     * <li> <code>isIdentifierIgnorable</code> returns
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3572
     * <code>true</code> for this character.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3573
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3574
     * @param   codePoint the character (Unicode code point) to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3575
     * @return  <code>true</code> if the character may be part of a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3576
     *          Unicode identifier; <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3577
     * @see     java.lang.Character#isIdentifierIgnorable(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3578
     * @see     java.lang.Character#isJavaIdentifierPart(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3579
     * @see     java.lang.Character#isLetterOrDigit(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3580
     * @see     java.lang.Character#isUnicodeIdentifierStart(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3581
     * @since   1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3582
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3583
    public static boolean isUnicodeIdentifierPart(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3584
        return CharacterData.of(codePoint).isUnicodeIdentifierPart(codePoint);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3585
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3586
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3587
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3588
     * Determines if the specified character should be regarded as
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3589
     * an ignorable character in a Java identifier or a Unicode identifier.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3590
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3591
     * The following Unicode characters are ignorable in a Java identifier
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3592
     * or a Unicode identifier:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3593
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3594
     * <li>ISO control characters that are not whitespace
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3595
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3596
     * <li><code>'&#92;u0000'</code> through <code>'&#92;u0008'</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3597
     * <li><code>'&#92;u000E'</code> through <code>'&#92;u001B'</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3598
     * <li><code>'&#92;u007F'</code> through <code>'&#92;u009F'</code>
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
     * <li>all characters that have the <code>FORMAT</code> general
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3602
     * category value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3603
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3604
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3605
     * <p><b>Note:</b> This method cannot handle <a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3606
     * href="#supplementary"> supplementary characters</a>. To support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3607
     * all Unicode characters, including supplementary characters, use
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3608
     * the {@link #isIdentifierIgnorable(int)} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3609
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3610
     * @param   ch      the character to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3611
     * @return  <code>true</code> if the character is an ignorable control
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3612
     *          character that may be part of a Java or Unicode identifier;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3613
     *           <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3614
     * @see     java.lang.Character#isJavaIdentifierPart(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3615
     * @see     java.lang.Character#isUnicodeIdentifierPart(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3616
     * @since   1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3617
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3618
    public static boolean isIdentifierIgnorable(char ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3619
        return isIdentifierIgnorable((int)ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3620
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3621
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3622
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3623
     * Determines if the specified character (Unicode code point) should be regarded as
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3624
     * an ignorable character in a Java identifier or a Unicode identifier.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3625
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3626
     * The following Unicode characters are ignorable in a Java identifier
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3627
     * or a Unicode identifier:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3628
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3629
     * <li>ISO control characters that are not whitespace
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3630
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3631
     * <li><code>'&#92;u0000'</code> through <code>'&#92;u0008'</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3632
     * <li><code>'&#92;u000E'</code> through <code>'&#92;u001B'</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3633
     * <li><code>'&#92;u007F'</code> through <code>'&#92;u009F'</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3634
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3635
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3636
     * <li>all characters that have the <code>FORMAT</code> general
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3637
     * category value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3638
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3639
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3640
     * @param   codePoint the character (Unicode code point) to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3641
     * @return  <code>true</code> if the character is an ignorable control
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3642
     *          character that may be part of a Java or Unicode identifier;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3643
     *          <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3644
     * @see     java.lang.Character#isJavaIdentifierPart(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3645
     * @see     java.lang.Character#isUnicodeIdentifierPart(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3646
     * @since   1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3647
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3648
    public static boolean isIdentifierIgnorable(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3649
        return CharacterData.of(codePoint).isIdentifierIgnorable(codePoint);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3650
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3651
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3652
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3653
     * Converts the character argument to lowercase using case
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3654
     * mapping information from the UnicodeData file.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3655
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3656
     * Note that
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3657
     * <code>Character.isLowerCase(Character.toLowerCase(ch))</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3658
     * does not always return <code>true</code> for some ranges of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3659
     * characters, particularly those that are symbols or ideographs.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3660
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3661
     * <p>In general, {@link java.lang.String#toLowerCase()} should be used to map
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3662
     * characters to lowercase. <code>String</code> case mapping methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3663
     * have several benefits over <code>Character</code> case mapping methods.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3664
     * <code>String</code> case mapping methods can perform locale-sensitive
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3665
     * mappings, context-sensitive mappings, and 1:M character mappings, whereas
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3666
     * the <code>Character</code> case mapping methods cannot.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3667
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3668
     * <p><b>Note:</b> This method cannot handle <a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3669
     * href="#supplementary"> supplementary characters</a>. To support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3670
     * all Unicode characters, including supplementary characters, use
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3671
     * the {@link #toLowerCase(int)} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3672
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3673
     * @param   ch   the character to be converted.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3674
     * @return  the lowercase equivalent of the character, if any;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3675
     *          otherwise, the character itself.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3676
     * @see     java.lang.Character#isLowerCase(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3677
     * @see     java.lang.String#toLowerCase()
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3678
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3679
    public static char toLowerCase(char ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3680
        return (char)toLowerCase((int)ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3681
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3682
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3683
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3684
     * Converts the character (Unicode code point) argument to
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3685
     * lowercase using case mapping information from the UnicodeData
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3686
     * file.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3687
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3688
     * <p> Note that
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3689
     * <code>Character.isLowerCase(Character.toLowerCase(codePoint))</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3690
     * does not always return <code>true</code> for some ranges of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3691
     * characters, particularly those that are symbols or ideographs.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3692
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3693
     * <p>In general, {@link java.lang.String#toLowerCase()} should be used to map
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3694
     * characters to lowercase. <code>String</code> case mapping methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3695
     * have several benefits over <code>Character</code> case mapping methods.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3696
     * <code>String</code> case mapping methods can perform locale-sensitive
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3697
     * mappings, context-sensitive mappings, and 1:M character mappings, whereas
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3698
     * the <code>Character</code> case mapping methods cannot.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3699
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3700
     * @param   codePoint   the character (Unicode code point) to be converted.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3701
     * @return  the lowercase equivalent of the character (Unicode code
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3702
     *          point), if any; otherwise, the character itself.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3703
     * @see     java.lang.Character#isLowerCase(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3704
     * @see     java.lang.String#toLowerCase()
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3705
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3706
     * @since   1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3707
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3708
    public static int toLowerCase(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3709
        return CharacterData.of(codePoint).toLowerCase(codePoint);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3710
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3711
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3712
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3713
     * Converts the character argument to uppercase using case mapping
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3714
     * information from the UnicodeData file.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3715
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3716
     * Note that
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3717
     * <code>Character.isUpperCase(Character.toUpperCase(ch))</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3718
     * does not always return <code>true</code> for some ranges of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3719
     * characters, particularly those that are symbols or ideographs.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3720
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3721
     * <p>In general, {@link java.lang.String#toUpperCase()} should be used to map
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3722
     * characters to uppercase. <code>String</code> case mapping methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3723
     * have several benefits over <code>Character</code> case mapping methods.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3724
     * <code>String</code> case mapping methods can perform locale-sensitive
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3725
     * mappings, context-sensitive mappings, and 1:M character mappings, whereas
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3726
     * the <code>Character</code> case mapping methods cannot.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3727
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3728
     * <p><b>Note:</b> This method cannot handle <a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3729
     * href="#supplementary"> supplementary characters</a>. To support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3730
     * all Unicode characters, including supplementary characters, use
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3731
     * the {@link #toUpperCase(int)} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3732
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3733
     * @param   ch   the character to be converted.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3734
     * @return  the uppercase equivalent of the character, if any;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3735
     *          otherwise, the character itself.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3736
     * @see     java.lang.Character#isUpperCase(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3737
     * @see     java.lang.String#toUpperCase()
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3738
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3739
    public static char toUpperCase(char ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3740
        return (char)toUpperCase((int)ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3741
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3742
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3743
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3744
     * Converts the character (Unicode code point) argument to
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3745
     * uppercase using case mapping information from the UnicodeData
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3746
     * file.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3747
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3748
     * <p>Note that
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3749
     * <code>Character.isUpperCase(Character.toUpperCase(codePoint))</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3750
     * does not always return <code>true</code> for some ranges of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3751
     * characters, particularly those that are symbols or ideographs.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3752
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3753
     * <p>In general, {@link java.lang.String#toUpperCase()} should be used to map
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3754
     * characters to uppercase. <code>String</code> case mapping methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3755
     * have several benefits over <code>Character</code> case mapping methods.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3756
     * <code>String</code> case mapping methods can perform locale-sensitive
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3757
     * mappings, context-sensitive mappings, and 1:M character mappings, whereas
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3758
     * the <code>Character</code> case mapping methods cannot.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3759
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3760
     * @param   codePoint   the character (Unicode code point) to be converted.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3761
     * @return  the uppercase equivalent of the character, if any;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3762
     *          otherwise, the character itself.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3763
     * @see     java.lang.Character#isUpperCase(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3764
     * @see     java.lang.String#toUpperCase()
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3765
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3766
     * @since   1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3767
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3768
    public static int toUpperCase(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3769
        return CharacterData.of(codePoint).toUpperCase(codePoint);
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
     * Converts the character argument to titlecase using case mapping
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3774
     * information from the UnicodeData file. If a character has no
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3775
     * explicit titlecase mapping and is not itself a titlecase char
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3776
     * according to UnicodeData, then the uppercase mapping is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3777
     * returned as an equivalent titlecase mapping. If the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3778
     * <code>char</code> argument is already a titlecase
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3779
     * <code>char</code>, the same <code>char</code> value will be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3780
     * returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3781
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3782
     * Note that
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3783
     * <code>Character.isTitleCase(Character.toTitleCase(ch))</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3784
     * does not always return <code>true</code> for some ranges of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3785
     * characters.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3786
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3787
     * <p><b>Note:</b> This method cannot handle <a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3788
     * href="#supplementary"> supplementary characters</a>. To support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3789
     * all Unicode characters, including supplementary characters, use
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3790
     * the {@link #toTitleCase(int)} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3791
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3792
     * @param   ch   the character to be converted.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3793
     * @return  the titlecase equivalent of the character, if any;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3794
     *          otherwise, the character itself.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3795
     * @see     java.lang.Character#isTitleCase(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3796
     * @see     java.lang.Character#toLowerCase(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3797
     * @see     java.lang.Character#toUpperCase(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3798
     * @since   1.0.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3799
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3800
    public static char toTitleCase(char ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3801
        return (char)toTitleCase((int)ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3802
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3803
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3804
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3805
     * Converts the character (Unicode code point) argument to titlecase using case mapping
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3806
     * information from the UnicodeData file. If a character has no
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3807
     * explicit titlecase mapping and is not itself a titlecase char
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3808
     * according to UnicodeData, then the uppercase mapping is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3809
     * returned as an equivalent titlecase mapping. If the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3810
     * character argument is already a titlecase
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3811
     * character, the same character value will be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3812
     * returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3813
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3814
     * <p>Note that
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3815
     * <code>Character.isTitleCase(Character.toTitleCase(codePoint))</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3816
     * does not always return <code>true</code> for some ranges of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3817
     * characters.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3818
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3819
     * @param   codePoint   the character (Unicode code point) to be converted.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3820
     * @return  the titlecase equivalent of the character, if any;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3821
     *          otherwise, the character itself.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3822
     * @see     java.lang.Character#isTitleCase(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3823
     * @see     java.lang.Character#toLowerCase(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3824
     * @see     java.lang.Character#toUpperCase(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3825
     * @since   1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3826
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3827
    public static int toTitleCase(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3828
        return CharacterData.of(codePoint).toTitleCase(codePoint);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3829
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3830
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3831
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3832
     * Returns the numeric value of the character <code>ch</code> in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3833
     * specified radix.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3834
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3835
     * If the radix is not in the range <code>MIN_RADIX</code>&nbsp;&lt;=
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3836
     * <code>radix</code>&nbsp;&lt;= <code>MAX_RADIX</code> or if the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3837
     * value of <code>ch</code> is not a valid digit in the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3838
     * radix, <code>-1</code> is returned. A character is a valid digit
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3839
     * if at least one of the following is true:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3840
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3841
     * <li>The method <code>isDigit</code> is <code>true</code> of the character
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3842
     *     and the Unicode decimal digit value of the character (or its
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3843
     *     single-character decomposition) is less than the specified radix.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3844
     *     In this case the decimal digit value is returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3845
     * <li>The character is one of the uppercase Latin letters
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3846
     *     <code>'A'</code> through <code>'Z'</code> and its code is less than
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3847
     *     <code>radix&nbsp;+ 'A'&nbsp;-&nbsp;10</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3848
     *     In this case, <code>ch&nbsp;- 'A'&nbsp;+&nbsp;10</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3849
     *     is returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3850
     * <li>The character is one of the lowercase Latin letters
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3851
     *     <code>'a'</code> through <code>'z'</code> and its code is less than
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3852
     *     <code>radix&nbsp;+ 'a'&nbsp;-&nbsp;10</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3853
     *     In this case, <code>ch&nbsp;- 'a'&nbsp;+&nbsp;10</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3854
     *     is returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3855
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3856
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3857
     * <p><b>Note:</b> This method cannot handle <a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3858
     * href="#supplementary"> supplementary characters</a>. To support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3859
     * all Unicode characters, including supplementary characters, use
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3860
     * the {@link #digit(int, int)} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3861
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3862
     * @param   ch      the character to be converted.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3863
     * @param   radix   the radix.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3864
     * @return  the numeric value represented by the character in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3865
     *          specified radix.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3866
     * @see     java.lang.Character#forDigit(int, int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3867
     * @see     java.lang.Character#isDigit(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3868
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3869
    public static int digit(char ch, int radix) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3870
        return digit((int)ch, radix);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3871
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3872
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3873
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3874
     * Returns the numeric value of the specified character (Unicode
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3875
     * code point) in the specified radix.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3876
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3877
     * <p>If the radix is not in the range <code>MIN_RADIX</code>&nbsp;&lt;=
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3878
     * <code>radix</code>&nbsp;&lt;= <code>MAX_RADIX</code> or if the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3879
     * character is not a valid digit in the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3880
     * radix, <code>-1</code> is returned. A character is a valid digit
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3881
     * if at least one of the following is true:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3882
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3883
     * <li>The method {@link #isDigit(int) isDigit(codePoint)} is <code>true</code> of the character
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3884
     *     and the Unicode decimal digit value of the character (or its
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3885
     *     single-character decomposition) is less than the specified radix.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3886
     *     In this case the decimal digit value is returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3887
     * <li>The character is one of the uppercase Latin letters
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3888
     *     <code>'A'</code> through <code>'Z'</code> and its code is less than
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3889
     *     <code>radix&nbsp;+ 'A'&nbsp;-&nbsp;10</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3890
     *     In this case, <code>ch&nbsp;- 'A'&nbsp;+&nbsp;10</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3891
     *     is returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3892
     * <li>The character is one of the lowercase Latin letters
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3893
     *     <code>'a'</code> through <code>'z'</code> and its code is less than
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3894
     *     <code>radix&nbsp;+ 'a'&nbsp;-&nbsp;10</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3895
     *     In this case, <code>ch&nbsp;- 'a'&nbsp;+&nbsp;10</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3896
     *     is returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3897
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3898
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3899
     * @param   codePoint the character (Unicode code point) to be converted.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3900
     * @param   radix   the radix.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3901
     * @return  the numeric value represented by the character in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3902
     *          specified radix.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3903
     * @see     java.lang.Character#forDigit(int, int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3904
     * @see     java.lang.Character#isDigit(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3905
     * @since   1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3906
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3907
    public static int digit(int codePoint, int radix) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3908
        return CharacterData.of(codePoint).digit(codePoint, radix);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3909
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3910
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3911
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3912
     * Returns the <code>int</code> value that the specified Unicode
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3913
     * character represents. For example, the character
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3914
     * <code>'&#92;u216C'</code> (the roman numeral fifty) will return
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3915
     * an int with a value of 50.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3916
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3917
     * The letters A-Z in their uppercase (<code>'&#92;u0041'</code> through
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3918
     * <code>'&#92;u005A'</code>), lowercase
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3919
     * (<code>'&#92;u0061'</code> through <code>'&#92;u007A'</code>), and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3920
     * full width variant (<code>'&#92;uFF21'</code> through
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3921
     * <code>'&#92;uFF3A'</code> and <code>'&#92;uFF41'</code> through
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3922
     * <code>'&#92;uFF5A'</code>) forms have numeric values from 10
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3923
     * through 35. This is independent of the Unicode specification,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3924
     * which does not assign numeric values to these <code>char</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3925
     * values.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3926
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3927
     * If the character does not have a numeric value, then -1 is returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3928
     * If the character has a numeric value that cannot be represented as a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3929
     * nonnegative integer (for example, a fractional value), then -2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3930
     * is returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3931
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3932
     * <p><b>Note:</b> This method cannot handle <a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3933
     * href="#supplementary"> supplementary characters</a>. To support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3934
     * all Unicode characters, including supplementary characters, use
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3935
     * the {@link #getNumericValue(int)} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3936
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3937
     * @param   ch      the character to be converted.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3938
     * @return  the numeric value of the character, as a nonnegative <code>int</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3939
     *           value; -2 if the character has a numeric value that is not a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3940
     *          nonnegative integer; -1 if the character has no numeric value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3941
     * @see     java.lang.Character#forDigit(int, int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3942
     * @see     java.lang.Character#isDigit(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3943
     * @since   1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3944
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3945
    public static int getNumericValue(char ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3946
        return getNumericValue((int)ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3947
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3948
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3949
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3950
     * Returns the <code>int</code> value that the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3951
     * character (Unicode code point) represents. For example, the character
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3952
     * <code>'&#92;u216C'</code> (the Roman numeral fifty) will return
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3953
     * an <code>int</code> with a value of 50.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3954
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3955
     * The letters A-Z in their uppercase (<code>'&#92;u0041'</code> through
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3956
     * <code>'&#92;u005A'</code>), lowercase
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3957
     * (<code>'&#92;u0061'</code> through <code>'&#92;u007A'</code>), and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3958
     * full width variant (<code>'&#92;uFF21'</code> through
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3959
     * <code>'&#92;uFF3A'</code> and <code>'&#92;uFF41'</code> through
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3960
     * <code>'&#92;uFF5A'</code>) forms have numeric values from 10
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3961
     * through 35. This is independent of the Unicode specification,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3962
     * which does not assign numeric values to these <code>char</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3963
     * values.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3964
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3965
     * If the character does not have a numeric value, then -1 is returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3966
     * If the character has a numeric value that cannot be represented as a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3967
     * nonnegative integer (for example, a fractional value), then -2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3968
     * is returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3969
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3970
     * @param   codePoint the character (Unicode code point) to be converted.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3971
     * @return  the numeric value of the character, as a nonnegative <code>int</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3972
     *          value; -2 if the character has a numeric value that is not a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3973
     *          nonnegative integer; -1 if the character has no numeric value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3974
     * @see     java.lang.Character#forDigit(int, int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3975
     * @see     java.lang.Character#isDigit(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3976
     * @since   1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3977
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3978
    public static int getNumericValue(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3979
        return CharacterData.of(codePoint).getNumericValue(codePoint);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3980
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3981
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3982
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3983
     * Determines if the specified character is ISO-LATIN-1 white space.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3984
     * This method returns <code>true</code> for the following five
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3985
     * characters only:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3986
     * <table>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3987
     * <tr><td><code>'\t'</code></td>            <td><code>'&#92;u0009'</code></td>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3988
     *     <td><code>HORIZONTAL TABULATION</code></td></tr>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3989
     * <tr><td><code>'\n'</code></td>            <td><code>'&#92;u000A'</code></td>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3990
     *     <td><code>NEW LINE</code></td></tr>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3991
     * <tr><td><code>'\f'</code></td>            <td><code>'&#92;u000C'</code></td>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3992
     *     <td><code>FORM FEED</code></td></tr>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3993
     * <tr><td><code>'\r'</code></td>            <td><code>'&#92;u000D'</code></td>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3994
     *     <td><code>CARRIAGE RETURN</code></td></tr>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3995
     * <tr><td><code>'&nbsp;'</code></td>  <td><code>'&#92;u0020'</code></td>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3996
     *     <td><code>SPACE</code></td></tr>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3997
     * </table>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3998
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3999
     * @param      ch   the character to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4000
     * @return     <code>true</code> if the character is ISO-LATIN-1 white
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4001
     *             space; <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4002
     * @see        java.lang.Character#isSpaceChar(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4003
     * @see        java.lang.Character#isWhitespace(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4004
     * @deprecated Replaced by isWhitespace(char).
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4005
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4006
    @Deprecated
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4007
    public static boolean isSpace(char ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4008
        return (ch <= 0x0020) &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4009
            (((((1L << 0x0009) |
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4010
            (1L << 0x000A) |
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4011
            (1L << 0x000C) |
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4012
            (1L << 0x000D) |
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4013
            (1L << 0x0020)) >> ch) & 1L) != 0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4014
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4015
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4016
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4017
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4018
     * Determines if the specified character is a Unicode space character.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4019
     * A character is considered to be a space character if and only if
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4020
     * it is specified to be a space character by the Unicode standard. This
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4021
     * method returns true if the character's general category type is any of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4022
     * the following:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4023
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4024
     * <li> <code>SPACE_SEPARATOR</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4025
     * <li> <code>LINE_SEPARATOR</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4026
     * <li> <code>PARAGRAPH_SEPARATOR</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4027
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4028
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4029
     * <p><b>Note:</b> This method cannot handle <a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4030
     * href="#supplementary"> supplementary characters</a>. To support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4031
     * all Unicode characters, including supplementary characters, use
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4032
     * the {@link #isSpaceChar(int)} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4033
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4034
     * @param   ch      the character to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4035
     * @return  <code>true</code> if the character is a space character;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4036
     *          <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4037
     * @see     java.lang.Character#isWhitespace(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4038
     * @since   1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4039
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4040
    public static boolean isSpaceChar(char ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4041
        return isSpaceChar((int)ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4042
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4043
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4044
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4045
     * Determines if the specified character (Unicode code point) is a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4046
     * Unicode space character.  A character is considered to be a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4047
     * space character if and only if it is specified to be a space
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4048
     * character by the Unicode standard. This method returns true if
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4049
     * the character's general category type is any of the following:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4050
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4051
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4052
     * <li> {@link #SPACE_SEPARATOR}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4053
     * <li> {@link #LINE_SEPARATOR}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4054
     * <li> {@link #PARAGRAPH_SEPARATOR}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4055
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4056
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4057
     * @param   codePoint the character (Unicode code point) to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4058
     * @return  <code>true</code> if the character is a space character;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4059
     *          <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4060
     * @see     java.lang.Character#isWhitespace(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4061
     * @since   1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4062
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4063
    public static boolean isSpaceChar(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4064
        return ((((1 << Character.SPACE_SEPARATOR) |
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4065
                  (1 << Character.LINE_SEPARATOR) |
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4066
                  (1 << Character.PARAGRAPH_SEPARATOR)) >> getType(codePoint)) & 1)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4067
            != 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4068
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4069
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4070
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4071
     * Determines if the specified character is white space according to Java.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4072
     * A character is a Java whitespace character if and only if it satisfies
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4073
     * one of the following criteria:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4074
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4075
     * <li> It is a Unicode space character (<code>SPACE_SEPARATOR</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4076
     *      <code>LINE_SEPARATOR</code>, or <code>PARAGRAPH_SEPARATOR</code>)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4077
     *      but is not also a non-breaking space (<code>'&#92;u00A0'</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4078
     *      <code>'&#92;u2007'</code>, <code>'&#92;u202F'</code>).
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4079
     * <li> It is <code>'&#92;u0009'</code>, HORIZONTAL TABULATION.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4080
     * <li> It is <code>'&#92;u000A'</code>, LINE FEED.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4081
     * <li> It is <code>'&#92;u000B'</code>, VERTICAL TABULATION.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4082
     * <li> It is <code>'&#92;u000C'</code>, FORM FEED.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4083
     * <li> It is <code>'&#92;u000D'</code>, CARRIAGE RETURN.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4084
     * <li> It is <code>'&#92;u001C'</code>, FILE SEPARATOR.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4085
     * <li> It is <code>'&#92;u001D'</code>, GROUP SEPARATOR.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4086
     * <li> It is <code>'&#92;u001E'</code>, RECORD SEPARATOR.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4087
     * <li> It is <code>'&#92;u001F'</code>, UNIT SEPARATOR.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4088
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4089
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4090
     * <p><b>Note:</b> This method cannot handle <a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4091
     * href="#supplementary"> supplementary characters</a>. To support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4092
     * all Unicode characters, including supplementary characters, use
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4093
     * the {@link #isWhitespace(int)} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4094
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4095
     * @param   ch the character to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4096
     * @return  <code>true</code> if the character is a Java whitespace
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4097
     *          character; <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4098
     * @see     java.lang.Character#isSpaceChar(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4099
     * @since   1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4100
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4101
    public static boolean isWhitespace(char ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4102
        return isWhitespace((int)ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4103
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4104
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4105
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4106
     * Determines if the specified character (Unicode code point) is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4107
     * white space according to Java.  A character is a Java
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4108
     * whitespace character if and only if it satisfies one of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4109
     * following criteria:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4110
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4111
     * <li> It is a Unicode space character ({@link #SPACE_SEPARATOR},
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4112
     *      {@link #LINE_SEPARATOR}, or {@link #PARAGRAPH_SEPARATOR})
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4113
     *      but is not also a non-breaking space (<code>'&#92;u00A0'</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4114
     *      <code>'&#92;u2007'</code>, <code>'&#92;u202F'</code>).
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4115
     * <li> It is <code>'&#92;u0009'</code>, HORIZONTAL TABULATION.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4116
     * <li> It is <code>'&#92;u000A'</code>, LINE FEED.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4117
     * <li> It is <code>'&#92;u000B'</code>, VERTICAL TABULATION.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4118
     * <li> It is <code>'&#92;u000C'</code>, FORM FEED.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4119
     * <li> It is <code>'&#92;u000D'</code>, CARRIAGE RETURN.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4120
     * <li> It is <code>'&#92;u001C'</code>, FILE SEPARATOR.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4121
     * <li> It is <code>'&#92;u001D'</code>, GROUP SEPARATOR.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4122
     * <li> It is <code>'&#92;u001E'</code>, RECORD SEPARATOR.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4123
     * <li> It is <code>'&#92;u001F'</code>, UNIT SEPARATOR.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4124
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4125
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4126
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4127
     * @param   codePoint the character (Unicode code point) to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4128
     * @return  <code>true</code> if the character is a Java whitespace
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4129
     *          character; <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4130
     * @see     java.lang.Character#isSpaceChar(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4131
     * @since   1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4132
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4133
    public static boolean isWhitespace(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4134
        return CharacterData.of(codePoint).isWhitespace(codePoint);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4135
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4136
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4137
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4138
     * Determines if the specified character is an ISO control
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4139
     * character.  A character is considered to be an ISO control
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4140
     * character if its code is in the range <code>'&#92;u0000'</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4141
     * through <code>'&#92;u001F'</code> or in the range
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4142
     * <code>'&#92;u007F'</code> through <code>'&#92;u009F'</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4143
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4144
     * <p><b>Note:</b> This method cannot handle <a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4145
     * href="#supplementary"> supplementary characters</a>. To support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4146
     * all Unicode characters, including supplementary characters, use
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4147
     * the {@link #isISOControl(int)} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4148
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4149
     * @param   ch      the character to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4150
     * @return  <code>true</code> if the character is an ISO control character;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4151
     *          <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4152
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4153
     * @see     java.lang.Character#isSpaceChar(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4154
     * @see     java.lang.Character#isWhitespace(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4155
     * @since   1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4156
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4157
    public static boolean isISOControl(char ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4158
        return isISOControl((int)ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4159
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4160
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4161
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4162
     * Determines if the referenced character (Unicode code point) is an ISO control
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4163
     * character.  A character is considered to be an ISO control
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4164
     * character if its code is in the range <code>'&#92;u0000'</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4165
     * through <code>'&#92;u001F'</code> or in the range
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4166
     * <code>'&#92;u007F'</code> through <code>'&#92;u009F'</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4167
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4168
     * @param   codePoint the character (Unicode code point) to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4169
     * @return  <code>true</code> if the character is an ISO control character;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4170
     *          <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4171
     * @see     java.lang.Character#isSpaceChar(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4172
     * @see     java.lang.Character#isWhitespace(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4173
     * @since   1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4174
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4175
    public static boolean isISOControl(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4176
        return (codePoint >= 0x0000 && codePoint <= 0x001F) ||
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4177
            (codePoint >= 0x007F && codePoint <= 0x009F);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4178
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4179
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4180
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4181
     * Returns a value indicating a character's general category.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4182
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4183
     * <p><b>Note:</b> This method cannot handle <a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4184
     * href="#supplementary"> supplementary characters</a>. To support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4185
     * all Unicode characters, including supplementary characters, use
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4186
     * the {@link #getType(int)} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4187
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4188
     * @param   ch      the character to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4189
     * @return  a value of type <code>int</code> representing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4190
     *          character's general category.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4191
     * @see     java.lang.Character#COMBINING_SPACING_MARK
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4192
     * @see     java.lang.Character#CONNECTOR_PUNCTUATION
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4193
     * @see     java.lang.Character#CONTROL
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4194
     * @see     java.lang.Character#CURRENCY_SYMBOL
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4195
     * @see     java.lang.Character#DASH_PUNCTUATION
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4196
     * @see     java.lang.Character#DECIMAL_DIGIT_NUMBER
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4197
     * @see     java.lang.Character#ENCLOSING_MARK
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4198
     * @see     java.lang.Character#END_PUNCTUATION
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4199
     * @see     java.lang.Character#FINAL_QUOTE_PUNCTUATION
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4200
     * @see     java.lang.Character#FORMAT
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4201
     * @see     java.lang.Character#INITIAL_QUOTE_PUNCTUATION
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4202
     * @see     java.lang.Character#LETTER_NUMBER
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4203
     * @see     java.lang.Character#LINE_SEPARATOR
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4204
     * @see     java.lang.Character#LOWERCASE_LETTER
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4205
     * @see     java.lang.Character#MATH_SYMBOL
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4206
     * @see     java.lang.Character#MODIFIER_LETTER
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4207
     * @see     java.lang.Character#MODIFIER_SYMBOL
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4208
     * @see     java.lang.Character#NON_SPACING_MARK
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4209
     * @see     java.lang.Character#OTHER_LETTER
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4210
     * @see     java.lang.Character#OTHER_NUMBER
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4211
     * @see     java.lang.Character#OTHER_PUNCTUATION
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4212
     * @see     java.lang.Character#OTHER_SYMBOL
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4213
     * @see     java.lang.Character#PARAGRAPH_SEPARATOR
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4214
     * @see     java.lang.Character#PRIVATE_USE
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4215
     * @see     java.lang.Character#SPACE_SEPARATOR
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4216
     * @see     java.lang.Character#START_PUNCTUATION
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4217
     * @see     java.lang.Character#SURROGATE
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4218
     * @see     java.lang.Character#TITLECASE_LETTER
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4219
     * @see     java.lang.Character#UNASSIGNED
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4220
     * @see     java.lang.Character#UPPERCASE_LETTER
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4221
     * @since   1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4222
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4223
    public static int getType(char ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4224
        return getType((int)ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4225
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4226
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4227
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4228
     * Returns a value indicating a character's general category.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4229
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4230
     * @param   codePoint the character (Unicode code point) to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4231
     * @return  a value of type <code>int</code> representing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4232
     *          character's general category.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4233
     * @see     Character#COMBINING_SPACING_MARK COMBINING_SPACING_MARK
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4234
     * @see     Character#CONNECTOR_PUNCTUATION CONNECTOR_PUNCTUATION
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4235
     * @see     Character#CONTROL CONTROL
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4236
     * @see     Character#CURRENCY_SYMBOL CURRENCY_SYMBOL
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4237
     * @see     Character#DASH_PUNCTUATION DASH_PUNCTUATION
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4238
     * @see     Character#DECIMAL_DIGIT_NUMBER DECIMAL_DIGIT_NUMBER
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4239
     * @see     Character#ENCLOSING_MARK ENCLOSING_MARK
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4240
     * @see     Character#END_PUNCTUATION END_PUNCTUATION
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4241
     * @see     Character#FINAL_QUOTE_PUNCTUATION FINAL_QUOTE_PUNCTUATION
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4242
     * @see     Character#FORMAT FORMAT
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4243
     * @see     Character#INITIAL_QUOTE_PUNCTUATION INITIAL_QUOTE_PUNCTUATION
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4244
     * @see     Character#LETTER_NUMBER LETTER_NUMBER
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4245
     * @see     Character#LINE_SEPARATOR LINE_SEPARATOR
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4246
     * @see     Character#LOWERCASE_LETTER LOWERCASE_LETTER
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4247
     * @see     Character#MATH_SYMBOL MATH_SYMBOL
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4248
     * @see     Character#MODIFIER_LETTER MODIFIER_LETTER
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4249
     * @see     Character#MODIFIER_SYMBOL MODIFIER_SYMBOL
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4250
     * @see     Character#NON_SPACING_MARK NON_SPACING_MARK
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4251
     * @see     Character#OTHER_LETTER OTHER_LETTER
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4252
     * @see     Character#OTHER_NUMBER OTHER_NUMBER
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4253
     * @see     Character#OTHER_PUNCTUATION OTHER_PUNCTUATION
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4254
     * @see     Character#OTHER_SYMBOL OTHER_SYMBOL
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4255
     * @see     Character#PARAGRAPH_SEPARATOR PARAGRAPH_SEPARATOR
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4256
     * @see     Character#PRIVATE_USE PRIVATE_USE
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4257
     * @see     Character#SPACE_SEPARATOR SPACE_SEPARATOR
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4258
     * @see     Character#START_PUNCTUATION START_PUNCTUATION
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4259
     * @see     Character#SURROGATE SURROGATE
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4260
     * @see     Character#TITLECASE_LETTER TITLECASE_LETTER
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4261
     * @see     Character#UNASSIGNED UNASSIGNED
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4262
     * @see     Character#UPPERCASE_LETTER UPPERCASE_LETTER
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4263
     * @since   1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4264
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4265
    public static int getType(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4266
        return CharacterData.of(codePoint).getType(codePoint);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4267
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4268
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4269
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4270
     * Determines the character representation for a specific digit in
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4271
     * the specified radix. If the value of <code>radix</code> is not a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4272
     * valid radix, or the value of <code>digit</code> is not a valid
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4273
     * digit in the specified radix, the null character
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4274
     * (<code>'&#92;u0000'</code>) is returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4275
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4276
     * The <code>radix</code> argument is valid if it is greater than or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4277
     * equal to <code>MIN_RADIX</code> and less than or equal to
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4278
     * <code>MAX_RADIX</code>. The <code>digit</code> argument is valid if
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4279
     * <code>0&nbsp;&lt;=digit&nbsp;&lt;&nbsp;radix</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4280
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4281
     * If the digit is less than 10, then
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4282
     * <code>'0'&nbsp;+ digit</code> is returned. Otherwise, the value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4283
     * <code>'a'&nbsp;+ digit&nbsp;-&nbsp;10</code> is returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4284
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4285
     * @param   digit   the number to convert to a character.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4286
     * @param   radix   the radix.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4287
     * @return  the <code>char</code> representation of the specified digit
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4288
     *          in the specified radix.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4289
     * @see     java.lang.Character#MIN_RADIX
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4290
     * @see     java.lang.Character#MAX_RADIX
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4291
     * @see     java.lang.Character#digit(char, int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4292
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4293
    public static char forDigit(int digit, int radix) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4294
        if ((digit >= radix) || (digit < 0)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4295
            return '\0';
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4296
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4297
        if ((radix < Character.MIN_RADIX) || (radix > Character.MAX_RADIX)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4298
            return '\0';
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4299
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4300
        if (digit < 10) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4301
            return (char)('0' + digit);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4302
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4303
        return (char)('a' - 10 + digit);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4304
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4305
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4306
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4307
     * Returns the Unicode directionality property for the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4308
     * character.  Character directionality is used to calculate the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4309
     * visual ordering of text. The directionality value of undefined
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4310
     * <code>char</code> values is <code>DIRECTIONALITY_UNDEFINED</code>.
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 #getDirectionality(int)} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4316
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4317
     * @param  ch <code>char</code> for which the directionality property
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4318
     *            is requested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4319
     * @return the directionality property of the <code>char</code> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4320
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4321
     * @see Character#DIRECTIONALITY_UNDEFINED
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4322
     * @see Character#DIRECTIONALITY_LEFT_TO_RIGHT
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4323
     * @see Character#DIRECTIONALITY_RIGHT_TO_LEFT
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4324
     * @see Character#DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4325
     * @see Character#DIRECTIONALITY_EUROPEAN_NUMBER
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4326
     * @see Character#DIRECTIONALITY_EUROPEAN_NUMBER_SEPARATOR
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4327
     * @see Character#DIRECTIONALITY_EUROPEAN_NUMBER_TERMINATOR
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4328
     * @see Character#DIRECTIONALITY_ARABIC_NUMBER
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4329
     * @see Character#DIRECTIONALITY_COMMON_NUMBER_SEPARATOR
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4330
     * @see Character#DIRECTIONALITY_NONSPACING_MARK
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4331
     * @see Character#DIRECTIONALITY_BOUNDARY_NEUTRAL
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4332
     * @see Character#DIRECTIONALITY_PARAGRAPH_SEPARATOR
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4333
     * @see Character#DIRECTIONALITY_SEGMENT_SEPARATOR
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4334
     * @see Character#DIRECTIONALITY_WHITESPACE
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4335
     * @see Character#DIRECTIONALITY_OTHER_NEUTRALS
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4336
     * @see Character#DIRECTIONALITY_LEFT_TO_RIGHT_EMBEDDING
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4337
     * @see Character#DIRECTIONALITY_LEFT_TO_RIGHT_OVERRIDE
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4338
     * @see Character#DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4339
     * @see Character#DIRECTIONALITY_RIGHT_TO_LEFT_OVERRIDE
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4340
     * @see Character#DIRECTIONALITY_POP_DIRECTIONAL_FORMAT
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4341
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4342
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4343
    public static byte getDirectionality(char ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4344
        return getDirectionality((int)ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4345
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4346
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4347
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4348
     * Returns the Unicode directionality property for the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4349
     * character (Unicode code point).  Character directionality is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4350
     * used to calculate the visual ordering of text. The
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4351
     * directionality value of undefined character is {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4352
     * #DIRECTIONALITY_UNDEFINED}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4353
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4354
     * @param   codePoint the character (Unicode code point) for which
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4355
     *          the directionality property is requested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4356
     * @return the directionality property of the character.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4357
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4358
     * @see Character#DIRECTIONALITY_UNDEFINED DIRECTIONALITY_UNDEFINED
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4359
     * @see Character#DIRECTIONALITY_LEFT_TO_RIGHT DIRECTIONALITY_LEFT_TO_RIGHT
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4360
     * @see Character#DIRECTIONALITY_RIGHT_TO_LEFT DIRECTIONALITY_RIGHT_TO_LEFT
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4361
     * @see Character#DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4362
     * @see Character#DIRECTIONALITY_EUROPEAN_NUMBER DIRECTIONALITY_EUROPEAN_NUMBER
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4363
     * @see Character#DIRECTIONALITY_EUROPEAN_NUMBER_SEPARATOR DIRECTIONALITY_EUROPEAN_NUMBER_SEPARATOR
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4364
     * @see Character#DIRECTIONALITY_EUROPEAN_NUMBER_TERMINATOR DIRECTIONALITY_EUROPEAN_NUMBER_TERMINATOR
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4365
     * @see Character#DIRECTIONALITY_ARABIC_NUMBER DIRECTIONALITY_ARABIC_NUMBER
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4366
     * @see Character#DIRECTIONALITY_COMMON_NUMBER_SEPARATOR DIRECTIONALITY_COMMON_NUMBER_SEPARATOR
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4367
     * @see Character#DIRECTIONALITY_NONSPACING_MARK DIRECTIONALITY_NONSPACING_MARK
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4368
     * @see Character#DIRECTIONALITY_BOUNDARY_NEUTRAL DIRECTIONALITY_BOUNDARY_NEUTRAL
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4369
     * @see Character#DIRECTIONALITY_PARAGRAPH_SEPARATOR DIRECTIONALITY_PARAGRAPH_SEPARATOR
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4370
     * @see Character#DIRECTIONALITY_SEGMENT_SEPARATOR DIRECTIONALITY_SEGMENT_SEPARATOR
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4371
     * @see Character#DIRECTIONALITY_WHITESPACE DIRECTIONALITY_WHITESPACE
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4372
     * @see Character#DIRECTIONALITY_OTHER_NEUTRALS DIRECTIONALITY_OTHER_NEUTRALS
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4373
     * @see Character#DIRECTIONALITY_LEFT_TO_RIGHT_EMBEDDING DIRECTIONALITY_LEFT_TO_RIGHT_EMBEDDING
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4374
     * @see Character#DIRECTIONALITY_LEFT_TO_RIGHT_OVERRIDE DIRECTIONALITY_LEFT_TO_RIGHT_OVERRIDE
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4375
     * @see Character#DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4376
     * @see Character#DIRECTIONALITY_RIGHT_TO_LEFT_OVERRIDE DIRECTIONALITY_RIGHT_TO_LEFT_OVERRIDE
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4377
     * @see Character#DIRECTIONALITY_POP_DIRECTIONAL_FORMAT DIRECTIONALITY_POP_DIRECTIONAL_FORMAT
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4378
     * @since    1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4379
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4380
    public static byte getDirectionality(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4381
        return CharacterData.of(codePoint).getDirectionality(codePoint);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4382
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4383
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4384
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4385
     * Determines whether the character is mirrored according to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4386
     * Unicode specification.  Mirrored characters should have their
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4387
     * glyphs horizontally mirrored when displayed in text that is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4388
     * right-to-left.  For example, <code>'&#92;u0028'</code> LEFT
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4389
     * PARENTHESIS is semantically defined to be an <i>opening
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4390
     * parenthesis</i>.  This will appear as a "(" in text that is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4391
     * left-to-right but as a ")" in text that is right-to-left.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4392
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4393
     * <p><b>Note:</b> This method cannot handle <a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4394
     * href="#supplementary"> supplementary characters</a>. To support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4395
     * all Unicode characters, including supplementary characters, use
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4396
     * the {@link #isMirrored(int)} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4397
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4398
     * @param  ch <code>char</code> for which the mirrored property is requested
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4399
     * @return <code>true</code> if the char is mirrored, <code>false</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4400
     *         if the <code>char</code> is not mirrored or is not defined.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4401
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4402
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4403
    public static boolean isMirrored(char ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4404
        return isMirrored((int)ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4405
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4406
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4407
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4408
     * Determines whether the specified character (Unicode code point)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4409
     * is mirrored according to the Unicode specification.  Mirrored
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4410
     * characters should have their glyphs horizontally mirrored when
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4411
     * displayed in text that is right-to-left.  For example,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4412
     * <code>'&#92;u0028'</code> LEFT PARENTHESIS is semantically
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4413
     * defined to be an <i>opening parenthesis</i>.  This will appear
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4414
     * as a "(" in text that is left-to-right but as a ")" in text
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4415
     * that is right-to-left.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4416
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4417
     * @param   codePoint the character (Unicode code point) to be tested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4418
     * @return  <code>true</code> if the character is mirrored, <code>false</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4419
     *          if the character is not mirrored or is not defined.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4420
     * @since   1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4421
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4422
    public static boolean isMirrored(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4423
        return CharacterData.of(codePoint).isMirrored(codePoint);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4424
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4425
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4426
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4427
     * Compares two <code>Character</code> objects numerically.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4428
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4429
     * @param   anotherCharacter   the <code>Character</code> to be compared.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4430
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4431
     * @return  the value <code>0</code> if the argument <code>Character</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4432
     *          is equal to this <code>Character</code>; a value less than
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4433
     *          <code>0</code> if this <code>Character</code> is numerically less
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4434
     *          than the <code>Character</code> argument; and a value greater than
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4435
     *          <code>0</code> if this <code>Character</code> is numerically greater
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4436
     *          than the <code>Character</code> argument (unsigned comparison).
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4437
     *          Note that this is strictly a numerical comparison; it is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4438
     *          locale-dependent.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4439
     * @since   1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4440
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4441
    public int compareTo(Character anotherCharacter) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4442
        return this.value - anotherCharacter.value;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4443
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4444
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4445
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4446
     * Converts the character (Unicode code point) argument to uppercase using
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4447
     * information from the UnicodeData file.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4448
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4449
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4450
     * @param   codePoint   the character (Unicode code point) to be converted.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4451
     * @return  either the uppercase equivalent of the character, if
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4452
     *          any, or an error flag (<code>Character.ERROR</code>)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4453
     *          that indicates that a 1:M <code>char</code> mapping exists.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4454
     * @see     java.lang.Character#isLowerCase(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4455
     * @see     java.lang.Character#isUpperCase(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4456
     * @see     java.lang.Character#toLowerCase(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4457
     * @see     java.lang.Character#toTitleCase(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4458
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4459
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4460
    static int toUpperCaseEx(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4461
        assert isValidCodePoint(codePoint);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4462
        return CharacterData.of(codePoint).toUpperCaseEx(codePoint);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4463
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4464
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4465
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4466
     * Converts the character (Unicode code point) argument to uppercase using case
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4467
     * mapping information from the SpecialCasing file in the Unicode
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4468
     * specification. If a character has no explicit uppercase
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4469
     * mapping, then the <code>char</code> itself is returned in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4470
     * <code>char[]</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4471
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4472
     * @param   codePoint   the character (Unicode code point) to be converted.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4473
     * @return a <code>char[]</code> with the uppercased character.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4474
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4475
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4476
    static char[] toUpperCaseCharArray(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4477
        // As of Unicode 4.0, 1:M uppercasings only happen in the BMP.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4478
        assert isValidCodePoint(codePoint) &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4479
               !isSupplementaryCodePoint(codePoint);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4480
        return CharacterData.of(codePoint).toUpperCaseCharArray(codePoint);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4481
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4482
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4483
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4484
     * The number of bits used to represent a <tt>char</tt> value in unsigned
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4485
     * binary form.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4486
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4487
     * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4488
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4489
    public static final int SIZE = 16;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4490
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4491
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4492
     * Returns the value obtained by reversing the order of the bytes in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4493
     * specified <tt>char</tt> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4494
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4495
     * @return the value obtained by reversing (or, equivalently, swapping)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4496
     *     the bytes in the specified <tt>char</tt> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4497
     * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4498
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4499
    public static char reverseBytes(char ch) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4500
        return (char) (((ch & 0xFF00) >> 8) | (ch << 8));
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4501
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4502
}