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