java.lang
Class Character
java.lang.Object
java.lang.Character
- All Implemented Interfaces:
- Comparable<Character>
public final class Character
- extends Object
- implements Comparable<Character>
Method Summary |
static int |
charCount(int codepoint)
|
char |
charValue()
|
int |
codePointAt(char[] c,
int index)
|
int |
codePointAt(char[] c,
int index,
int limit)
|
int |
codePointAt(CharSequence c,
int index)
|
int |
codePointBefore(char[] c,
int index)
|
int |
codePointBefore(char[] c,
int index,
int start)
|
int |
codePointBefore(CharSequence c,
int index)
|
int |
compareTo(Character ob)
Compares this with another Object. |
static int |
digit(char ch,
int radix)
This method accepts a character such as '7' or 'C' and converts
it to a number value. |
static int |
digit(int ch,
int radix)
|
boolean |
equals(Object o)
|
static char |
forDigit(int digit,
int radix)
|
int |
hashCode()
|
static boolean |
isDigit(char ch)
Identifies if a character is a numerical digit. |
static boolean |
isHighSurrogate(char high)
|
static boolean |
isLowSurrogate(char low)
|
static boolean |
isSupplementaryCodePoint(int codepoint)
|
static boolean |
isSurrogatePair(char high,
char low)
|
static boolean |
isValidCodePoint(int codepoint)
|
static char |
reverseBytes(char c)
|
static char[] |
toChars(int codepoint)
|
static int |
toChars(int codepoint,
char[] dst,
int off)
|
static int |
toCodePoint(char high,
char low)
|
String |
toString()
|
static String |
toString(char c)
|
static Character |
valueOf(char c)
|
SIZE
public static final int SIZE
- See Also:
- Constant Field Values
MIN_RADIX
public static final int MIN_RADIX
- See Also:
- Constant Field Values
MAX_RADIX
public static final int MAX_RADIX
- See Also:
- Constant Field Values
MIN_VALUE
public static final char MIN_VALUE
- See Also:
- Constant Field Values
MAX_VALUE
public static final char MAX_VALUE
- See Also:
- Constant Field Values
MIN_HIGH_SURROGATE
public static final char MIN_HIGH_SURROGATE
- See Also:
- Constant Field Values
MAX_HIGH_SURROGATE
public static final char MAX_HIGH_SURROGATE
- See Also:
- Constant Field Values
MIN_LOW_SURROGATE
public static final char MIN_LOW_SURROGATE
- See Also:
- Constant Field Values
MAX_LOW_SURROGATE
public static final char MAX_LOW_SURROGATE
- See Also:
- Constant Field Values
MIN_SURROGATE
public static final char MIN_SURROGATE
- See Also:
- Constant Field Values
MAX_SURROGATE
public static final char MAX_SURROGATE
- See Also:
- Constant Field Values
MIN_CODE_POINT
public static final int MIN_CODE_POINT
- See Also:
- Constant Field Values
MIN_SUPPLEMENTARY_CODE_POINT
public static final int MIN_SUPPLEMENTARY_CODE_POINT
- See Also:
- Constant Field Values
MAX_CODE_POINT
public static final int MAX_CODE_POINT
- See Also:
- Constant Field Values
Character
public Character(char c)
charValue
public char charValue()
compareTo
public int compareTo(Character ob)
- Description copied from interface:
Comparable
- Compares this with another Object.
Returns -1 if this object is smaller,
0 if both objects are equal and
1 if this object is bigger.
- Specified by:
compareTo
in interface Comparable<Character>
- Parameters:
ob
- the object to compare with
- Returns:
- one of the values -1, 0, 1
codePointAt
public int codePointAt(char[] c,
int index)
codePointAt
public int codePointAt(char[] c,
int index,
int limit)
codePointAt
public int codePointAt(CharSequence c,
int index)
codePointBefore
public int codePointBefore(char[] c,
int index)
codePointBefore
public int codePointBefore(char[] c,
int index,
int start)
codePointBefore
public int codePointBefore(CharSequence c,
int index)
isDigit
public static boolean isDigit(char ch)
- Identifies if a character is a numerical digit.
- Parameters:
ch
- the character
- Returns:
- true iff the character is a numerical digit
isLowSurrogate
public static boolean isLowSurrogate(char low)
isHighSurrogate
public static boolean isHighSurrogate(char high)
isSurrogatePair
public static boolean isSurrogatePair(char high,
char low)
isValidCodePoint
public static boolean isValidCodePoint(int codepoint)
isSupplementaryCodePoint
public static boolean isSupplementaryCodePoint(int codepoint)
charCount
public static int charCount(int codepoint)
toChars
public static char[] toChars(int codepoint)
toChars
public static int toChars(int codepoint,
char[] dst,
int off)
toCodePoint
public static int toCodePoint(char high,
char low)
digit
public static int digit(char ch,
int radix)
- This method accepts a character such as '7' or 'C' and converts
it to a number value. So '7' returns 7 and 'C' returns 12,
which is the hexidecimal value of C. You must specify a radix
for the number system. If the digit is not defined for the specified
radix or the radix is invalid, -1 is returned.
- Parameters:
ch
- the characterradix
- the radix
- Returns:
- the numerical value of the digit
digit
public static int digit(int ch,
int radix)
equals
public boolean equals(Object o)
- Overrides:
equals
in class Object
forDigit
public static char forDigit(int digit,
int radix)
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
toString
public String toString()
- Overrides:
toString
in class Object
toString
public static String toString(char c)
valueOf
public static Character valueOf(char c)
reverseBytes
public static char reverseBytes(char c)