All Packages Class Hierarchy This Package Previous Next Index
Class rpi.goldsd.container.Char
java.lang.Object
|
+----rpi.goldsd.container.Char
- public class Char
- extends Object
- implements Hashable
The Char class provides a wrapper-class for the primitive data
type char. The actual character value (the char
instance variable) is a public instance variable.
- Version:
- 1.0, 4/16/98
- Author:
- David Goldschmidt
- See Also:
- Comparable, Hashable
-
MAX_VALUE
- The largest value of type Char.
-
MIN_VALUE
- The smallest value of type Char.
-
value
- The underlying primitive data type.
-
Char()
- Constructs a Char object with a default value of 0.
-
Char(char)
- Initializes the underlying char primitive data type.
-
hash()
- Returns the hash value of this Char object, which is simply
the underlying integer value of the character.
-
hash(int)
- Returns the hash value of this Char object, based on the
given hashtable size.
-
isEqualTo(Comparable)
- Returns true if this Char object is equal to the
given Comparable argument C, which must be of type
Char.
-
isLessThan(Comparable)
- Returns true if this Char object is less than the
given Comparable argument C, which must be of type
Char.
-
toString()
- Displays this Char object in the form of a String
object.
MIN_VALUE
public static final char MIN_VALUE
- The smallest value of type Char.
MAX_VALUE
public static final char MAX_VALUE
- The largest value of type Char.
value
public char value
- The underlying primitive data type.
Char
public Char(char v)
- Initializes the underlying char primitive data type.
- Parameters:
- v - the initial character value.
Char
public Char()
- Constructs a Char object with a default value of 0.
isEqualTo
public boolean isEqualTo(Comparable C) throws IllegalArgumentException
- Returns true if this Char object is equal to the
given Comparable argument C, which must be of type
Char.
- Parameters:
- C - the right-hand side of the comparison.
- Returns:
- true if this Char object is equal to the
given Char object C; false otherwise.
- Throws: IllegalArgumentException
- if the Comparable argument
is not of type Char.
isLessThan
public boolean isLessThan(Comparable C) throws IllegalArgumentException
- Returns true if this Char object is less than the
given Comparable argument C, which must be of type
Char.
- Parameters:
- C - the right-hand side of the comparison.
- Returns:
- true if this Char object is less than the
given Char object C; false otherwise.
- Throws: IllegalArgumentException
- if the Comparable argument
is not of type Char.
hash
public int hash()
- Returns the hash value of this Char object, which is simply
the underlying integer value of the character. If a more complex
hashing function is required, this method may be overridden.
- Returns:
- the hash value of this Char object.
hash
public int hash(int tableSize)
- Returns the hash value of this Char object, based on the
given hashtable size.
- Parameters:
- tableSize - the size of the hashtable making use of
this Char object.
- Returns:
- the hash value of this Char object.
toString
public String toString()
- Displays this Char object in the form of a String
object. This method simply returns a String representation
of the underlying character value.
- Returns:
- a String representing this Char object.
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index