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

Variable Index

 o MAX_VALUE
The largest value of type Char.
 o MIN_VALUE
The smallest value of type Char.
 o value
The underlying primitive data type.

Constructor Index

 o Char()
Constructs a Char object with a default value of 0.
 o Char(char)
Initializes the underlying char primitive data type.

Method Index

 o hash()
Returns the hash value of this Char object, which is simply the underlying integer value of the character.
 o hash(int)
Returns the hash value of this Char object, based on the given hashtable size.
 o isEqualTo(Comparable)
Returns true if this Char object is equal to the given Comparable argument C, which must be of type Char.
 o isLessThan(Comparable)
Returns true if this Char object is less than the given Comparable argument C, which must be of type Char.
 o toString()
Displays this Char object in the form of a String object.

Variables

 o MIN_VALUE
 public static final char MIN_VALUE
The smallest value of type Char.

 o MAX_VALUE
 public static final char MAX_VALUE
The largest value of type Char.

 o value
 public char value
The underlying primitive data type.

Constructors

 o Char
 public Char(char v)
Initializes the underlying char primitive data type.

Parameters:
v - the initial character value.
 o Char
 public Char()
Constructs a Char object with a default value of 0.

Methods

 o 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.
 o 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.
 o 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.
 o 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.
 o 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