?? character.java
字號:
/* java.lang.Character -- Wrapper class for char, and Unicode subsets Copyright (C) 1998, 1999, 2001, 2002 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., 59 Temple Place, Suite 330, Boston, MA02111-1307 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 java.io.Serializable;import gnu.java.lang.CharData;/** * 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 final static UnicodeBlock BASIC_LATIN = new UnicodeBlock('\u0000', '\u007F', "BASIC_LATIN"); /** * Latin-1 Supplement. * '\u0080' - '\u00FF'. */ public final static UnicodeBlock LATIN_1_SUPPLEMENT = new UnicodeBlock('\u0080', '\u00FF', "LATIN_1_SUPPLEMENT"); /** * Latin Extended-A. * '\u0100' - '\u017F'. */ public final static UnicodeBlock LATIN_EXTENDED_A = new UnicodeBlock('\u0100', '\u017F', "LATIN_EXTENDED_A"); /** * Latin Extended-B. * '\u0180' - '\u024F'. */ public final static UnicodeBlock LATIN_EXTENDED_B = new UnicodeBlock('\u0180', '\u024F', "LATIN_EXTENDED_B"); /** * IPA Extensions. * '\u0250' - '\u02AF'. */ public final static UnicodeBlock IPA_EXTENSIONS = new UnicodeBlock('\u0250', '\u02AF', "IPA_EXTENSIONS"); /** * Spacing Modifier Letters. * '\u02B0' - '\u02FF'. */ public final static UnicodeBlock SPACING_MODIFIER_LETTERS = new UnicodeBlock('\u02B0', '\u02FF', "SPACING_MODIFIER_LETTERS"); /** * Combining Diacritical Marks. * '\u0300' - '\u036F'. */ public final static UnicodeBlock COMBINING_DIACRITICAL_MARKS = new UnicodeBlock('\u0300', '\u036F', "COMBINING_DIACRITICAL_MARKS"); /** * Greek. * '\u0370' - '\u03FF'. */ public final static UnicodeBlock GREEK = new UnicodeBlock('\u0370', '\u03FF', "GREEK"); /** * Cyrillic. * '\u0400' - '\u04FF'. */ public final static UnicodeBlock CYRILLIC = new UnicodeBlock('\u0400', '\u04FF', "CYRILLIC"); /** * Armenian. * '\u0530' - '\u058F'. */ public final static UnicodeBlock ARMENIAN = new UnicodeBlock('\u0530', '\u058F', "ARMENIAN"); /** * Hebrew. * '\u0590' - '\u05FF'. */ public final static UnicodeBlock HEBREW = new UnicodeBlock('\u0590', '\u05FF', "HEBREW"); /** * Arabic. * '\u0600' - '\u06FF'. */ public final static UnicodeBlock ARABIC = new UnicodeBlock('\u0600', '\u06FF', "ARABIC"); /** * Syriac. * '\u0700' - '\u074F'. * @since 1.4 */ public final static UnicodeBlock SYRIAC = new UnicodeBlock('\u0700', '\u074F', "SYRIAC"); /** * Thaana. * '\u0780' - '\u07BF'. * @since 1.4 */ public final static UnicodeBlock THAANA = new UnicodeBlock('\u0780', '\u07BF', "THAANA"); /** * Devanagari. * '\u0900' - '\u097F'. */ public final static UnicodeBlock DEVANAGARI = new UnicodeBlock('\u0900', '\u097F', "DEVANAGARI"); /** * Bengali. * '\u0980' - '\u09FF'. */ public final static UnicodeBlock BENGALI = new UnicodeBlock('\u0980', '\u09FF', "BENGALI"); /** * Gurmukhi. * '\u0A00' - '\u0A7F'. */ public final static UnicodeBlock GURMUKHI = new UnicodeBlock('\u0A00', '\u0A7F', "GURMUKHI"); /** * Gujarati. * '\u0A80' - '\u0AFF'. */ public final static UnicodeBlock GUJARATI = new UnicodeBlock('\u0A80', '\u0AFF', "GUJARATI"); /** * Oriya. * '\u0B00' - '\u0B7F'. */ public final static UnicodeBlock ORIYA = new UnicodeBlock('\u0B00', '\u0B7F', "ORIYA"); /** * Tamil. * '\u0B80' - '\u0BFF'. */ public final static UnicodeBlock TAMIL = new UnicodeBlock('\u0B80', '\u0BFF', "TAMIL"); /** * Telugu. * '\u0C00' - '\u0C7F'. */ public final static UnicodeBlock TELUGU = new UnicodeBlock('\u0C00', '\u0C7F', "TELUGU"); /** * Kannada. * '\u0C80' - '\u0CFF'. */ public final static UnicodeBlock KANNADA = new UnicodeBlock('\u0C80', '\u0CFF', "KANNADA"); /** * Malayalam. * '\u0D00' - '\u0D7F'. */ public final static UnicodeBlock MALAYALAM = new UnicodeBlock('\u0D00', '\u0D7F', "MALAYALAM"); /** * Sinhala. * '\u0D80' - '\u0DFF'. * @since 1.4 */ public final static UnicodeBlock SINHALA = new UnicodeBlock('\u0D80', '\u0DFF', "SINHALA"); /** * Thai. * '\u0E00' - '\u0E7F'. */ public final static UnicodeBlock THAI = new UnicodeBlock('\u0E00', '\u0E7F', "THAI"); /** * Lao. * '\u0E80' - '\u0EFF'. */ public final static UnicodeBlock LAO = new UnicodeBlock('\u0E80', '\u0EFF', "LAO"); /** * Tibetan. * '\u0F00' - '\u0FFF'. */ public final static UnicodeBlock TIBETAN = new UnicodeBlock('\u0F00', '\u0FFF', "TIBETAN"); /** * Myanmar. * '\u1000' - '\u109F'. * @since 1.4 */ public final static UnicodeBlock MYANMAR = new UnicodeBlock('\u1000', '\u109F', "MYANMAR"); /** * Georgian. * '\u10A0' - '\u10FF'. */ public final static UnicodeBlock GEORGIAN = new UnicodeBlock('\u10A0', '\u10FF', "GEORGIAN"); /** * Hangul Jamo. * '\u1100' - '\u11FF'. */ public final static UnicodeBlock HANGUL_JAMO = new UnicodeBlock('\u1100', '\u11FF', "HANGUL_JAMO"); /** * Ethiopic. * '\u1200' - '\u137F'. * @since 1.4 */ public final static UnicodeBlock ETHIOPIC = new UnicodeBlock('\u1200', '\u137F', "ETHIOPIC"); /** * Cherokee. * '\u13A0' - '\u13FF'. * @since 1.4 */ public final static UnicodeBlock CHEROKEE
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -