LOGIN   :::   RECOVER PASS   :::   GET ACCOUNT    
Browse
  • Projects
  • Code (CVS)
  • Forums
  • News
  • Articles
  • Polls
  •  
    OpenCores
  • FAQ
  • CVS HowTo
  • Mission
  • Media
  • Tools
  • Sponsors
  • Mirrors
  • Logos
  • Contact us
  •  
    Tools
  • Search
      
  • Download Cores (CVSGet)
  •  
    More
  • Wishbone
  • Perlilog
  • EDA tools
  • OpenTech CD
  •  
    Navigation: All forums > Cvs-checkins > Message List > Message Post

    Message

    Reply | Reply all
    Date Prev | Date Next | Thread Prev | Thread Next Date Index | Thread Index

    From: cvs at opencores.org<cvs@o...>
    Date: Sat Sep 16 23:36:27 CEST 2006
    Subject: [cvs-checkins] MODIFIED: jop ...
    Top
    Date: 00/06/09 16:23:36

    Added: jop/java/target/src/jdk/java/lang Boolean.java Byte.java
    Character.java Class.java Cloneable.java
    Comparable.java Double.java Error.java Float.java
    InternalError.java Iterable.java Long.java
    Math.java Number.java Short.java
    VirtualMachineError.java
    Log:
    towards the CLDC specification


    Revision Changes Path
    1.1 jop/java/target/src/jdk/java/lang/Boolean.java

    http://www.opencores.org/cvsweb.shtml/jop/java/target/src/jdk/java/lang/Boolean.java?rev=1.1&content-type=text/x-cvsweb-markup

    Index: Boolean.java
    ===================================================================
    /* Boolean.java -- object wrapper for boolean
    Copyright (C) 1998, 2001, 2002, 2005, 2006 Free Software Foundation, Inc.

    This file is part of GNU Classpath.

    GNU Classpath is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2, or (at your option)
    any later version.

    GNU Classpath is distributed in the hope that it will be useful, but
    WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with GNU Classpath; see the file COPYING. If not, write to the
    Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301 USA.

    Linking this library statically or dynamically with other modules is
    making a combined work based on this library. Thus, the terms and
    conditions of the GNU General Public License cover the whole
    combination.

    As a special exception, the copyright holders of this library give you
    permission to link this library with independent modules to produce an
    executable, regardless of the license terms of these independent
    modules, and to copy and distribute the resulting executable under
    terms of your choice, provided that you also meet, for each linked
    independent module, the terms and conditions of the license of that
    module. An independent module is a module which is not derived from
    or based on this library. If you modify this library, you may extend
    this exception to your version of the library, but you are not
    obligated to do so. If you do not wish to do so, delete this
    exception statement from your version. */


    package java.lang;

    import java.io.Serializable;

    /**
    * Instances of class <code>Boolean</code> represent primitive
    * <code>boolean</code> values.
    *
    * @author Paul Fisher
    * @author Eric Blake (ebb9@e...)
    * @since 1.0
    * @status updated to 1.5
    */
    public final class Boolean implements Serializable, Comparable
    {
    /**
    * Compatible with JDK 1.0.2+.
    */
    private static final long serialVersionUID = -3665804199014368530L;

    /**
    * This field is a <code>Boolean</code> object representing the
    * primitive value <code>true</code>. This instance is returned
    * by the static <code>valueOf()</code> methods if they return
    * a <code>Boolean</code> representing <code>true</code>.
    */
    public static final Boolean TRUE = new Boolean(true);

    /**
    * This field is a <code>Boolean</code> object representing the
    * primitive value <code>false</code>. This instance is returned
    * by the static <code>valueOf()</code> methods if they return
    * a <code>Boolean</code> representing <code>false</code>.
    */
    public static final Boolean FALSE = new Boolean(false);

    /**
    * The primitive type <code>boolean</code> is represented by this
    * <code>Class</code> object.
    *
    * @since 1.1
    */
    // public static final Class TYPE = VMClassLoader.getPrimitiveClass('Z');

    /**
    * The immutable value of this Boolean. * @serial the wrapped value */ private final boolean value; /** * Create a <code>Boolean</code> object representing the value of the * argument <code>value</code>. In general the use of the static * method <code>valueof(boolean)</code> is more efficient since it will * not create a new object. * * @param value the primitive value of this <code>Boolean</code> * @see #valueOf(boolean) */ public Boolean(boolean value) { this.value = value; } /** * Creates a <code>Boolean</code> object representing the primitive * <code>true</code> if and only if <code>s</code> matches * the string "true" ignoring case, otherwise the object will represent * the primitive <code>false</code>. In general the use of the static * method <code>valueof(String)</code> is more efficient since it will * not create a new object. * * @param s the <code>String</code> representation of <code>true</code> * or false */ public Boolean(String s) { value = "true".equalsIgnoreCase(s); } /** * Return the primitive <code>boolean</code> value of this * <code>Boolean</code> object. * * @return true or false, depending on the value of this Boolean */ public boolean booleanValue() { return value; } /** * Returns the Boolean <code>TRUE</code> if the given boolean is * <code>true</code>, otherwise it will return the Boolean * <code>FALSE</code>. * * @param b the boolean to wrap * @return the wrapper object * @see #TRUE * @see #FALSE * @since 1.4 */ public static Boolean valueOf(boolean b) { return b ? TRUE : FALSE; } /** * Returns the Boolean <code>TRUE</code> if and only if the given * String is equal, ignoring case, to the the String "true", otherwise * it will return the Boolean <code>FALSE</code>. * * @param s the string to convert * @return a wrapped boolean from the string */ public static Boolean valueOf(String s) { return "true".equalsIgnoreCase(s) ? TRUE : FALSE; } /** * Returns "true" if the value of the give boolean is <code>true</code> and * returns "false" if the value of the given boolean is <code>false</code>. * * @param b the boolean to convert * @return the string representation of the boolean * @since 1.4 */ public static String toString(boolean b) { return b ? "true" : "false"; } /** * Returns "true" if the value of this object is <code>true</code> and * returns "false" if the value of this object is <code>false</code>. * * @return the string representation of this */ public String toString() { return value ? "true" : "false"; } /** * Returns the integer <code>1231</code> if this object represents * the primitive <code>true</code> and the integer <code>1237</code> * otherwise. * * @return the hash code */ public int hashCode() { return value ? 1231 : 1237; } /** * If the <code>obj</code> is an instance of <code>Boolean</code> and * has the same primitive value as this object then <code>true</code> * is returned. In all other cases, including if the <code>obj</code> * is <code>null</code>, <code>false</code> is returned. * * @param obj possibly an instance of any <code>Class</code> * @return true if <code>obj</code> equals this */ public boolean equals(Object obj) { return obj instanceof Boolean && value == ((Boolean) obj).value; } /** * If the value of the system property <code>name</code> matches * "true" ignoring case then the function returns <code>true</code>. * * @param name the property name to look up * @return true if the property resulted in "true" * @throws SecurityException if accessing the system property is forbidden * @see System#getProperty(String) */ public static boolean getBoolean(String name) { if (name == null || "".equals(name)) return false; return "true".equalsIgnoreCase(System.getProperty(name)); } /** * Compares this Boolean to another. * * @param other the Boolean to compare this Boolean to * @return 0 if both Booleans represent the same value, a positive number * if this Boolean represents true and the other false, and a negative * number otherwise. * @since 1.5 */ public int compareTo(Boolean other) { return value == other.value ? 0 : (value ? 1 : -1); } /** * Bridge method */ public int compareTo(Object other) { return compareTo((Boolean)other); } /** * If the String argument is "true", ignoring case, return true. * Otherwise, return false. * * @param b String to parse * @since 1.5 */ public static boolean parseBoolean(String b) { return "true".equalsIgnoreCase(b) ? true : false; } } 1.1 jop/java/target/src/jdk/java/lang/Byte.java http://www.opencores.org/cvsweb.shtml/jop/java/target/src/jdk/java/lang/Byte.java?rev=1.1&content-type=text/x-cvsweb-markup Index: Byte.java =================================================================== /* Byte.java -- object wrapper for byte Copyright (C) 1998, 2001, 2002, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Classpath; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package java.lang; /** * Instances of class <code>Byte</code> represent primitive <code>byte</code> * values. * * Additionally, this class provides various helper functions and variables * useful to bytes. * * @author Paul Fisher * @author John Keiser * @author Per Bothner * @author Eric Blake (ebb9@e...) * @since 1.1 * @status updated to 1.5 */ public final class Byte extends Number implements Comparable { /** * Compatible with JDK 1.1+. */ private static final long serialVersionUID = -7183698231559129828L; /** * The minimum value a <code>byte</code> can represent is -128 (or * -2<sup>7</sup>). */ public static final byte MIN_VALUE = -128; /** * The maximum value a <code>byte</code> can represent is 127 (or * 2<sup>7</sup> - 1). */ public static final byte MAX_VALUE = 127; /** * The primitive type <code>byte</code> is represented by this * <code>Class</code> object. */ // public static final Class TYPE = VMClassLoader.getPrimitiveClass('B'); /** * The number of bits needed to represent a <code>byte</code>. * @since 1.5 */ public static final int SIZE = 8; // This caches Byte values, and is used by boxing conversions via // valueOf(). We're required to cache all possible values here. private static Byte[] byteCache = new Byte[MAX_VALUE - MIN_VALUE + 1]; /** * The immutable value of this Byte. * * @serial the wrapped byte */ private final byte value; /** * Create a <code>Byte</code> object representing the value of the * <code>byte</code> argument. * * @param value the value to use */ public Byte(byte value) { this.value = value; } /** * Create a <code>Byte</code> object representing the value specified * by the <code>String</code> argument * * @param s the string to convert * @throws NumberFormatException if the String does not contain a byte * @see #valueOf(String) */ public Byte(String s) { value = parseByte(s, 10); } /** * Converts the <code>byte</code> to a <code>String</code> and assumes * a radix of 10. * * @param b the <code>byte</code> to convert to <code>String</code> * @return the <code>String</code> representation of the argument */ public static String toString(byte b) { throw new Error("NYI"); // return String.valueOf(b); } /** * Converts the specified <code>String</code> into a <code>byte</code>. * This function assumes a radix of 10. * * @param s the <code>String</code> to convert * @return the <code>byte</code> value of <code>s</code> * @throws NumberFormatException if <code>s</code> cannot be parsed as a * <code>byte</code> * @see #parseByte(String) */ public static byte parseByte(String s) { return parseByte(s, 10); } /** * Converts the specified <code>String</code> into an <code>int</code> * using the specified radix (base). The string must not be <code>null</code> * or empty. It may begin with an optional '-', which will negate the answer, * provided that there are also valid digits. Each digit is parsed as if by * <code>Character.digit(d, radix)</code>, and must be in the range * <code>0</code> to <code>radix - 1</code>. Finally, the result must be * within <code>MIN_VALUE</code> to <code>MAX_VALUE</code>, inclusive. * Unlike Double.parseDouble, you may not have a leading '+'. * * @param s the <code>String</code> to convert * @param radix the radix (base) to use in the conversion * @return the <code>String</code> argument converted to <code>byte</code> * @throws NumberFormatException if <code>s</code> cannot be parsed as a * <code>byte</code> */ public static byte parseByte(String s, int radix) { throw new Error("NYI"); // int i = Integer.parseInt(s, radix, false); // if ((byte) i != i) // throw new NumberFormatException(); // return (byte) i; } /** * Creates a new <code>Byte</code> object using the <code>String</code> * and specified radix (base). * * @param s the <code>String</code> to convert * @param radix the radix (base) to convert with * @return the new <code>Byte</code> * @throws NumberFormatException if <code>s</code> cannot be parsed as a * <code>byte</code> * @see #parseByte(String, int) */ public static Byte valueOf(String s, int radix) { return new Byte(parseByte(s, radix)); } /** * Creates a new <code>Byte</code> object using the <code>String</code>, * assuming a radix of 10. * * @param s the <code>String</code> to convert * @return the new <code>Byte</code> * @throws NumberFormatException if <code>s</code> cannot be parsed as a * <code>byte</code> * @see #Byte(String) * @see #parseByte(String) */ public static Byte valueOf(String s) { return new Byte(parseByte(s, 10)); } /** * Returns a <code>Byte</code> object wrapping the value. * In contrast to the <code>Byte</code> constructor, this method * will cache some values. It is used by boxing conversion. * * @param val the value to wrap * @return the <code>Byte</code> * * @since 1.5 */ public static Byte valueOf(byte val) { synchronized (byteCache) { if (byteCache[val - MIN_VALUE] == null) byteCache[val - MIN_VALUE] = new Byte(val); return byteCache[val - MIN_VALUE]; } } /** * Convert the specified <code>String</code> into a <code>Byte</code>. * The <code>String</code> may represent decimal, hexadecimal, or * octal numbers. * * <p>The extended BNF grammar is as follows:<br> * <pre> * <em>DecodableString</em>: * ( [ <code>-</code> ] <em>DecimalNumber</em> ) * | ( [ <code>-</code> ] ( <code>0x</code> | <code>0X</code> * | <code>#</code> ) { <em>HexDigit</em> }+ ) * | ( [ <code>-</code> ] <code>0</code> { <em>OctalDigit</em> } ) * <em>DecimalNumber</em>: * <em>DecimalDigit except '0'</em> { <em>DecimalDigit</em> } * <em>DecimalDigit</em>: * <em>Character.digit(d, 10) has value 0 to 9</em> * <em>OctalDigit</em>: * <em>Character.digit(d, 8) has value 0 to 7</em> * <em>DecimalDigit</em>: * <em>Character.digit(d, 16) has value 0 to 15</em> * </pre> * Finally, the value must be in the range <code>MIN_VALUE</code> to * <code>MAX_VALUE</code>, or an exception is thrown. * * @param s the <code>String</code> to interpret * @return the value of the String as a <code>Byte</code> * @throws NumberFormatException if <code>s</code> cannot be parsed as a * <code>byte</code> * @throws NullPointerException if <code>s</code> is null * @see Integer#decode(String) */ public static Byte decode(String s) { throw new Error("NYI"); // int i = Integer.parseInt(s, 10, true); // if ((byte) i != i) // throw new NumberFormatException(); // return new Byte((byte) i); } /** * Return the value of this <code>Byte</code>. * * @return the byte value */ public byte byteValue() { return value; } /** * Return the value of this <code>Byte</code> as a <code>short</code>. * * @return the short value */ public short shortValue() { return value; } /** * Return the value of this <code>Byte</code> as an <code>int</code>. * * @return the int value */ public int intValue() { return value; } /** * Return the value of this <code>Byte</code> as a <code>long</code>. * * @return the long value */ public long longValue() { return value; } /** * Return the value of this <code>Byte</code> as a <code>float</code>. * * @return the float value */ public float floatValue() { return value; } /** * Return the value of this <code>Byte</code> as a <code>double</code>. * * @return the double value */ public double doubleValue() { return value; } /** * Converts the <code>Byte</code> value to a <code>String</code> and * assumes a radix of 10. * * @return the <code>String</code> representation of this <code>Byte</code> * @see Integer#toString() */ public String toString() { throw new Error("NYI"); // return String.valueOf(value); } /** * Return a hashcode representing this Object. <code>Byte</code>'s hash * code is simply its value. * * @return this Object's hash code */ public int hashCode() { return value; } /** * Returns <code>true</code> if <code>obj</code> is an instance of * <code>Byte</code> and represents the same byte value. * * @param obj the object to compare * @return whether these Objects are semantically equal */ public boolean equals(Object obj) { return obj instanceof Byte && value == ((Byte) obj).value; } /** * Compare two Bytes numerically by comparing their <code>byte</code> values. * The result is positive if the first is greater, negative if the second * is greater, and 0 if the two are equal. * * @param b the Byte to compare * @return the comparison * @since 1.2 */ public int compareTo(Byte b) { return value - b.value; } /** * Behaves like <code>compareTo(Byte)</code> unless the Object * is not a <code>Byte</code>. * * @param o the object to compare * @return the comparison * @throws ClassCastException if the argument is not a <code>Byte</code> * @see #compareTo(Byte) * @see Comparable * @since 1.2 */ public int compareTo(Object o) { return compareTo((Byte) o); } } 1.1 jop/java/target/src/jdk/java/lang/Character.java http://www.opencores.org/cvsweb.shtml/jop/java/target/src/jdk/java/lang/Character.java?rev=1.1&content-type=text/x-cvsweb-markup Index: Character.java =================================================================== /* java.lang.Character -- Wrapper class for char, and Unicode subsets Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Classpath; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package java.lang; //import gnu.java.lang.CharData; import java.io.Serializable; //import java.text.Collator; //import java.util.Locale; /** * Wrapper class for the primitive char data type. In addition, this class * allows one to retrieve property information and perform transformations * on the defined characters in the Unicode Standard, Version 4.0.0. * java.lang.Character is designed to be very dynamic, and as such, it * retrieves information on the Unicode character set from a separate * database, gnu.java.lang.CharData, which can be easily upgraded. * * <p>For predicates, boundaries are used to describe * the set of characters for which the method will return true. * This syntax uses fairly normal regular expression notation. * See 5.13 of the Unicode Standard, Version 4.0, for the * boundary specification. * * <p>See <a href="http://www.unicode.org">http://www.unicode.org</a> * for more information on the Unicode Standard. * * @author Tom Tromey (tromey@c...) * @author Paul N. Fisher * @author Jochen Hoenicke * @author Eric Blake (ebb9@e...) * @see CharData * @since 1.0 * @status updated to 1.4 */ public final class Character implements Serializable, Comparable { /** * A subset of Unicode blocks. * * @author Paul N. Fisher * @author Eric Blake (ebb9@e...) * @since 1.2 */ public static class Subset { /** The name of the subset. */ private final String name; /** * Construct a new subset of characters. * * @param name the name of the subset * @throws NullPointerException if name is null */ protected Subset(String name) { // Note that name.toString() is name, unless name was null. this.name = name.toString(); } /** * Compares two Subsets for equality. This is <code>final</code>, and * restricts the comparison on the <code>==</code> operator, so it returns * true only for the same object. * * @param o the object to compare * @return true if o is this */ public final boolean equals(Object o) { return o == this; } /** * Makes the original hashCode of Object final, to be consistent with * equals. * * @return the hash code for this object */ public final int hashCode() { return super.hashCode(); } /** * Returns the name of the subset. * * @return the name */ public final String toString() { return name; } } // class Subset /** * A family of character subsets in the Unicode specification. A character * is in at most one of these blocks. * * This inner class was generated automatically from * <code>doc/unicode/Blocks-4.0.0.txt</code>, by some perl scripts. * This Unicode definition file can be found on the * <a href="http://www.unicode.org">http://www.unicode.org</a> website. * JDK 1.5 uses Unicode version 4.0.0. * * @author scripts/unicode-blocks.pl (written by Eric Blake) * @since 1.2 */ public static final class UnicodeBlock extends Subset { /** The start of the subset. */ private final int start; /** The end of the subset. */ private final int end; /** The canonical name of the block according to the Unicode standard. */ private final String canonicalName; /** Constants for the <code>forName()</code> method */ private static final int CANONICAL_NAME = 0; private static final int NO_SPACES_NAME = 1; private static final int CONSTANT_NAME = 2; /** * Constructor for strictly defined blocks. * * @param start the start character of the range * @param end the end character of the range * @param name the block name * @param canonicalName the name of the block as defined in the Unicode * standard. */ private UnicodeBlock(int start, int end, String name, String canonicalName) { super(name); this.start = start; this.end = end; this.canonicalName = canonicalName; } /** * Returns the Unicode character block which a character belongs to. * <strong>Note</strong>: This method does not support the use of * supplementary characters. For such support, <code>of(int)</code> * should be used instead. * * @param ch the character to look up * @return the set it belongs to, or null if it is not in one */ public static UnicodeBlock of(char ch) { return of((int) ch); } /** * Returns the Unicode character block which a code point belongs to. * * @param codePoint the character to look up * @return the set it belongs to, or null if it is not in one. * @throws IllegalArgumentException if the specified code point is * invalid. * @since 1.5 */ public static UnicodeBlock of(int codePoint) { throw new Error("NYI"); // if (codePoint > MAX_CODE_POINT) // throw new IllegalArgumentException("The supplied integer value is " + // "too large to be a codepoint."); // // Simple binary search for the correct block. // int low = 0; // int hi = sets.length - 1; // while (low <= hi) // { // int mid = (low + hi) >> 1; // UnicodeBlock b = sets[mid]; // if (codePoint < b.start) // hi = mid - 1; // else if (codePoint > b.end) // low = mid + 1; // else // return b; // } // return null; } /** * <p> * Returns the <code>UnicodeBlock</code> with the given name, as defined * by the Unicode standard. The version of Unicode in use is defined by * the <code>Character</code> class, and the names are given in the * <code>Blocks-<version>.txt</code> file corresponding to that version. * The name may be specified in one of three ways: * </p> * <ol> * <li>The canonical, human-readable name used by the Unicode standard. * This is the name with all spaces and hyphens retained. For example, * `Basic Latin' retrieves the block, UnicodeBlock.BASIC_LATIN.</li> * <li>The canonical name with all spaces removed e.g. `BasicLatin'.</li> * <li>The name used for the constants specified by this class, which * is the canonical name with all spaces and hyphens replaced with * underscores e.g. `BASIC_LATIN'</li> * </ol> * <p> * The names are compared case-insensitively using the case comparison * associated with the U.S. English locale. The method recognises the * previous names used for blocks as well as the current ones. At * present, this simply means that the deprecated `SURROGATES_AREA' * will be recognised by this method (the <code>of()</code> methods * only return one of the three new surrogate blocks). * </p> * * @param blockName the name of the block to look up. * @return the specified block. * @throws NullPointerException if the <code>blockName</code> is * <code>null</code>. * @throws IllegalArgumentException if the name does not match any Unicode * block. * @since 1.5 */ // public static final UnicodeBlock forName(String blockName) // { // int type; // if (blockName.indexOf(' ') != -1) // type = CANONICAL_NAME; // else if (blockName.indexOf('_') != -1) // type = CONSTANT_NAME; // else // type = NO_SPACES_NAME; // Collator usCollator = Collator.getInstance(Locale.US); // usCollator.setStrength(Collator.PRIMARY); // /* Special case for deprecated blocks not in sets */ // switch (type) // { // case CANONICAL_NAME: // if (usCollator.compare(blockName, "Surrogates Area") == 0) // return SURROGATES_AREA; // break; // case NO_SPACES_NAME: // if (usCollator.compare(blockName, "SurrogatesArea") == 0) // return SURROGATES_AREA; // break; // case CONSTANT_NAME: // if (usCollator.compare(blockName, "SURROGATES_AREA") == 0) // return SURROGATES_AREA; // break; // } // /* Other cases */ // int setLength = sets.length; // switch (type) // { // case CANONICAL_NAME: // for (int i = 0; i < setLength; i++) // { // UnicodeBlock block = sets[i]; // if (usCollator.compare(blockName, block.canonicalName) == 0) // return block; // } // break; // case NO_SPACES_NAME: // for (int i = 0; i < setLength; i++) // { // UnicodeBlock block = sets[i]; // String nsName = block.canonicalName.replaceAll(" ",""); // if (usCollator.compare(blockName, nsName) == 0) // return block; // } // break; // case CONSTANT_NAME: // for (int i = 0; i < setLength; i++) // { // UnicodeBlock block = sets[i]; // if (usCollator.compare(blockName, block.toString()) == 0) // return block; // } // break; // } // throw new IllegalArgumentException("No Unicode block found for " + // blockName + "."); // } /** * Basic Latin. * 0x0000 - 0x007F. */ // public static final UnicodeBlock BASIC_LATIN // = new UnicodeBlock(0x0000, 0x007F, // "BASIC_LATIN", // "Basic Latin"); // // /** // * Latin-1 Supplement. // * 0x0080 - 0x00FF. // */ // public static final UnicodeBlock LATIN_1_SUPPLEMENT // = new UnicodeBlock(0x0080, 0x00FF, // "LATIN_1_SUPPLEMENT", // "Latin-1 Supplement"); // // /** // * Latin Extended-A. // * 0x0100 - 0x017F. // */ // public static final UnicodeBlock LATIN_EXTENDED_A // = new UnicodeBlock(0x0100, 0x017F, // "LATIN_EXTENDED_A", // "Latin Extended-A"); // // /** // * Latin Extended-B. // * 0x0180 - 0x024F. // */ // public static final UnicodeBlock LATIN_EXTENDED_B // = new UnicodeBlock(0x0180, 0x024F, // "LATIN_EXTENDED_B", // "Latin Extended-B"); // // /** // * IPA Extensions. // * 0x0250 - 0x02AF. // */ // public static final UnicodeBlock IPA_EXTENSIONS // = new UnicodeBlock(0x0250, 0x02AF, // "IPA_EXTENSIONS", // "IPA Extensions"); // // /** // * Spacing Modifier Letters. // * 0x02B0 - 0x02FF. // */ // public static final UnicodeBlock SPACING_MODIFIER_LETTERS // = new UnicodeBlock(0x02B0, 0x02FF, // "SPACING_MODIFIER_LETTERS", // "Spacing Modifier Letters"); // // /** // * Combining Diacritical Marks. // * 0x0300 - 0x036F. // */ // public static final UnicodeBlock COMBINING_DIACRITICAL_MARKS // = new UnicodeBlock(0x0300, 0x036F, // "COMBINING_DIACRITICAL_MARKS", // "Combining Diacritical Marks"); // // /** // * Greek. // * 0x0370 - 0x03FF. // */ // public static final UnicodeBlock GREEK // = new UnicodeBlock(0x0370, 0x03FF, // "GREEK", // "Greek"); // // /** // * Cyrillic. // * 0x0400 - 0x04FF. // */ // public static final UnicodeBlock CYRILLIC // = new UnicodeBlock(0x0400, 0x04FF, // "CYRILLIC", // "Cyrillic"); // // /** // * Cyrillic Supplementary. // * 0x0500 - 0x052F. // * @since 1.5 // */ // public static final UnicodeBlock CYRILLIC_SUPPLEMENTARY // = new UnicodeBlock(0x0500, 0x052F, // "CYRILLIC_SUPPLEMENTARY", // "Cyrillic Supplementary"); // // /** // * Armenian. // * 0x0530 - 0x058F. // */ // public static final UnicodeBlock ARMENIAN // = new UnicodeBlock(0x0530, 0x058F, // "ARMENIAN", // "Armenian"); // // /** // * Hebrew. // * 0x0590 - 0x05FF. // */ // public static final UnicodeBlock HEBREW // = new UnicodeBlock(0x0590, 0x05FF, // "HEBREW", // "Hebrew"); // // /** // * Arabic. // * 0x0600 - 0x06FF. // */ // public static final UnicodeBlock ARABIC // = new UnicodeBlock(0x0600, 0x06FF, // "ARABIC", // "Arabic"); // // /** // * Syriac. // * 0x0700 - 0x074F. // * @since 1.4 // */ // public static final UnicodeBlock SYRIAC // = new UnicodeBlock(0x0700, 0x074F, // "SYRIAC", // "Syriac"); // // /** // * Thaana. // * 0x0780 - 0x07BF. // * @since 1.4 // */ // public static final UnicodeBlock THAANA // = new UnicodeBlock(0x0780, 0x07BF, // "THAANA", // "Thaana"); // // /** // * Devanagari. // * 0x0900 - 0x097F. // */ // public static final UnicodeBlock DEVANAGARI // = new UnicodeBlock(0x0900, 0x097F, // "DEVANAGARI", // "Devanagari"); // // /** // * Bengali. // * 0x0980 - 0x09FF. // */ // public static final UnicodeBlock BENGALI // = new UnicodeBlock(0x0980, 0x09FF, // "BENGALI", // "Bengali"); // // /** // * Gurmukhi. // * 0x0A00 - 0x0A7F. // */ // public static final UnicodeBlock GURMUKHI // = new UnicodeBlock(0x0A00, 0x0A7F, // "GURMUKHI", // "Gurmukhi"); // // /** // * Gujarati. // * 0x0A80 - 0x0AFF. // */ // public static final UnicodeBlock GUJARATI // = new UnicodeBlock(0x0A80, 0x0AFF, // "GUJARATI", // "Gujarati"); // // /** // * Oriya. // * 0x0B00 - 0x0B7F. // */ // public static final UnicodeBlock ORIYA // = new UnicodeBlock(0x0B00, 0x0B7F, // "ORIYA", // "Oriya"); // // /** // * Tamil. // * 0x0B80 - 0x0BFF. // */ // public static final UnicodeBlock TAMIL // = new UnicodeBlock(0x0B80, 0x0BFF, // "TAMIL", // "Tamil"); // // /** // * Telugu. // * 0x0C00 - 0x0C7F. // */ // public static final UnicodeBlock TELUGU // = new UnicodeBlock(0x0C00, 0x0C7F, // "TELUGU", // "Telugu"); // // /** // * Kannada. // * 0x0C80 - 0x0CFF. // */ // public static final UnicodeBlock KANNADA // = new UnicodeBlock(0x0C80, 0x0CFF, // "KANNADA", // "Kannada"); // // /** // * Malayalam. // * 0x0D00 - 0x0D7F. // */ // public static final UnicodeBlock MALAYALAM // = new UnicodeBlock(0x0D00, 0x0D7F, // "MALAYALAM", // "Malayalam"); // // /** // * Sinhala. // * 0x0D80 - 0x0DFF. // * @since 1.4 // */ // public static final UnicodeBlock SINHALA // = new UnicodeBlock(0x0D80, 0x0DFF, // "SINHALA", // "Sinhala"); // // /** // * Thai. // * 0x0E00 - 0x0E7F. // */ // public static final UnicodeBlock THAI // = new UnicodeBlock(0x0E00, 0x0E7F, // "THAI", // "Thai"); // // /** // * Lao. // * 0x0E80 - 0x0EFF. // */ // public static final UnicodeBlock LAO // = new UnicodeBlock(0x0E80, 0x0EFF, // "LAO", // "Lao"); // // /** // * Tibetan. // * 0x0F00 - 0x0FFF. // */ // public static final UnicodeBlock TIBETAN // = new UnicodeBlock(0x0F00, 0x0FFF, // "TIBETAN", // "Tibetan"); // // /** // * Myanmar. // * 0x1000 - 0x109F. // * @since 1.4 // */ // public static final UnicodeBlock MYANMAR // = new UnicodeBlock(0x1000, 0x109F, // "MYANMAR", // "Myanmar"); // // /** // * Georgian. // * 0x10A0 - 0x10FF. // */ // public static final UnicodeBlock GEORGIAN // = new UnicodeBlock(0x10A0, 0x10FF, // "GEORGIAN", // "Georgian"); // // /** // * Hangul Jamo. // * 0x1100 - 0x11FF. // */ // public static final UnicodeBlock HANGUL_JAMO // = new UnicodeBlock(0x1100, 0x11FF, // "HANGUL_JAMO", // "Hangul Jamo"); // // /** // * Ethiopic. // * 0x1200 - 0x137F. // * @since 1.4 // */ // public static final UnicodeBlock ETHIOPIC // = new UnicodeBlock(0x1200, 0x137F, // "ETHIOPIC", // "Ethiopic"); // // /** // * Cherokee. // * 0x13A0 - 0x13FF. // * @since 1.4 // */ // public static final UnicodeBlock CHEROKEE // = new UnicodeBlock(0x13A0, 0x13FF, // "CHEROKEE", // "Cherokee"); // // /** // * Unified Canadian Aboriginal Syllabics. // * 0x1400 - 0x167F. // * @since 1.4 // */ // public static final UnicodeBlock UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS // = new UnicodeBlock(0x1400, 0x167F, // "UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS", // "Unified Canadian Aboriginal Syllabics"); // // /** // * Ogham. // * 0x1680 - 0x169F. // * @since 1.4 // */ // public static final UnicodeBlock OGHAM // = new UnicodeBlock(0x1680, 0x169F, // "OGHAM", // "Ogham"); // // /** // * Runic. // * 0x16A0 - 0x16FF. // * @since 1.4 // */ // public static final UnicodeBlock RUNIC // = new UnicodeBlock(0x16A0, 0x16FF, // "RUNIC", // "Runic"); // // /** // * Tagalog. // * 0x1700 - 0x171F. // * @since 1.5 // */ // public static final UnicodeBlock TAGALOG // = new UnicodeBlock(0x1700, 0x171F, // "TAGALOG", // "Tagalog"); // // /** // * Hanunoo. // * 0x1720 - 0x173F. // * @since 1.5 // */ // public static final UnicodeBlock HANUNOO // = new UnicodeBlock(0x1720, 0x173F, // "HANUNOO", // "Hanunoo"); // // /** // * Buhid. // * 0x1740 - 0x175F. // * @since 1.5 // */ // public static final UnicodeBlock BUHID // = new UnicodeBlock(0x1740, 0x175F, // "BUHID", // "Buhid"); // // /** // * Tagbanwa. // * 0x1760 - 0x177F. // * @since 1.5 // */ // public static final UnicodeBlock TAGBANWA // = new UnicodeBlock(0x1760, 0x177F, // "TAGBANWA", // "Tagbanwa"); // // /** // * Khmer. // * 0x1780 - 0x17FF. // * @since 1.4 // */ // public static final UnicodeBlock KHMER // = new UnicodeBlock(0x1780, 0x17FF, // "KHMER", // "Khmer"); // // /** // * Mongolian. // * 0x1800 - 0x18AF. // * @since 1.4 // */ // public static final UnicodeBlock MONGOLIAN // = new UnicodeBlock(0x1800, 0x18AF, // "MONGOLIAN", // "Mongolian"); // // /** // * Limbu. // * 0x1900 - 0x194F. // * @since 1.5 // */ // public static final UnicodeBlock LIMBU // = new UnicodeBlock(0x1900, 0x194F, // "LIMBU", // "Limbu"); // // /** // * Tai Le. // * 0x1950 - 0x197F. // * @since 1.5 // */ // public static final UnicodeBlock TAI_LE // = new UnicodeBlock(0x1950, 0x197F, // "TAI_LE", // "Tai Le"); // // /** // * Khmer Symbols. // * 0x19E0 - 0x19FF. // * @since 1.5 // */ // public static final UnicodeBlock KHMER_SYMBOLS // = new UnicodeBlock(0x19E0, 0x19FF, // "KHMER_SYMBOLS", // "Khmer Symbols"); // // /** // * Phonetic Extensions. // * 0x1D00 - 0x1D7F. // * @since 1.5 // */ // public static final UnicodeBlock PHONETIC_EXTENSIONS // = new UnicodeBlock(0x1D00, 0x1D7F, // "PHONETIC_EXTENSIONS", // "Phonetic Extensions"); // // /** // * Latin Extended Additional. // * 0x1E00 - 0x1EFF. // */ // public static final UnicodeBlock LATIN_EXTENDED_ADDITIONAL // = new UnicodeBlock(0x1E00, 0x1EFF, // "LATIN_EXTENDED_ADDITIONAL", // "Latin Extended Additional"); // // /** // * Greek Extended. // * 0x1F00 - 0x1FFF. // */ // public static final UnicodeBlock GREEK_EXTENDED // = new UnicodeBlock(0x1F00, 0x1FFF, // "GREEK_EXTENDED", // "Greek Extended"); // // /** // * General Punctuation. // * 0x2000 - 0x206F. // */ // public static final UnicodeBlock GENERAL_PUNCTUATION // = new UnicodeBlock(0x2000, 0x206F, // "GENERAL_PUNCTUATION", // "General Punctuation"); // // /** // * Superscripts and Subscripts. // * 0x2070 - 0x209F. // */ // public static final UnicodeBlock SUPERSCRIPTS_AND_SUBSCRIPTS // = new UnicodeBlock(0x2070, 0x209F, // "SUPERSCRIPTS_AND_SUBSCRIPTS", // "Superscripts and Subscripts"); // // /** // * Currency Symbols. // * 0x20A0 - 0x20CF. // */ // public static final UnicodeBlock CURRENCY_SYMBOLS // = new UnicodeBlock(0x20A0, 0x20CF, // "CURRENCY_SYMBOLS", // "Currency Symbols"); // // /** // * Combining Marks for Symbols. // * 0x20D0 - 0x20FF. // */ // public static final UnicodeBlock COMBINING_MARKS_FOR_SYMBOLS // = new UnicodeBlock(0x20D0, 0x20FF, // "COMBINING_MARKS_FOR_SYMBOLS", // "Combining Marks for Symbols"); // // /** // * Letterlike Symbols. // * 0x2100 - 0x214F. // */ // public static final UnicodeBlock LETTERLIKE_SYMBOLS // = new UnicodeBlock(0x2100, 0x214F, // "LETTERLIKE_SYMBOLS", // "Letterlike Symbols"); // // /** // * Number Forms. // * 0x2150 - 0x218F. // */ // public static final UnicodeBlock NUMBER_FORMS // = new UnicodeBlock(0x2150, 0x218F, // "NUMBER_FORMS", // "Number Forms"); // // /** // * Arrows. // * 0x2190 - 0x21FF. // */ // public static final UnicodeBlock ARROWS // = new UnicodeBlock(0x2190, 0x21FF, // "ARROWS", // "Arrows"); // // /** // * Mathematical Operators. // * 0x2200 - 0x22FF. // */ // public static final UnicodeBlock MATHEMATICAL_OPERATORS // = new UnicodeBlock(0x2200, 0x22FF, // "MATHEMATICAL_OPERATORS", // "Mathematical Operators"); // // /** // * Miscellaneous Technical. // * 0x2300 - 0x23FF. // */ // public static final UnicodeBlock MISCELLANEOUS_TECHNICAL // = new UnicodeBlock(0x2300, 0x23FF, // "MISCELLANEOUS_TECHNICAL", // "Miscellaneous Technical"); // // /** // * Control Pictures. // * 0x2400 - 0x243F. // */ // public static final UnicodeBlock CONTROL_PICTURES // = new UnicodeBlock(0x2400, 0x243F, // "CONTROL_PICTURES", // "Control Pictures"); // // /** // * Optical Character Recognition. // * 0x2440 - 0x245F. // */ // public static final UnicodeBlock OPTICAL_CHARACTER_RECOGNITION // = new UnicodeBlock(0x2440, 0x245F, // "OPTICAL_CHARACTER_RECOGNITION", // "Optical Character Recognition"); // // /** // * Enclosed Alphanumerics. // * 0x2460 - 0x24FF. // */ // public static final UnicodeBlock ENCLOSED_ALPHANUMERICS // = new UnicodeBlock(0x2460, 0x24FF, // "ENCLOSED_ALPHANUMERICS", // "Enclosed Alphanumerics"); // // /** // * Box Drawing. // * 0x2500 - 0x257F. // */ // public static final UnicodeBlock BOX_DRAWING // = new UnicodeBlock(0x2500, 0x257F, // "BOX_DRAWING", // "Box Drawing"); // // /** // * Block Elements. // * 0x2580 - 0x259F. // */ // public static final UnicodeBlock BLOCK_ELEMENTS // = new UnicodeBlock(0x2580, 0x259F, // "BLOCK_ELEMENTS", // "Block Elements"); // // /** // * Geometric Shapes. // * 0x25A0 - 0x25FF. // */ // public static final UnicodeBlock GEOMETRIC_SHAPES // = new UnicodeBlock(0x25A0, 0x25FF, // "GEOMETRIC_SHAPES", // "Geometric Shapes"); // // /** // * Miscellaneous Symbols. // * 0x2600 - 0x26FF. // */ // public static final UnicodeBlock MISCELLANEOUS_SYMBOLS // = new UnicodeBlock(0x2600, 0x26FF, // "MISCELLANEOUS_SYMBOLS", // "Miscellaneous Symbols"); // // /** // * Dingbats. // * 0x2700 - 0x27BF. // */ // public static final UnicodeBlock DINGBATS // = new UnicodeBlock(0x2700, 0x27BF, // "DINGBATS", // "Dingbats"); // // /** // * Miscellaneous Mathematical Symbols-A. // * 0x27C0 - 0x27EF. // * @since 1.5 // */ // public static final UnicodeBlock MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A // = new UnicodeBlock(0x27C0, 0x27EF, // "MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A", // "Miscellaneous Mathematical Symbols-A"); // // /** // * Supplemental Arrows-A. // * 0x27F0 - 0x27FF. // * @since 1.5 // */ // public static final UnicodeBlock SUPPLEMENTAL_ARROWS_A // = new UnicodeBlock(0x27F0, 0x27FF, // "SUPPLEMENTAL_ARROWS_A", // "Supplemental Arrows-A"); // // /** // * Braille Patterns. // * 0x2800 - 0x28FF. // * @since 1.4 // */ // public static final UnicodeBlock BRAILLE_PATTERNS // = new UnicodeBlock(0x2800, 0x28FF, // "BRAILLE_PATTERNS", // "Braille Patterns"); // // /** // * Supplemental Arrows-B. // * 0x2900 - 0x297F. // * @since 1.5 // */ // public static final UnicodeBlock SUPPLEMENTAL_ARROWS_B // = new UnicodeBlock(0x2900, 0x297F, // "SUPPLEMENTAL_ARROWS_B", // "Supplemental Arrows-B"); // // /** // * Miscellaneous Mathematical Symbols-B. // * 0x2980 - 0x29FF. // * @since 1.5 // */ // public static final UnicodeBlock MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B // = new UnicodeBlock(0x2980, 0x29FF, // "MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B", // "Miscellaneous Mathematical Symbols-B"); // // /** // * Supplemental Mathematical Operators. // * 0x2A00 - 0x2AFF. // * @since 1.5 // */ // public static final UnicodeBlock SUPPLEMENTAL_MATHEMATICAL_OPERATORS // = new UnicodeBlock(0x2A00, 0x2AFF, // "SUPPLEMENTAL_MATHEMATICAL_OPERATORS", // "Supplemental Mathematical Operators"); // // /** // * Miscellaneous Symbols and Arrows. // * 0x2B00 - 0x2BFF. // * @since 1.5 // */ // public static final UnicodeBlock MISCELLANEOUS_SYMBOLS_AND_ARROWS // = new UnicodeBlock(0x2B00, 0x2BFF, // "MISCELLANEOUS_SYMBOLS_AND_ARROWS", // "Miscellaneous Symbols and Arrows"); // // /** // * CJK Radicals Supplement. // * 0x2E80 - 0x2EFF. // * @since 1.4 // */ // public static final UnicodeBlock CJK_RADICALS_SUPPLEMENT // = new UnicodeBlock(0x2E80, 0x2EFF, // "CJK_RADICALS_SUPPLEMENT", // "CJK Radicals Supplement"); // // /** // * Kangxi Radicals. // * 0x2F00 - 0x2FDF. // * @since 1.4 // */ // public static final UnicodeBlock KANGXI_RADICALS // = new UnicodeBlock(0x2F00, 0x2FDF, // "KANGXI_RADICALS", // "Kangxi Radicals"); // // /** // * Ideographic Description Characters. // * 0x2FF0 - 0x2FFF. // * @since 1.4 // */ // public static final UnicodeBlock IDEOGRAPHIC_DESCRIPTION_CHARACTERS // = new UnicodeBlock(0x2FF0, 0x2FFF, // "IDEOGRAPHIC_DESCRIPTION_CHARACTERS", // "Ideographic Description Characters"); // // /** // * CJK Symbols and Punctuation. // * 0x3000 - 0x303F. // */ // public static final UnicodeBlock CJK_SYMBOLS_AND_PUNCTUATION // = new UnicodeBlock(0x3000, 0x303F, // "CJK_SYMBOLS_AND_PUNCTUATION", // "CJK Symbols and Punctuation"); // // /** // * Hiragana. // * 0x3040 - 0x309F. // */ // public static final UnicodeBlock HIRAGANA // = new UnicodeBlock(0x3040, 0x309F, // "HIRAGANA", // "Hiragana"); // // /** // * Katakana. // * 0x30A0 - 0x30FF. // */ // public static final UnicodeBlock KATAKANA // = new UnicodeBlock(0x30A0, 0x30FF, // "KATAKANA", // "Katakana"); // // /** // * Bopomofo. // * 0x3100 - 0x312F. // */ // public static final UnicodeBlock BOPOMOFO // = new UnicodeBlock(0x3100, 0x312F, // "BOPOMOFO", // "Bopomofo"); // // /** // * Hangul Compatibility Jamo. // * 0x3130 - 0x318F. // */ // public static final UnicodeBlock HANGUL_COMPATIBILITY_JAMO // = new UnicodeBlock(0x3130, 0x318F, // "HANGUL_COMPATIBILITY_JAMO", // "Hangul Compatibility Jamo"); // // /** // * Kanbun. // * 0x3190 - 0x319F. // */ // public static final UnicodeBlock KANBUN // = new UnicodeBlock(0x3190, 0x319F, // "KANBUN", // "Kanbun"); // // /** // * Bopomofo Extended. // * 0x31A0 - 0x31BF. // * @since 1.4 // */ // public static final UnicodeBlock BOPOMOFO_EXTENDED // = new UnicodeBlock(0x31A0, 0x31BF, // "BOPOMOFO_EXTENDED", // "Bopomofo Extended"); // // /** // * Katakana Phonetic Extensions. // * 0x31F0 - 0x31FF. // * @since 1.5 // */ // public static final UnicodeBlock KATAKANA_PHONETIC_EXTENSIONS // = new UnicodeBlock(0x31F0, 0x31FF, // "KATAKANA_PHONETIC_EXTENSIONS", // "Katakana Phonetic Extensions"); // // /** // * Enclosed CJK Letters and Months. // * 0x3200 - 0x32FF. // */ // public static final UnicodeBlock ENCLOSED_CJK_LETTERS_AND_MONTHS // = new UnicodeBlock(0x3200, 0x32FF, // "ENCLOSED_CJK_LETTERS_AND_MONTHS", // "Enclosed CJK Letters and Months"); // // /** // * CJK Compatibility. // * 0x3300 - 0x33FF. // */ // public static final UnicodeBlock CJK_COMPATIBILITY // = new UnicodeBlock(0x3300, 0x33FF, // "CJK_COMPATIBILITY", // "CJK Compatibility"); // // /** // * CJK Unified Ideographs Extension A. // * 0x3400 - 0x4DBF. // * @since 1.4 // */ // public static final UnicodeBlock CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A // = new UnicodeBlock(0x3400, 0x4DBF, // "CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A", // "CJK Unified Ideographs Extension A"); // // /** // * Yijing Hexagram Symbols. // * 0x4DC0 - 0x4DFF. // * @since 1.5 // */ // public static final UnicodeBlock YIJING_HEXAGRAM_SYMBOLS // = new UnicodeBlock(0x4DC0, 0x4DFF, // "YIJING_HEXAGRAM_SYMBOLS", // "Yijing Hexagram Symbols"); // // /** // * CJK Unified Ideographs. // * 0x4E00 - 0x9FFF. // */ // public static final UnicodeBlock CJK_UNIFIED_IDEOGRAPHS // = new UnicodeBlock(0x4E00, 0x9FFF, // "CJK_UNIFIED_IDEOGRAPHS", // "CJK Unified Ideographs"); // // /** // * Yi Syllables. // * 0xA000 - 0xA48F. // * @since 1.4 // */ // public static final UnicodeBlock YI_SYLLABLES // = new UnicodeBlock(0xA000, 0xA48F, // "YI_SYLLABLES", // "Yi Syllables"); // // /** // * Yi Radicals. // * 0xA490 - 0xA4CF. // * @since 1.4 // */ // public static final UnicodeBlock YI_RADICALS // = new UnicodeBlock(0xA490, 0xA4CF, // "YI_RADICALS", // "Yi Radicals"); // // /** // * Hangul Syllables. // * 0xAC00 - 0xD7AF. // */ // public static final UnicodeBlock HANGUL_SYLLABLES // = new UnicodeBlock(0xAC00, 0xD7AF, // "HANGUL_SYLLABLES", // "Hangul Syllables"); // // /** // * High Surrogates. // * 0xD800 - 0xDB7F. // * @since 1.5 // */ // public static final UnicodeBlock HIGH_SURROGATES // = new UnicodeBlock(0xD800, 0xDB7F, // "HIGH_SURROGATES", // "High Surrogates"); // // /** // * High Private Use Surrogates. // * 0xDB80 - 0xDBFF. // * @since 1.5 // */ // public static final UnicodeBlock HIGH_PRIVATE_USE_SURROGATES // = new UnicodeBlock(0xDB80, 0xDBFF, // "HIGH_PRIVATE_USE_SURROGATES", // "High Private Use Surrogates"); // // /** // * Low Surrogates. // * 0xDC00 - 0xDFFF. // * @since 1.5 // */ // public static final UnicodeBlock LOW_SURROGATES // = new UnicodeBlock(0xDC00, 0xDFFF, // "LOW_SURROGATES", // "Low Surrogates"); // // /** // * Private Use Area. // * 0xE000 - 0xF8FF. // */ // public static final UnicodeBlock PRIVATE_USE_AREA // = new UnicodeBlock(0xE000, 0xF8FF, // "PRIVATE_USE_AREA", // "Private Use Area"); // // /** // * CJK Compatibility Ideographs. // * 0xF900 - 0xFAFF. // */ // public static final UnicodeBlock CJK_COMPATIBILITY_IDEOGRAPHS // = new UnicodeBlock(0xF900, 0xFAFF, // "CJK_COMPATIBILITY_IDEOGRAPHS", // "CJK Compatibility Ideographs"); // // /** // * Alphabetic Presentation Forms. // * 0xFB00 - 0xFB4F. // */ // public static final UnicodeBlock ALPHABETIC_PRESENTATION_FORMS // = new UnicodeBlock(0xFB00, 0xFB4F, // "ALPHABETIC_PRESENTATION_FORMS", // "Alphabetic Presentation Forms"); // // /** // * Arabic Presentation Forms-A. // * 0xFB50 - 0xFDFF. // */ // public static final UnicodeBlock ARABIC_PRESENTATION_FORMS_A // = new UnicodeBlock(0xFB50, 0xFDFF, // "ARABIC_PRESENTATION_FORMS_A", // "Arabic Presentation Forms-A"); // // /** // * Variation Selectors. // * 0xFE00 - 0xFE0F. // * @since 1.5 // */ // public static final UnicodeBlock VARIATION_SELECTORS // = new UnicodeBlock(0xFE00, 0xFE0F, // "VARIATION_SELECTORS", // "Variation Selectors"); // // /** // * Combining Half Marks. // * 0xFE20 - 0xFE2F. // */ // public static final UnicodeBlock COMBINING_HALF_MARKS // = new UnicodeBlock(0xFE20, 0xFE2F, // "COMBINING_HALF_MARKS", // "Combining Half Marks"); // // /** // * CJK Compatibility Forms. // * 0xFE30 - 0xFE4F. // */ // public static final UnicodeBlock CJK_COMPATIBILITY_FORMS // = new UnicodeBlock(0xFE30, 0xFE4F, // "CJK_COMPATIBILITY_FORMS", // "CJK Compatibility Forms"); // // /** // * Small Form Variants. // * 0xFE50 - 0xFE6F. // */ // public static final UnicodeBlock SMALL_FORM_VARIANTS // = new UnicodeBlock(0xFE50, 0xFE6F, // "SMALL_FORM_VARIANTS", // "Small Form Variants"); // // /** // * Arabic Presentation Forms-B. // * 0xFE70 - 0xFEFF. // */ // public static final UnicodeBlock ARABIC_PRESENTATION_FORMS_B // = new UnicodeBlock(0xFE70, 0xFEFF, // "ARABIC_PRESENTATION_FORMS_B", // "Arabic Presentation Forms-B"); // // /** // * Halfwidth and Fullwidth Forms. // * 0xFF00 - 0xFFEF. // */ // public static final UnicodeBlock HALFWIDTH_AND_FULLWIDTH_FORMS // = new UnicodeBlock(0xFF00, 0xFFEF, // "HALFWIDTH_AND_FULLWIDTH_FORMS", // "Halfwidth and Fullwidth Forms"); // // /** // * Specials. // * 0xFFF0 - 0xFFFF. // */ // public static final UnicodeBlock SPECIALS // = new UnicodeBlock(0xFFF0, 0xFFFF, // "SPECIALS", // "Specials"); // // /** // * Linear B Syllabary. // * 0x10000 - 0x1007F. // * @since 1.5 // */ // public static final UnicodeBlock LINEAR_B_SYLLABARY // = new UnicodeBlock(0x10000, 0x1007F, // "LINEAR_B_SYLLABARY", // "Linear B Syllabary"); // // /** // * Linear B Ideograms. // * 0x10080 - 0x100FF. // * @since 1.5 // */ // public static final UnicodeBlock LINEAR_B_IDEOGRAMS // = new UnicodeBlock(0x10080, 0x100FF, // "LINEAR_B_IDEOGRAMS", // "Linear B Ideograms"); // // /** // * Aegean Numbers. // * 0x10100 - 0x1013F. // * @since 1.5 // */ // public static final UnicodeBlock AEGEAN_NUMBERS // = new UnicodeBlock(0x10100, 0x1013F, // "AEGEAN_NUMBERS", // "Aegean Numbers"); // // /** // * Old Italic. // * 0x10300 - 0x1032F. // * @since 1.5 // */ // public static final UnicodeBlock OLD_ITALIC // = new UnicodeBlock(0x10300, 0x1032F, // "OLD_ITALIC", // "Old Italic"); // // /** // * Gothic. // * 0x10330 - 0x1034F. // * @since 1.5 // */ // public static final UnicodeBlock GOTHIC // = new UnicodeBlock(0x10330, 0x1034F, // "GOTHIC", // "Gothic"); // // /** // * Ugaritic. // * 0x10380 - 0x1039F. // * @since 1.5 // */ // public static final UnicodeBlock UGARITIC // = new UnicodeBlock(0x10380, 0x1039F, // "UGARITIC", // "Ugaritic"); // // /** // * Deseret. // * 0x10400 - 0x1044F. // * @since 1.5 // */ // public static final UnicodeBlock DESERET // = new UnicodeBlock(0x10400, 0x1044F, // "DESERET", // "Deseret"); // // /** // * Shavian. // * 0x10450 - 0x1047F. // * @since 1.5 // */ // public static final UnicodeBlock SHAVIAN // = new UnicodeBlock(0x10450, 0x1047F, // "SHAVIAN", // "Shavian"); // // /** // * Osmanya. // * 0x10480 - 0x104AF. // * @since 1.5 // */ // public static final UnicodeBlock OSMANYA // = new UnicodeBlock(0x10480, 0x104AF, // "OSMANYA", // "Osmanya"); // // /** // * Cypriot Syllabary. // * 0x10800 - 0x1083F. // * @since 1.5 // */ // public static final UnicodeBlock CYPRIOT_SYLLABARY // = new UnicodeBlock(0x10800, 0x1083F, // "CYPRIOT_SYLLABARY", // "Cypriot Syllabary"); // // /** // * Byzantine Musical Symbols. // * 0x1D000 - 0x1D0FF. // * @since 1.5 // */ // public static final UnicodeBlock BYZANTINE_MUSICAL_SYMBOLS // = new UnicodeBlock(0x1D000, 0x1D0FF, // "BYZANTINE_MUSICAL_SYMBOLS", // "Byzantine Musical Symbols"); // // /** // * Musical Symbols. // * 0x1D100 - 0x1D1FF. // * @since 1.5 // */ // public static final UnicodeBlock MUSICAL_SYMBOLS // = new UnicodeBlock(0x1D100, 0x1D1FF, // "MUSICAL_SYMBOLS", // "Musical Symbols"); // // /** // * Tai Xuan Jing Symbols. // * 0x1D300 - 0x1D35F. // * @since 1.5 // */ // public static final UnicodeBlock TAI_XUAN_JING_SYMBOLS // = new UnicodeBlock(0x1D300, 0x1D35F, // "TAI_XUAN_JING_SYMBOLS", // "Tai Xuan Jing Symbols"); // // /** // * Mathematical Alphanumeric Symbols. // * 0x1D400 - 0x1D7FF. // * @since 1.5 // */ // public static final UnicodeBlock MATHEMATICAL_ALPHANUMERIC_SYMBOLS // = new UnicodeBlock(0x1D400, 0x1D7FF, // "MATHEMATICAL_ALPHANUMERIC_SYMBOLS", // "Mathematical Alphanumeric Symbols"); // // /** // * CJK Unified Ideographs Extension B. // * 0x20000 - 0x2A6DF. // * @since 1.5 // */ // public static final UnicodeBlock CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B // = new UnicodeBlock(0x20000, 0x2A6DF, // "CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B", // "CJK Unified Ideographs Extension B"); // // /** // * CJK Compatibility Ideographs Supplement. // * 0x2F800 - 0x2FA1F. // * @since 1.5 // */ // public static final UnicodeBlock CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT // = new UnicodeBlock(0x2F800, 0x2FA1F, // "CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT", // "CJK Compatibility Ideographs Supplement"); // // /** // * Tags. // * 0xE0000 - 0xE007F. // * @since 1.5 // */ // public static final UnicodeBlock TAGS // = new UnicodeBlock(0xE0000, 0xE007F, // "TAGS", // "Tags"); // // /** // * Variation Selectors Supplement. // * 0xE0100 - 0xE01EF. // * @since 1.5 // */ // public static final UnicodeBlock VARIATION_SELECTORS_SUPPLEMENT // = new UnicodeBlock(0xE0100, 0xE01EF, // "VARIATION_SELECTORS_SUPPLEMENT", // "Variation Selectors Supplement"); // // /** // * Supplementary Private Use Area-A. // * 0xF0000 - 0xFFFFF. // * @since 1.5 // */ // public static final UnicodeBlock SUPPLEMENTARY_PRIVATE_USE_AREA_A // = new UnicodeBlock(0xF0000, 0xFFFFF, // "SUPPLEMENTARY_PRIVATE_USE_AREA_A", // "Supplementary Private Use Area-A"); // // /** // * Supplementary Private Use Area-B. // * 0x100000 - 0x10FFFF. // * @since 1.5 // */ // public static final UnicodeBlock SUPPLEMENTARY_PRIVATE_USE_AREA_B // = new UnicodeBlock(0x100000, 0x10FFFF, // "SUPPLEMENTARY_PRIVATE_USE_AREA_B", // "Supplementary Private Use Area-B"); // // /** // * Surrogates Area. // * 'D800' - 'DFFF'. // * @deprecated As of 1.5, the three areas, // * <a href="#HIGH_SURROGATES">HIGH_SURROGATES</a>, // * <a href="#HIGH_PRIVATE_USE_SURROGATES">HIGH_PRIVATE_USE_SURROGATES</a> // * and <a href="#LOW_SURROGATES">LOW_SURROGATES</a>, as defined // * by the Unicode standard, should be used in preference to // * this. These are also returned from calls to <code>of(int)</code> // * and <code>of(char)</code>. // */ // public static final UnicodeBlock SURROGATES_AREA // = new UnicodeBlock(0xD800, 0xDFFF, // "SURROGATES_AREA", // "Surrogates Area"); // // /** // * The defined subsets. // */ // private static final UnicodeBlock sets[] = { // BASIC_LATIN, // LATIN_1_SUPPLEMENT, // LATIN_EXTENDED_A, // LATIN_EXTENDED_B, // IPA_EXTENSIONS, // SPACING_MODIFIER_LETTERS, // COMBINING_DIACRITICAL_MARKS, // GREEK, // CYRILLIC, // CYRILLIC_SUPPLEMENTARY, // ARMENIAN, // HEBREW, // ARABIC, // SYRIAC, // THAANA, // DEVANAGARI, // BENGALI, // GURMUKHI, // GUJARATI, // ORIYA, // TAMIL, // TELUGU, // KANNADA, // MALAYALAM, // SINHALA, // THAI, // LAO, // TIBETAN, // MYANMAR, // GEORGIAN, // HANGUL_JAMO, // ETHIOPIC, // CHEROKEE, // UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS, // OGHAM, // RUNIC, // TAGALOG, // HANUNOO, // BUHID, // TAGBANWA, // KHMER, // MONGOLIAN, // LIMBU, // TAI_LE, // KHMER_SYMBOLS, // PHONETIC_EXTENSIONS, // LATIN_EXTENDED_ADDITIONAL, // GREEK_EXTENDED, // GENERAL_PUNCTUATION, // SUPERSCRIPTS_AND_SUBSCRIPTS, // CURRENCY_SYMBOLS, // COMBINING_MARKS_FOR_SYMBOLS, // LETTERLIKE_SYMBOLS, // NUMBER_FORMS, // ARROWS, // MATHEMATICAL_OPERATORS, // MISCELLANEOUS_TECHNICAL, // CONTROL_PICTURES, // OPTICAL_CHARACTER_RECOGNITION, // ENCLOSED_ALPHANUMERICS, // BOX_DRAWING, // BLOCK_ELEMENTS, // GEOMETRIC_SHAPES, // MISCELLANEOUS_SYMBOLS, // DINGBATS, // MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A, // SUPPLEMENTAL_ARROWS_A, // BRAILLE_PATTERNS, // SUPPLEMENTAL_ARROWS_B, // MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B, // SUPPLEMENTAL_MATHEMATICAL_OPERATORS, // MISCELLANEOUS_SYMBOLS_AND_ARROWS, // CJK_RADICALS_SUPPLEMENT, // KANGXI_RADICALS, // IDEOGRAPHIC_DESCRIPTION_CHARACTERS, // CJK_SYMBOLS_AND_PUNCTUATION, // HIRAGANA, // KATAKANA, // BOPOMOFO, // HANGUL_COMPATIBILITY_JAMO, // KANBUN, // BOPOMOFO_EXTENDED, // KATAKANA_PHONETIC_EXTENSIONS, // ENCLOSED_CJK_LETTERS_AND_MONTHS, // CJK_COMPATIBILITY, // CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A, // YIJING_HEXAGRAM_SYMBOLS, // CJK_UNIFIED_IDEOGRAPHS, // YI_SYLLABLES, // YI_RADICALS, // HANGUL_SYLLABLES, // HIGH_SURROGATES, // HIGH_PRIVATE_USE_SURROGATES, // LOW_SURROGATES, // PRIVATE_USE_AREA, // CJK_COMPATIBILITY_IDEOGRAPHS, // ALPHABETIC_PRESENTATION_FORMS, // ARABIC_PRESENTATION_FORMS_A, // VARIATION_SELECTORS, // COMBINING_HALF_MARKS, // CJK_COMPATIBILITY_FORMS, // SMALL_FORM_VARIANTS, // ARABIC_PRESENTATION_FORMS_B, // HALFWIDTH_AND_FULLWIDTH_FORMS, // SPECIALS, // LINEAR_B_SYLLABARY, // LINEAR_B_IDEOGRAMS, // AEGEAN_NUMBERS, // OLD_ITALIC, // GOTHIC, // UGARITIC, // DESERET, // SHAVIAN, // OSMANYA, // CYPRIOT_SYLLABARY, // BYZANTINE_MUSICAL_SYMBOLS, // MUSICAL_SYMBOLS, // TAI_XUAN_JING_SYMBOLS, // MATHEMATICAL_ALPHANUMERIC_SYMBOLS, // CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B, // CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT, // TAGS, // VARIATION_SELECTORS_SUPPLEMENT, // SUPPLEMENTARY_PRIVATE_USE_AREA_A, // SUPPLEMENTARY_PRIVATE_USE_AREA_B, // }; } // class UnicodeBlock /** * A class to encompass all the properties of characters in the * private use blocks in the Unicode standard. This class extends * UnassignedCharacters because the return type from getType() is * different. * @author Anthony Balkissoon abalkiss at redhat dot com * */ private static class PrivateUseCharacters extends UnassignedCharacters { /** * Returns the type of the character cp. */ static int getType(int cp) { // The upper 2 code points in any plane are considered unassigned, // even in the private-use planes. if ((cp & 0xffff) >= 0xfffe) return UnassignedCharacters.getType(cp); return PRIVATE_USE; } /** * Returns true if the character cp is defined. */ static boolean isDefined(int cp) { // The upper 2 code points in any plane are considered unassigned, // even in the private-use planes. if ((cp & 0xffff) >= 0xfffe) return UnassignedCharacters.isDefined(cp); return true; } /** * Gets the directionality for the character cp. */ static byte getDirectionality(int cp) { if ((cp & 0xffff) >= 0xfffe) return UnassignedCharacters.getDirectionality(cp); return DIRECTIONALITY_LEFT_TO_RIGHT; } } /** * A class to encompass all the properties of code points that are * currently undefined in the Unicode standard. * @author Anthony Balkissoon abalkiss at redhat dot com * */ private static class UnassignedCharacters { /** * Returns the numeric value for the unassigned characters. * @param cp the character * @param radix the radix (not used) * @return the numeric value of this character in this radix */ static int digit(int cp, int radix) { return -1; } /** * Returns the Unicode directionality property for unassigned * characters. * @param cp the character * @return DIRECTIONALITY_UNDEFINED */ static byte getDirectionality(int cp) { return DIRECTIONALITY_UNDEFINED; } /** * Returns -1, the numeric value for unassigned Unicode characters. * @param cp the character * @return -1 */ static int getNumericValue(int cp) { return -1; } /** * Returns UNASSIGNED, the type of unassigned Unicode characters. * @param cp the character * @return UNASSIGNED */ static int getType(int cp) { return UNASSIGNED; } /** * Returns false to indiciate that the character is not defined in the * Unicode standard. * @param cp the character * @return false */ static boolean isDefined(int cp) { return false; } /** * Returns false to indicate that the character is not a digit. * @param cp the character * @return false */ static boolean isDigit(int cp) { return false; } /** * Returns false to indicate that the character cannot be ignored * within an identifier * @param cp the character * @return false */ static boolean isIdentifierIgnorable(int cp) { return false; } /** * Returns false to indicate that the character cannot be part of a * Java identifier. * @param cp the character * @return false */ static boolean isJavaIdentifierPart(int cp) { return false; } /** * Returns false to indicate that the character cannot be start a * Java identifier. * @param cp the character * @return false */ static boolean isJavaIdentiferStart(int cp) { return false; } /** * Returns false to indicate that the character is not a letter. * @param cp the character * @return false */ static boolean isLetter(int cp) { return false; } /** * Returns false to indicate that the character cannot is neither a letter * nor a digit. * @param cp the character * @return false */ static boolean isLetterOrDigit(int cp) { return false; } /** * Returns false to indicate that the character is not a lowercase letter. * @param cp the character * @return false */ static boolean isLowerCase(int cp) { return false; } /** * Returns false to indicate that the character cannot is not mirrored. * @param cp the character * @return false */ static boolean isMirrored(int cp) { return false; } /** * Returns false to indicate that the character is not a space character. * @param cp the character * @return false */ static boolean isSpaceChar(int cp) { return false; } /** * Returns false to indicate that the character it not a titlecase letter. * @param cp the character * @return false */ static boolean isTitleCase(int cp) { return false; } /** * Returns false to indicate that the character cannot be part of a * Unicode identifier. * @param cp the character * @return false */ static boolean isUnicodeIdentifierPart(int cp) { return false; } /** * Returns false to indicate that the character cannot start a * Unicode identifier. * @param cp the character * @return false */ static boolean isUnicodeIdentifierStart(int cp) { return false; } /** * Returns false to indicate that the character is not an uppercase letter. * @param cp the character * @return false */ static boolean isUpperCase(int cp) { return false; } /** * Returns false to indicate that the character is not a whitespace * character. * @param cp the character * @return false */ static boolean isWhiteSpace(int cp) { return false; } /** * Returns cp to indicate this character has no lowercase conversion. * @param cp the character * @return cp */ static int toLowerCase(int cp) { return cp; } /** * Returns cp to indicate this character has no titlecase conversion. * @param cp the character * @return cp */ static int toTitleCase(int cp) { return cp; } /** * Returns cp to indicate this character has no uppercase conversion. * @param cp the character * @return cp */ static int toUpperCase(int cp) { return cp; } } /** * The immutable value of this Character. * * @serial the value of this Character */ private final char value; /** * Compatible with JDK 1.0+. */ private static final long serialVersionUID = 3786198910865385080L; /** * Smallest value allowed for radix arguments in Java. This value is 2. * * @see #digit(char, int) * @see #forDigit(int, int) * @see Integer#toString(int, int) * @see Integer#valueOf(String) */ public static final int MIN_RADIX = 2; /** * Largest value allowed for radix arguments in Java. This value is 36. * * @see #digit(char, int) * @see #forDigit(int, int) * @see Integer#toString(int, int) * @see Integer#valueOf(String) */ public static final int MAX_RADIX = 36; /** * The minimum value the char data type can hold. * This value is <code>'\\u0000'</code>. */ public static final char MIN_VALUE = '\u0000'; /** * The maximum value the char data type can hold. * This value is <code>'\\uFFFF'</code>. */ public static final char MAX_VALUE = '\uFFFF'; /** * Class object representing the primitive char data type. * * @since 1.1 */ // public static final Class TYPE = VMClassLoader.getPrimitiveClass('C'); /** * The number of bits needed to represent a <code>char</code>. * @since 1.5 */ public static final int SIZE = 16; // This caches some Character values, and is used by boxing // conversions via valueOf(). We must cache at least 0..127; // this constant controls how much we actually cache. private static final int MAX_CACHE = 127; private static Character[] charCache = new Character[MAX_CACHE + 1]; /** * Lu = Letter, Uppercase (Informative). * * @since 1.1 */ public static final byte UPPERCASE_LETTER = 1; /** * Ll = Letter, Lowercase (Informative). * * @since 1.1 */ public static final byte LOWERCASE_LETTER = 2; /** * Lt = Letter, Titlecase (Informative). * * @since 1.1 */ public static final byte TITLECASE_LETTER = 3; /** * Mn = Mark, Non-Spacing (Normative). * * @since 1.1 */ public static final byte NON_SPACING_MARK = 6; /** * Mc = Mark, Spacing Combining (Normative). * * @since 1.1 */ public static final byte COMBINING_SPACING_MARK = 8; /** * Me = Mark, Enclosing (Normative). * * @since 1.1 */ public static final byte ENCLOSING_MARK = 7; /** * Nd = Number, Decimal Digit (Normative). * * @since 1.1 */ public static final byte DECIMAL_DIGIT_NUMBER = 9; /** * Nl = Number, Letter (Normative). * * @since 1.1 */ public static final byte LETTER_NUMBER = 10; /** * No = Number, Other (Normative). * * @since 1.1 */ public static final byte OTHER_NUMBER = 11; /** * Zs = Separator, Space (Normative). * * @since 1.1 */ public static final byte SPACE_SEPARATOR = 12; /** * Zl = Separator, Line (Normative). * * @since 1.1 */ public static final byte LINE_SEPARATOR = 13; /** * Zp = Separator, Paragraph (Normative). * * @since 1.1 */ public static final byte PARAGRAPH_SEPARATOR = 14; /** * Cc = Other, Control (Normative). * * @since 1.1 */ public static final byte CONTROL = 15; /** * Cf = Other, Format (Normative). * * @since 1.1 */ public static final byte FORMAT = 16; /** * Cs = Other, Surrogate (Normative). * * @since 1.1 */ public static final byte SURROGATE = 19; /** * Co = Other, Private Use (Normative). * * @since 1.1 */ public static final byte PRIVATE_USE = 18; /** * Cn = Other, Not Assigned (Normative). * * @since 1.1 */ public static final byte UNASSIGNED = 0; /** * Lm = Letter, Modifier (Informative). * * @since 1.1 */ public static final byte MODIFIER_LETTER = 4; /** * Lo = Letter, Other (Informative). * * @since 1.1 */ public static final byte OTHER_LETTER = 5; /** * Pc = Punctuation, Connector (Informative). * * @since 1.1 */ public static final byte CONNECTOR_PUNCTUATION = 23; /** * Pd = Punctuation, Dash (Informative). * * @since 1.1 */ public static final byte DASH_PUNCTUATION = 20; /** * Ps = Punctuation, Open (Informative). * * @since 1.1 */ public static final byte START_PUNCTUATION = 21; /** * Pe = Punctuation, Close (Informative). * * @since 1.1 */ public static final byte END_PUNCTUATION = 22; /** * Pi = Punctuation, Initial Quote (Informative). * * @since 1.4 */ public static final byte INITIAL_QUOTE_PUNCTUATION = 29; /** * Pf = Punctuation, Final Quote (Informative). * * @since 1.4 */ public static final byte FINAL_QUOTE_PUNCTUATION = 30; /** * Po = Punctuation, Other (Informative). * * @since 1.1 */ public static final byte OTHER_PUNCTUATION = 24; /** * Sm = Symbol, Math (Informative). * * @since 1.1 */ public static final byte MATH_SYMBOL = 25; /** * Sc = Symbol, Currency (Informative). * * @since 1.1 */ public static final byte CURRENCY_SYMBOL = 26; /** * Sk = Symbol, Modifier (Informative). * * @since 1.1 */ public static final byte MODIFIER_SYMBOL = 27; /** * So = Symbol, Other (Informative). * * @since 1.1 */ public static final byte OTHER_SYMBOL = 28; /** * Undefined bidirectional character type. Undefined char values have * undefined directionality in the Unicode specification. * * @since 1.4 */ public static final byte DIRECTIONALITY_UNDEFINED = -1; /** * Strong bidirectional character type "L". * * @since 1.4 */ public static final byte DIRECTIONALITY_LEFT_TO_RIGHT = 0; /** * Strong bidirectional character type "R". * * @since 1.4 */ public static final byte DIRECTIONALITY_RIGHT_TO_LEFT = 1; /** * Strong bidirectional character type "AL". * * @since 1.4 */ public static final byte DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC = 2; /** * Weak bidirectional character type "EN". * * @since 1.4 */ public static final byte DIRECTIONALITY_EUROPEAN_NUMBER = 3; /** * Weak bidirectional character type "ES". * * @since 1.4 */ public static final byte DIRECTIONALITY_EUROPEAN_NUMBER_SEPARATOR = 4; /** * Weak bidirectional character type "ET". * * @since 1.4 */ public static final byte DIRECTIONALITY_EUROPEAN_NUMBER_TERMINATOR = 5; /** * Weak bidirectional character type "AN". * * @since 1.4 */ public static final byte DIRECTIONALITY_ARABIC_NUMBER = 6; /** * Weak bidirectional character type "CS". * * @since 1.4 */ public static final byte DIRECTIONALITY_COMMON_NUMBER_SEPARATOR = 7; /** * Weak bidirectional character type "NSM". * * @since 1.4 */ public static final byte DIRECTIONALITY_NONSPACING_MARK = 8; /** * Weak bidirectional character type "BN". * * @since 1.4 */ public static final byte DIRECTIONALITY_BOUNDARY_NEUTRAL = 9; /** * Neutral bidirectional character type "B". * * @since 1.4 */ public static final byte DIRECTIONALITY_PARAGRAPH_SEPARATOR = 10; /** * Neutral bidirectional character type "S". * * @since 1.4 */ public static final byte DIRECTIONALITY_SEGMENT_SEPARATOR = 11; /** * Strong bidirectional character type "WS". * * @since 1.4 */ public static final byte DIRECTIONALITY_WHITESPACE = 12; /** * Neutral bidirectional character type "ON". * * @since 1.4 */ public static final byte DIRECTIONALITY_OTHER_NEUTRALS = 13; /** * Strong bidirectional character type "LRE". * * @since 1.4 */ public static final byte DIRECTIONALITY_LEFT_TO_RIGHT_EMBEDDING = 14; /** * Strong bidirectional character type "LRO". * * @since 1.4 */ public static final byte DIRECTIONALITY_LEFT_TO_RIGHT_OVERRIDE = 15; /** * Strong bidirectional character type "RLE". * * @since 1.4 */ public static final byte DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING = 16; /** * Strong bidirectional character type "RLO". * * @since 1.4 */ public static final byte DIRECTIONALITY_RIGHT_TO_LEFT_OVERRIDE = 17; /** * Weak bidirectional character type "PDF". * * @since 1.4 */ public static final byte DIRECTIONALITY_POP_DIRECTIONAL_FORMAT = 18; /** * Stores unicode block offset lookup table. Exploit package visibility of * String.value to avoid copying the array. * @see #readCodePoint(int) * @see CharData#BLOCKS */ // private static final char[][] blocks = // new char[][]{ // String.zeroBasedStringValue(CharData.BLOCKS[0]), // String.zeroBasedStringValue(CharData.BLOCKS[1]), // String.zeroBasedStringValue(CharData.BLOCKS[2]), // String.zeroBasedStringValue(CharData.BLOCKS[3]), // String.zeroBasedStringValue(CharData.BLOCKS[4]), // String.zeroBasedStringValue(CharData.BLOCKS[5]), // String.zeroBasedStringValue(CharData.BLOCKS[6]), // String.zeroBasedStringValue(CharData.BLOCKS[7]), // String.zeroBasedStringValue(CharData.BLOCKS[8]), // String.zeroBasedStringValue(CharData.BLOCKS[9]), // String.zeroBasedStringValue(CharData.BLOCKS[10]), // String.zeroBasedStringValue(CharData.BLOCKS[11]), // String.zeroBasedStringValue(CharData.BLOCKS[12]), // String.zeroBasedStringValue(CharData.BLOCKS[13]), // String.zeroBasedStringValue(CharData.BLOCKS[14]), // String.zeroBasedStringValue(CharData.BLOCKS[15]), // String.zeroBasedStringValue(CharData.BLOCKS[16])}; /** * Stores unicode attribute offset lookup table. Exploit package visibility * of String.value to avoid copying the array. * @see CharData#DATA */ // private static final char[][] data = // new char[][]{ // String.zeroBasedStringValue(CharData.DATA[0]), // String.zeroBasedStringValue(CharData.DATA[1]), // String.zeroBasedStringValue(CharData.DATA[2]), // String.zeroBasedStringValue(CharData.DATA[3]), // String.zeroBasedStringValue(CharData.DATA[4]), // String.zeroBasedStringValue(CharData.DATA[5]), // String.zeroBasedStringValue(CharData.DATA[6]), // String.zeroBasedStringValue(CharData.DATA[7]), // String.zeroBasedStringValue(CharData.DATA[8]), // String.zeroBasedStringValue(CharData.DATA[9]), // String.zeroBasedStringValue(CharData.DATA[10]), // String.zeroBasedStringValue(CharData.DATA[11]), // String.zeroBasedStringValue(CharData.DATA[12]), // String.zeroBasedStringValue(CharData.DATA[13]), // String.zeroBasedStringValue(CharData.DATA[14]), // String.zeroBasedStringValue(CharData.DATA[15]), // String.zeroBasedStringValue(CharData.DATA[16])}; /** * Stores unicode numeric value attribute table. Exploit package visibility * of String.value to avoid copying the array. * @see CharData#NUM_VALUE */ // private static final char[][] numValue = // new char[][]{ // String.zeroBasedStringValue(CharData.NUM_VALUE[0]), // String.zeroBasedStringValue(CharData.NUM_VALUE[1]), // String.zeroBasedStringValue(CharData.NUM_VALUE[2]), // String.zeroBasedStringValue(CharData.NUM_VALUE[3]), // String.zeroBasedStringValue(CharData.NUM_VALUE[4]), // String.zeroBasedStringValue(CharData.NUM_VALUE[5]), // String.zeroBasedStringValue(CharData.NUM_VALUE[6]), // String.zeroBasedStringValue(CharData.NUM_VALUE[7]), // String.zeroBasedStringValue(CharData.NUM_VALUE[8]), // String.zeroBasedStringValue(CharData.NUM_VALUE[9]), // String.zeroBasedStringValue(CharData.NUM_VALUE[10]), // String.zeroBasedStringValue(CharData.NUM_VALUE[11]), // String.zeroBasedStringValue(CharData.NUM_VALUE[12]), // String.zeroBasedStringValue(CharData.NUM_VALUE[13]), // String.zeroBasedStringValue(CharData.NUM_VALUE[14]), // String.zeroBasedStringValue(CharData.NUM_VALUE[15]), // String.zeroBasedStringValue(CharData.NUM_VALUE[16])}; /** * Stores unicode uppercase attribute table. Exploit package visibility * of String.value to avoid copying the array. * @see CharData#UPPER */ // private static final char[][] upper = // new char[][]{ // String.zeroBasedStringValue(CharData.UPPER[0]), // String.zeroBasedStringValue(CharData.UPPER[1]), // String.zeroBasedStringValue(CharData.UPPER[2]), // String.zeroBasedStringValue(CharData.UPPER[3]), // String.zeroBasedStringValue(CharData.UPPER[4]), // String.zeroBasedStringValue(CharData.UPPER[5]), // String.zeroBasedStringValue(CharData.UPPER[6]), // String.zeroBasedStringValue(CharData.UPPER[7]), // String.zeroBasedStringValue(CharData.UPPER[8]), // String.zeroBasedStringValue(CharData.UPPER[9]), // String.zeroBasedStringValue(CharData.UPPER[10]), // String.zeroBasedStringValue(CharData.UPPER[11]), // String.zeroBasedStringValue(CharData.UPPER[12]), // String.zeroBasedStringValue(CharData.UPPER[13]), // String.zeroBasedStringValue(CharData.UPPER[14]), // String.zeroBasedStringValue(CharData.UPPER[15]), // String.zeroBasedStringValue(CharData.UPPER[16])}; /** * Stores unicode lowercase attribute table. Exploit package visibility * of String.value to avoid copying the array. * @see CharData#LOWER */ // private static final char[][] lower = // new char[][]{ // String.zeroBasedStringValue(CharData.LOWER[0]), // String.zeroBasedStringValue(CharData.LOWER[1]), // String.zeroBasedStringValue(CharData.LOWER[2]), // String.zeroBasedStringValue(CharData.LOWER[3]), // String.zeroBasedStringValue(CharData.LOWER[4]), // String.zeroBasedStringValue(CharData.LOWER[5]), // String.zeroBasedStringValue(CharData.LOWER[6]), // String.zeroBasedStringValue(CharData.LOWER[7]), // String.zeroBasedStringValue(CharData.LOWER[8]), // String.zeroBasedStringValue(CharData.LOWER[9]), // String.zeroBasedStringValue(CharData.LOWER[10]), // String.zeroBasedStringValue(CharData.LOWER[11]), // String.zeroBasedStringValue(CharData.LOWER[12]), // String.zeroBasedStringValue(CharData.LOWER[13]), // String.zeroBasedStringValue(CharData.LOWER[14]), // String.zeroBasedStringValue(CharData.LOWER[15]), // String.zeroBasedStringValue(CharData.LOWER[16])}; /** * Stores unicode direction attribute table. Exploit package visibility * of String.value to avoid copying the array. * @see CharData#DIRECTION */ // Package visible for use by String. // static final char[][] direction = // new char[][]{ // String.zeroBasedStringValue(CharData.DIRECTION[0]), // String.zeroBasedStringValue(CharData.DIRECTION[1]), // String.zeroBasedStringValue(CharData.DIRECTION[2]), // String.zeroBasedStringValue(CharData.DIRECTION[3]), // String.zeroBasedStringValue(CharData.DIRECTION[4]), // String.zeroBasedStringValue(CharData.DIRECTION[5]), // String.zeroBasedStringValue(CharData.DIRECTION[6]), // String.zeroBasedStringValue(CharData.DIRECTION[7]), // String.zeroBasedStringValue(CharData.DIRECTION[8]), // String.zeroBasedStringValue(CharData.DIRECTION[9]), // String.zeroBasedStringValue(CharData.DIRECTION[10]), // String.zeroBasedStringValue(CharData.DIRECTION[11]), // String.zeroBasedStringValue(CharData.DIRECTION[12]), // String.zeroBasedStringValue(CharData.DIRECTION[13]), // String.zeroBasedStringValue(CharData.DIRECTION[14]), // String.zeroBasedStringValue(CharData.DIRECTION[15]), // String.zeroBasedStringValue(CharData.DIRECTION[16])}; /** * Stores unicode titlecase table. Exploit package visibility of * String.value to avoid copying the array. * @see CharData#TITLE */ // private static final char[] title = String.zeroBasedStringValue(CharData.TITLE); /** * Mask for grabbing the type out of the contents of data. * @see CharData#DATA */ private static final int TYPE_MASK = 0x1F; /** * Mask for grabbing the non-breaking space flag out of the contents of * data. * @see CharData#DATA */ private static final int NO_BREAK_MASK = 0x20; /** * Mask for grabbing the mirrored directionality flag out of the contents * of data. * @see CharData#DATA */ private static final int MIRROR_MASK = 0x40; /** * Min value for supplementary code point. * * @since 1.5 */ public static final int MIN_SUPPLEMENTARY_CODE_POINT = 0x10000; /** * Min value for code point. * * @since 1.5 */ public static final int MIN_CODE_POINT = 0; /** * Max value for code point. * * @since 1.5 */ public static final int MAX_CODE_POINT = 0x010ffff; /** * Minimum high surrogate code in UTF-16 encoding. * * @since 1.5 */ public static final char MIN_HIGH_SURROGATE = '\ud800'; /** * Maximum high surrogate code in UTF-16 encoding. * * @since 1.5 */ public static final char MAX_HIGH_SURROGATE = '\udbff'; /** * Minimum low surrogate code in UTF-16 encoding. * * @since 1.5 */ public static final char MIN_LOW_SURROGATE = '\udc00'; /** * Maximum low surrogate code in UTF-16 encoding. * * @since 1.5 */ public static final char MAX_LOW_SURROGATE