?? 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 modifyit under the terms of the GNU General Public License as published bythe 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, butWITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNUGeneral Public License for more details.You should have received a copy of the GNU General Public Licensealong with GNU Classpath; see the file COPYING. If not, write to theFree Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA02110-1301 USA.Linking this library statically or dynamically with other modules ismaking a combined work based on this library. Thus, the terms andconditions of the GNU General Public License cover the wholecombination.As a special exception, the copyright holders of this library give youpermission to link this library with independent modules to produce anexecutable, regardless of the license terms of these independentmodules, and to copy and distribute the resulting executable underterms of your choice, provided that you also meet, for each linkedindependent module, the terms and conditions of the license of thatmodule. An independent module is a module which is not derived fromor based on this library. If you modify this library, you may extendthis exception to your version of the library, but you are notobligated to do so. If you do not wish to do so, delete thisexception statement from your version. */package java.lang;import gnu.java.lang.CharData;import java.io.Serializable;/** * Wrapper class for the primitive char data type. In addition, this class * allows one to retrieve property information and perform transformations * on the 57,707 defined characters in the Unicode Standard, Version 3.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 3.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@cygnus.com) * @author Paul N. Fisher * @author Jochen Hoenicke * @author Eric Blake (ebb9@email.byu.edu) * @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@email.byu.edu) * @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/Block-3.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.4 uses Unicode version 3.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 char start; /** The end of the subset. */ private final char end; /** * 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 */ private UnicodeBlock(char start, char end, String name) { super(name); this.start = start; this.end = end; } /** * Returns the Unicode character block which a character belongs to. * * @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) { // Special case, since SPECIALS contains two ranges. if (ch == '\uFEFF') return SPECIALS; // 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 (ch < b.start) hi = mid - 1; else if (ch > b.end) low = mid + 1; else return b; } return null; } /** * Basic Latin. * '\u0000' - '\u007F'. */ public static final UnicodeBlock BASIC_LATIN = new UnicodeBlock('\u0000', '\u007F', "BASIC_LATIN"); /** * Latin-1 Supplement. * '\u0080' - '\u00FF'. */ public static final UnicodeBlock LATIN_1_SUPPLEMENT = new UnicodeBlock('\u0080', '\u00FF', "LATIN_1_SUPPLEMENT"); /** * Latin Extended-A. * '\u0100' - '\u017F'. */ public static final UnicodeBlock LATIN_EXTENDED_A = new UnicodeBlock('\u0100', '\u017F', "LATIN_EXTENDED_A"); /** * Latin Extended-B. * '\u0180' - '\u024F'. */ public static final UnicodeBlock LATIN_EXTENDED_B = new UnicodeBlock('\u0180', '\u024F', "LATIN_EXTENDED_B"); /** * IPA Extensions. * '\u0250' - '\u02AF'. */ public static final UnicodeBlock IPA_EXTENSIONS = new UnicodeBlock('\u0250', '\u02AF', "IPA_EXTENSIONS"); /** * Spacing Modifier Letters. * '\u02B0' - '\u02FF'. */ public static final UnicodeBlock SPACING_MODIFIER_LETTERS = new UnicodeBlock('\u02B0', '\u02FF', "SPACING_MODIFIER_LETTERS"); /** * Combining Diacritical Marks. * '\u0300' - '\u036F'. */ public static final UnicodeBlock COMBINING_DIACRITICAL_MARKS = new UnicodeBlock('\u0300', '\u036F', "COMBINING_DIACRITICAL_MARKS"); /** * Greek. * '\u0370' - '\u03FF'. */ public static final UnicodeBlock GREEK = new UnicodeBlock('\u0370', '\u03FF', "GREEK"); /** * Cyrillic. * '\u0400' - '\u04FF'. */ public static final UnicodeBlock CYRILLIC = new UnicodeBlock('\u0400', '\u04FF', "CYRILLIC"); /** * Armenian. * '\u0530' - '\u058F'. */ public static final UnicodeBlock ARMENIAN = new UnicodeBlock('\u0530', '\u058F', "ARMENIAN"); /** * Hebrew. * '\u0590' - '\u05FF'. */ public static final UnicodeBlock HEBREW = new UnicodeBlock('\u0590', '\u05FF', "HEBREW"); /** * Arabic. * '\u0600' - '\u06FF'. */ public static final UnicodeBlock ARABIC = new UnicodeBlock('\u0600', '\u06FF', "ARABIC"); /** * Syriac. * '\u0700' - '\u074F'. * @since 1.4 */ public static final UnicodeBlock SYRIAC = new UnicodeBlock('\u0700', '\u074F', "SYRIAC"); /** * Thaana. * '\u0780' - '\u07BF'. * @since 1.4 */ public static final UnicodeBlock THAANA = new UnicodeBlock('\u0780', '\u07BF', "THAANA"); /** * Devanagari. * '\u0900' - '\u097F'. */ public static final UnicodeBlock DEVANAGARI = new UnicodeBlock('\u0900', '\u097F', "DEVANAGARI"); /** * Bengali. * '\u0980' - '\u09FF'. */ public static final UnicodeBlock BENGALI = new UnicodeBlock('\u0980', '\u09FF', "BENGALI"); /** * Gurmukhi. * '\u0A00' - '\u0A7F'. */ public static final UnicodeBlock GURMUKHI = new UnicodeBlock('\u0A00', '\u0A7F', "GURMUKHI"); /** * Gujarati. * '\u0A80' - '\u0AFF'. */ public static final UnicodeBlock GUJARATI = new UnicodeBlock('\u0A80', '\u0AFF', "GUJARATI"); /** * Oriya. * '\u0B00' - '\u0B7F'. */ public static final UnicodeBlock ORIYA = new UnicodeBlock('\u0B00', '\u0B7F', "ORIYA"); /** * Tamil. * '\u0B80' - '\u0BFF'. */ public static final UnicodeBlock TAMIL = new UnicodeBlock('\u0B80', '\u0BFF', "TAMIL"); /** * Telugu. * '\u0C00' - '\u0C7F'. */ public static final UnicodeBlock TELUGU = new UnicodeBlock('\u0C00', '\u0C7F', "TELUGU"); /** * Kannada. * '\u0C80' - '\u0CFF'. */ public static final UnicodeBlock KANNADA = new UnicodeBlock('\u0C80', '\u0CFF', "KANNADA"); /** * Malayalam. * '\u0D00' - '\u0D7F'. */ public static final UnicodeBlock MALAYALAM = new UnicodeBlock('\u0D00', '\u0D7F', "MALAYALAM"); /** * Sinhala. * '\u0D80' - '\u0DFF'. * @since 1.4 */ public static final UnicodeBlock SINHALA = new UnicodeBlock('\u0D80', '\u0DFF', "SINHALA"); /** * Thai. * '\u0E00' - '\u0E7F'. */ public static final UnicodeBlock THAI = new UnicodeBlock('\u0E00', '\u0E7F', "THAI"); /** * Lao. * '\u0E80' - '\u0EFF'. */ public static final UnicodeBlock LAO = new UnicodeBlock('\u0E80', '\u0EFF', "LAO"); /** * Tibetan. * '\u0F00' - '\u0FFF'. */ public static final UnicodeBlock TIBETAN = new UnicodeBlock('\u0F00', '\u0FFF', "TIBETAN"); /** * Myanmar. * '\u1000' - '\u109F'. * @since 1.4 */ public static final UnicodeBlock MYANMAR = new UnicodeBlock('\u1000', '\u109F', "MYANMAR"); /** * Georgian. * '\u10A0' - '\u10FF'. */ public static final UnicodeBlock GEORGIAN = new UnicodeBlock('\u10A0', '\u10FF', "GEORGIAN"); /** * Hangul Jamo. * '\u1100' - '\u11FF'. */ public static final UnicodeBlock HANGUL_JAMO = new UnicodeBlock('\u1100', '\u11FF', "HANGUL_JAMO"); /** * Ethiopic. * '\u1200' - '\u137F'. * @since 1.4 */ public static final UnicodeBlock ETHIOPIC = new UnicodeBlock('\u1200', '\u137F', "ETHIOPIC"); /** * Cherokee. * '\u13A0' - '\u13FF'. * @since 1.4 */ public static final UnicodeBlock CHEROKEE = new UnicodeBlock('\u13A0', '\u13FF', "CHEROKEE"); /** * Unified Canadian Aboriginal Syllabics. * '\u1400' - '\u167F'. * @since 1.4 */ public static final UnicodeBlock UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS = new UnicodeBlock('\u1400', '\u167F', "UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS"); /** * Ogham. * '\u1680' - '\u169F'. * @since 1.4 */ public static final UnicodeBlock OGHAM = new UnicodeBlock('\u1680', '\u169F', "OGHAM"); /**
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -