Class java.lang.Character
All Packages Class Hierarchy This Package Previous Next Index
Class java.lang.Character
java.lang.Object
|
+----java.lang.Character
- public final class Character
- extends Object
The Character class provides an object wrapper for Character data values
and serves as a place for character-oriented operations. A wrapper is useful
because most of Java's utility classes require the use of objects. Since characters
are not objects in Java, they need to be "wrapped" in a Character instance.
-
MAX_RADIX
- The maximum radix available for conversion to and from Strings.
-
MIN_RADIX
- The minimum radix available for conversion to and from Strings.
-
Character(char)
- Constructs a Character object with the specified value.
-
charValue()
- Returns the value of this Character object.
-
digit(char, int)
- Returns the numeric value of the character digit using the specified
radix.
-
equals(Object)
- Compares this object against the specified object.
-
forDigit(int, int)
- Returns the character value for the specified digit in the specified
radix.
-
hashCode()
- Returns a hashcode for this Character.
-
isDigit(char)
- Determines if the specified character is a ISO-LATIN-1 digit.
-
isLowerCase(char)
- Determines if the specified character is ISO-LATIN-1 lower case.
-
isSpace(char)
- Determines if the specified character is ISO-LATIN-1 white space according to Java.
-
isUpperCase(char)
- Determines if the specified character is ISO-LATIN-1 upper case.
-
toLowerCase(char)
- Returns the lower case character value of the specified ISO-LATIN-1
character.
-
toString()
- Returns a String object representing this character's value.
-
toUpperCase(char)
- Returns the upper case character value of the specified ISO-LATIN-1
character.
MIN_RADIX
public final static int MIN_RADIX
- The minimum radix available for conversion to and from Strings.
The lowest minimum value that a radix can be is 2.
- See Also:
- toString
MAX_RADIX
public final static int MAX_RADIX
- The maximum radix available for conversion to and from Strings. The
largest maximum value that a radix can have is 36.
- See Also:
- toString
Character
public Character(char value)
- Constructs a Character object with the specified value.
- Parameters:
- value - value of this Character object
isLowerCase
public static boolean isLowerCase(char ch)
- Determines if the specified character is ISO-LATIN-1 lower case.
- Parameters:
- ch - the character to be tested
- Returns:
- true if the character is lower case; false otherwise.
isUpperCase
public static boolean isUpperCase(char ch)
- Determines if the specified character is ISO-LATIN-1 upper case.
- Parameters:
- ch - the character to be tested
- Returns:
- true if the character is upper case; false otherwise.
isDigit
public static boolean isDigit(char ch)
- Determines if the specified character is a ISO-LATIN-1 digit.
- Parameters:
- ch - the character to be tested
- Returns:
- true if this character is a digit; false otherwise.
isSpace
public static boolean isSpace(char ch)
- Determines if the specified character is ISO-LATIN-1 white space according to Java.
- Parameters:
- ch - the character to be tested
- Returns:
- true if the character is white space; false otherwise.
toLowerCase
public static char toLowerCase(char ch)
- Returns the lower case character value of the specified ISO-LATIN-1
character. Characters that are not upper case letters are returned
unmodified.
- Parameters:
- ch - the character to be converted
toUpperCase
public static char toUpperCase(char ch)
- Returns the upper case character value of the specified ISO-LATIN-1
character.
Characters that are not lower case letters are returned unmodified.
Note that German ess-zed and latin small letter y diaeresis have no
corresponding upper case letters, even though they are lower case.
There is a capital y diaeresis, but not in ISO-LATIN-1...
- Parameters:
- ch - the character to be converted
digit
public static int digit(char ch,
int radix)
- Returns the numeric value of the character digit using the specified
radix. If the character is not a valid digit, it returns -1.
- Parameters:
- ch - the character to be converted
- radix - the radix
forDigit
public static char forDigit(int digit,
int radix)
- Returns the character value for the specified digit in the specified
radix. If the digit is not valid in the radix, the 0 character
is returned.
- Parameters:
- digit - the digit chosen by the character value
- radix - the radix containing the digit
charValue
public char charValue()
- Returns the value of this Character object.
hashCode
public int hashCode()
- Returns a hashcode for this Character.
- Overrides:
- hashCode in class Object
equals
public boolean equals(Object obj)
- Compares this object against the specified object.
- Parameters:
- obj - the object to compare with
- Returns:
- true if the objects are the same; false otherwise.
- Overrides:
- equals in class Object
toString
public String toString()
- Returns a String object representing this character's value.
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index