| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.lang.Character
public final class Character
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.
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.
See http://www.unicode.org for more information on the Unicode Standard.
| Field Summary | |
|---|---|
| static byte | COMBINING_SPACING_MARKMc = Mark, Spacing Combining (Normative). | 
| static byte | CONNECTOR_PUNCTUATIONPc = Punctuation, Connector (Informative). | 
| static byte | CONTROLCc = Other, Control (Normative). | 
| static byte | CURRENCY_SYMBOLSc = Symbol, Currency (Informative). | 
| static byte | DASH_PUNCTUATIONPd = Punctuation, Dash (Informative). | 
| static byte | DECIMAL_DIGIT_NUMBERNd = Number, Decimal Digit (Normative). | 
| static byte | ENCLOSING_MARKMe = Mark, Enclosing (Normative). | 
| static byte | END_PUNCTUATIONPe = Punctuation, Close (Informative). | 
| static byte | FINAL_QUOTE_PUNCTUATIONPf = Punctuation, Final Quote (Informative). | 
| static byte | FORMATCf = Other, Format (Normative). | 
| static byte | INITIAL_QUOTE_PUNCTUATIONPi = Punctuation, Initial Quote (Informative). | 
| static byte | LETTER_NUMBERNl = Number, Letter (Normative). | 
| static byte | LINE_SEPARATORZl = Separator, Line (Normative). | 
| static byte | LOWERCASE_LETTERLl = Letter, Lowercase (Informative). | 
| static byte | MATH_SYMBOLSm = Symbol, Math (Informative). | 
| static int | MAX_RADIXLargest value allowed for radix arguments in Java. | 
| static char | MAX_VALUEThe maximum value the char data type can hold. | 
| static int | MIN_RADIXSmallest value allowed for radix arguments in Java. | 
| static char | MIN_VALUEThe minimum value the char data type can hold. | 
| static byte | MODIFIER_LETTERLm = Letter, Modifier (Informative). | 
| static byte | MODIFIER_SYMBOLSk = Symbol, Modifier (Informative). | 
| static byte | NON_SPACING_MARKMn = Mark, Non-Spacing (Normative). | 
| static byte | OTHER_LETTERLo = Letter, Other (Informative). | 
| static byte | OTHER_NUMBERNo = Number, Other (Normative). | 
| static byte | OTHER_PUNCTUATIONPo = Punctuation, Other (Informative). | 
| static byte | OTHER_SYMBOLSo = Symbol, Other (Informative). | 
| static byte | PARAGRAPH_SEPARATORZp = Separator, Paragraph (Normative). | 
| static byte | PRIVATE_USECo = Other, Private Use (Normative). | 
| static int | SIZEThe number of bits needed to represent a char. | 
| static byte | SPACE_SEPARATORZs = Separator, Space (Normative). | 
| static byte | START_PUNCTUATIONPs = Punctuation, Open (Informative). | 
| static byte | SURROGATECs = Other, Surrogate (Normative). | 
| static byte | TITLECASE_LETTERLt = Letter, Titlecase (Informative). | 
| static Class | TYPEClass object representing the primitive char data type. | 
| static byte | UNASSIGNEDCn = Other, Not Assigned (Normative). | 
| static byte | UPPERCASE_LETTERLu = Letter, Uppercase (Informative). | 
| Constructor Summary | |
|---|---|
| Character(char value)Wraps up a character. | |
| Method Summary | |
|---|---|
|  char | charValue()Returns the character which has been wrapped by this class. | 
|  int | compareTo(Character anotherCharacter)Compares another Character to this Character, numerically. | 
|  int | compareTo(Object o)Compares an object to this Character. | 
| static int | digit(char ch,
      int radix)Converts a character into a digit of the specified radix. | 
|  boolean | equals(Object o)Determines if an object is equal to this object. | 
| static char | forDigit(int digit,
         int radix)Converts a digit into a character which represents that digit in a specified radix. | 
|  int | hashCode()Returns the numerical value (unsigned) of the wrapped character. | 
| static boolean | isDigit(char ch)Determines if a character is a Unicode decimal digit. | 
| static boolean | isLetter(char ch)Determines if a character is a Unicode letter. | 
| static boolean | isLetterOrDigit(char ch)Determines if a character is a Unicode letter or a Unicode digit. | 
| static boolean | isLowerCase(char ch)Determines if a character is a Unicode lowercase letter. | 
| static boolean | isSpace(char ch)Deprecated. Replaced by isWhitespace(char) | 
| static boolean | isSpaceChar(char ch)Determines if a character is a Unicode space character. | 
| static boolean | isUpperCase(char ch)Determines if a character is a Unicode uppercase letter. | 
| static boolean | isWhitespace(char ch)Determines if a character is Java whitespace. | 
| static char | reverseBytes(char val)Reverse the bytes in val. | 
| static char | toLowerCase(char ch)Converts a Unicode character into its lowercase equivalent mapping. | 
|  String | toString()Converts the wrapped character into a String. | 
| static String | toString(char ch)Returns a String of length 1 representing the specified character. | 
| static char | toUpperCase(char ch)Converts a Unicode character into its uppercase equivalent mapping. | 
| static Character | valueOf(char val)Returns an Characterobject wrapping the value. | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, finalize, getClass, notify, notifyAll, wait, wait, wait | 
| Field Detail | 
|---|
public static final int MIN_RADIX
digit(char, int), 
forDigit(int, int), 
Integer.toString(int, int), 
Integer.valueOf(String), 
Constant Field Valuespublic static final int MAX_RADIX
digit(char, int), 
forDigit(int, int), 
Integer.toString(int, int), 
Integer.valueOf(String), 
Constant Field Valuespublic static final char MIN_VALUE
'\\u0000'.
public static final char MAX_VALUE
'\\uFFFF'.
public static final Class TYPE
public static final int SIZE
char.
public static final byte UPPERCASE_LETTER
public static final byte LOWERCASE_LETTER
public static final byte TITLECASE_LETTER
public static final byte NON_SPACING_MARK
public static final byte COMBINING_SPACING_MARK
public static final byte ENCLOSING_MARK
public static final byte DECIMAL_DIGIT_NUMBER
public static final byte LETTER_NUMBER
public static final byte OTHER_NUMBER
public static final byte SPACE_SEPARATOR
public static final byte LINE_SEPARATOR
public static final byte PARAGRAPH_SEPARATOR
public static final byte CONTROL
public static final byte FORMAT
public static final byte SURROGATE
public static final byte PRIVATE_USE
public static final byte UNASSIGNED
public static final byte MODIFIER_LETTER
public static final byte OTHER_LETTER
public static final byte CONNECTOR_PUNCTUATION
public static final byte DASH_PUNCTUATION
public static final byte START_PUNCTUATION
public static final byte END_PUNCTUATION
public static final byte INITIAL_QUOTE_PUNCTUATION
public static final byte FINAL_QUOTE_PUNCTUATION
public static final byte OTHER_PUNCTUATION
public static final byte MATH_SYMBOL
public static final byte CURRENCY_SYMBOL
public static final byte MODIFIER_SYMBOL
public static final byte OTHER_SYMBOL
| Constructor Detail | 
|---|
public Character(char value)
value - the character to wrap| Method Detail | 
|---|
public char charValue()
public int hashCode()
hashCode in class ObjectObject.equals(Object), 
System.identityHashCode(Object)public boolean equals(Object o)
equals in class Objecto - object to compare
Object.hashCode()public String toString()
toString in class ObjectObject.getClass(), 
Object.hashCode(), 
Class.getName(), 
Integer.toHexString(int)public static String toString(char ch)
ch - the character to convert
public static boolean isLowerCase(char ch)
'a' is lowercase.
 
ch - character to test
isUpperCase(char), 
#isTitleCase(char), 
toLowerCase(char), 
#getType(char)public static boolean isUpperCase(char ch)
'A' is uppercase.
 
ch - character to test
isLowerCase(char), 
#isTitleCase(char), 
toUpperCase(char), 
#getType(char)public static boolean isDigit(char ch)
'0' is a digit.
 
ch - character to test
digit(char, int), 
forDigit(int, int), 
#getType(char)public static boolean isLetter(char ch)
ch - character to test
isDigit(char), 
#isJavaIdentifierStart(char), 
#isJavaLetter(char), 
#isJavaLetterOrDigit(char), 
isLetterOrDigit(char), 
isLowerCase(char), 
#isTitleCase(char), 
#isUnicodeIdentifierStart(char), 
isUpperCase(char)public static boolean isLetterOrDigit(char ch)
ch - character to test
isDigit(char), 
#isJavaIdentifierPart(char), 
#isJavaLetter(char), 
#isJavaLetterOrDigit(char), 
isLetter(char), 
#isUnicodeIdentifierPart(char)public static char toLowerCase(char ch)
ch - character to convert to lowercase
isLowerCase(char), 
isUpperCase(char), 
#toTitleCase(char), 
toUpperCase(char)public static char toUpperCase(char ch)
ch - character to convert to uppercase
isLowerCase(char), 
isUpperCase(char), 
toLowerCase(char), 
#toTitleCase(char)
public static int digit(char ch,
                        int radix)
ch - character to convert into a digitradix - radix in which ch is a digit
MIN_RADIX, 
MAX_RADIX, 
forDigit(int, int), 
isDigit(char), 
#getNumericValue(char)public static boolean isSpace(char ch)
isWhitespace(char)
'\t', '\n', '\f',
 '\r', and ' '.
 
ch - character to test
isSpaceChar(char), 
isWhitespace(char)public static boolean isSpaceChar(char ch)
ch - character to test
isWhitespace(char)public static boolean isWhitespace(char ch)
' ', '?', and '?');
 and these characters: '  ', '
                                                               ',
 '', '                                         ', '
                                                                ',
 '', '', '',
 and ''.
 
ch - character to test
isSpaceChar(char)
public static char forDigit(int digit,
                            int radix)
'\0'
 is returned.  Otherwise the return value is in '0'-'9' and 'a'-'z'.
 
digit - digit to be converted into a characterradix - radix of digit
MIN_RADIX, 
MAX_RADIX, 
digit(char, int)public int compareTo(Character anotherCharacter)
anotherCharacter - Character to compare with this Character
NullPointerException - if anotherCharacter is nullpublic int compareTo(Object o)
compareTo in interface Comparableo - object to compare
ClassCastException - if o is not a Character object
NullPointerException - if o is nullcompareTo(Character)public static Character valueOf(char val)
Character object wrapping the value.
 In contrast to the Character constructor, this method
 will cache some values.  It is used by boxing conversion.
val - the value to wrap
Characterpublic static char reverseBytes(char val)
| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||