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
-
value
- The underlying primitive data type.
-
Bool()
- Constructs a Bool object with default value false.
-
Bool(boolean)
- Initializes the underlying boolean primitive data type.
-
hash()
- Returns the hash value of this Bool object, which is simply
either 0 (false) or 1 (true).
-
hash(int)
- Returns the hash value of this Bool object, based on the
given hashtable size.
-
isEqualTo(Comparable)
- Returns true if this Bool object is equal to the
given Comparable argument C, which must be of type
Bool.
-
isLessThan(Comparable)
- Returns true if this Bool object is less than the
given Comparable argument C, which must be of type
Bool.
-
toString()
- Displays this Bool object in the form of a String
object.
value
public boolean value
- The underlying primitive data type.
Bool
public Bool(boolean v)
- Initializes the underlying boolean primitive data type.
- Parameters:
- v - the initial boolean value.
Bool
public Bool()
- Constructs a Bool object with default value false.
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.
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.
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.
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.
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