All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class rpi.goldsd.container.Bool

java.lang.Object
   |
   +----rpi.goldsd.container.Bool

public class Bool
extends Object
implements Hashable
The Bool class provides a wrapper-class for the primitive data type boolean. The actual boolean value (the boolean instance variable) is a public instance variable.

Version:
1.0, 4/16/98
Author:
David Goldschmidt
See Also:
Comparable, Hashable

Variable Index

 o value
The underlying primitive data type.

Constructor Index

 o Bool()
Constructs a Bool object with default value false.
 o Bool(boolean)
Initializes the underlying boolean primitive data type.

Method Index

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

Variables

 o value
 public boolean value
The underlying primitive data type.

Constructors

 o Bool
 public Bool(boolean v)
Initializes the underlying boolean primitive data type.

Parameters:
v - the initial boolean value.
 o Bool
 public Bool()
Constructs a Bool object with default value false.

Methods

 o isEqualTo
 public boolean isEqualTo(Comparable C) throws IllegalArgumentException
Returns true if this Bool object is equal to the given Comparable argument C, which must be of type Bool.

Parameters:
C - the right-hand side of the comparison.
Returns:
true if this Bool object is equal to the given Bool object C; false otherwise.
Throws: IllegalArgumentException
if the Comparable argument is not of type Bool.
 o isLessThan
 public boolean isLessThan(Comparable C) throws IllegalArgumentException
Returns true if this Bool object is less than the given Comparable argument C, which must be of type Bool. The ordering of the boolean values is assumed to be { false, true }.

Parameters:
C - the right-hand side of the comparison.
Returns:
true if this Bool object is less than the given Bool object C; false otherwise.
Throws: IllegalArgumentException
if the Comparable argument is not of type Bool.
 o hash
 public int hash()
Returns the hash value of this Bool object, which is simply either 0 (false) or 1 (true). This is fairly useless, but included for completeness.

Returns:
the hash value of this Bool object.
 o hash
 public int hash(int tableSize)
Returns the hash value of this Bool object, based on the given hashtable size. The hash value is simply either 0 (false) or 1 (true). This is fairly useless, but included for completeness.

Parameters:
tableSize - the size of the hashtable making use of this Bool object.
Returns:
the hash value of this Bool object.
 o toString
 public String toString()
Displays this Bool object in the form of a String object. This method simply returns a String representation of the underlying boolean value.

Returns:
a String representing this Bool object.
Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index