java.lang
Class Character

java.lang.Object
  extended byjava.lang.Character
All Implemented Interfaces:
Comparable, Serializable

public class Character
extends java.lang.Object
implements Serializable, Comparable

Author:
josson smith 2006-8-5
See Also:
Serialized Form

Constructor Summary
Character(char value)
          Constructs a new instance of the receiver which represents the char valued argument.
 
Method Summary
 char charValue()
          Answers the char value which the receiver represents.
 int compareTo(Character c)
          Compare the receiver to the specified Character to determine the relative ordering.
 int compareTo(java.lang.Object o)
          Answers an integer indicating the relative positions of the receiver and the argument in the natural order of elements of the receiver's class.
static boolean isDigit(char c)
          Answers whether the character is a digit.
static boolean isLetter(char c)
          Answers whether the character is a letter.
static boolean isLetterOrDigit(char c)
          Answers whether the character is a letter or a digit.
static boolean isSpaceChar(char c)
          Answers whether the character is a Unicode space character.
static boolean isWhitespace(char c)
          Answers whether the character is a whitespace character in Java.
static char toLowerCase(char c)
          Answers the lower case equivalent for the character when the character is an upper case letter, otherwise answer the character.
static char toUpperCase(char c)
          Answers the upper case equivalent for the character when the character is a lower case letter, otherwise answer the character.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Character

public Character(char value)
Constructs a new instance of the receiver which represents the char valued argument.

Parameters:
value - the char to store in the new instance.
Method Detail

charValue

public char charValue()
Answers the char value which the receiver represents.

Returns:
char the value of the receiver

compareTo

public int compareTo(Character c)
Compare the receiver to the specified Character to determine the relative ordering.

Parameters:
c - the Character
Returns:
an int < 0 if this Character is less than the specified Character, 0 if they are equal, and > 0 if this Character is greater
Throws:
NullPointerException - if c is null.
Since:
1.2

compareTo

public int compareTo(java.lang.Object o)
Description copied from interface: Comparable
Answers an integer indicating the relative positions of the receiver and the argument in the natural order of elements of the receiver's class.

Specified by:
compareTo in interface Comparable
Parameters:
o - Object an object to compare the receiver to
Returns:
int which should be <0 if the receiver should sort before the argument, 0 if the receiver should sort in the same position as the argument, and >0 if the receiver should sort after the argument.

toLowerCase

public static char toLowerCase(char c)
Answers the lower case equivalent for the character when the character is an upper case letter, otherwise answer the character.

Parameters:
c - the character
Returns:
if c is not a lower case character then its lower case counterpart, otherwise just c

toUpperCase

public static char toUpperCase(char c)
Answers the upper case equivalent for the character when the character is a lower case letter, otherwise answer the character.

Parameters:
c - the character
Returns:
if c is not an upper case character then its upper case counterpart, otherwise just c

isDigit

public static boolean isDigit(char c)
Answers whether the character is a digit.

Parameters:
c - the character
Returns:
true when the character is a digit, false otherwise

isWhitespace

public static boolean isWhitespace(char c)
Answers whether the character is a whitespace character in Java.

Parameters:
c - the character
Returns:
true if the supplied c is a whitespace character in Java, otherwise false.

isLetter

public static boolean isLetter(char c)
Answers whether the character is a letter.

Parameters:
c - the character
Returns:
true when the character is a letter, false otherwise

isLetterOrDigit

public static boolean isLetterOrDigit(char c)
Answers whether the character is a letter or a digit.

Parameters:
c - the character
Returns:
true when the character is a letter or a digit, false otherwise

isSpaceChar

public static boolean isSpaceChar(char c)
Answers whether the character is a Unicode space character. A member of one of the Unicode categories Space Separator, Line Separator, or Paragraph Separator.

Parameters:
c - the character
Returns:
true when the character is a Unicode space character, false otherwise