|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Character
The Character class wraps a value of the primitive type char
in an object. An object of type Character
contains a
single field whose type is char
.
In addition, this class provides several methods for determining the type of a character and converting characters from uppercase to lowercase and vice versa.
Many of the methods of class Character
are defined
in terms of a "Unicode attribute table" that specifies
a name for every defined Unicode code point. The table also
includes other attributes, such as a decimal value, an uppercase
equivalent, a lowercase equivalent, and/or a titlecase equivalent.
The Unicode attribute table is available on the World Wide Web as
the file:
ftp://unicode.org/pub/MappingTables/UnicodeData1.1.5.txt
For a more detailed specification of the Character
class, one that encompasses the exact behavior of methods such as
isDigit
, isLetter
,
isLowerCase
, and isUpperCase
over the
full range of Unicode values, see Gosling, Joy, and Steele, The
Java Language Specification.
Field Summary | |
static int |
MAX_RADIX
The maximum radix available for conversion to and from Strings. |
static char |
MAX_VALUE
The constant value of this field is the largest value of type char . |
static int |
MIN_RADIX
The minimum radix available for conversion to and from Strings. |
static char |
MIN_VALUE
The constant value of this field is the smallest value of type char . |
Constructor Summary | |
Character(char Value)
Constructs a Character object and initializes it so
that it represents the primitive value argument. |
Method Summary | |
char |
charValue()
Returns the value of this Character object. |
static int |
digit(char ch,
int radix)
Returns the numeric value of the character ch in the
specified radix. |
boolean |
equals(Object obj)
Compares this object against the specified object. |
int |
hashCode()
Returns a hash code for this Character. |
static boolean |
isDigit(char ch)
Determines if the specified character is a digit. |
static boolean |
isLowerCase(char ch)
Determines if the specified character is a lowercase character. |
static boolean |
isUpperCase(char ch)
Determines if the specified character is an uppercase character. |
static char |
toLowerCase(char ch)
The given character is mapped to its lowercase equivalent; if the character has no lowercase equivalent, the character itself is returned. |
static char |
toUpperCase(char ch)
Converts the character argument to uppercase. |
Methods inherited from class java.lang.Object |
finalize,
getClass,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final int MIN_RADIX
digit
method, the forDigit
method, and the toString
method of class
Integer
.Integer.toString(int, int)
,
Integer.valueOf(java.lang.String)
public static final int MAX_RADIX
digit
method, the forDigit
method, and the toString
method of class
Integer
.Integer.toString(int, int)
,
Integer.valueOf(java.lang.String)
public static final char MIN_VALUE
char
.public static final char MAX_VALUE
char
.Constructor Detail |
public Character(char Value)
Character
object and initializes it so
that it represents the primitive value
argument.value
- value for the new Character
object.Method Detail |
public char charValue()
char
value represented by
this object.public int hashCode()
public boolean equals(Object obj)
true
if and only if the argument is not
null
and is a Character
object that
represents the same char
value as this object.obj
- the object to compare with.true
if the objects are the same;
false
otherwise.public static char toLowerCase(char ch)
ch
- the character to be converted.toUpperCase(char)
public static char toUpperCase(char ch)
ch
- the character to be converted.toLowerCase(char)
public static boolean isDigit(char ch)
ch
- the character to be tested.true
if the character is a digit;
false
otherwise.public static int digit(char ch, int radix)
ch
in the
specified radix.
This is only supported for ISO-LATIN-1 characters.ch
- the character to be converted.radix
- the radix.isDigit(char)
public static boolean isLowerCase(char ch)
ch
- the character to be tested.true
if the character is lowercase;
false
otherwise.isLowerCase(char)
,
toLowerCase(char)
public static boolean isUpperCase(char ch)
ch
- the character to be tested.true
if the character is uppercase;
false
otherwise.isLowerCase(char)
,
toUpperCase(char)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |