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

Variable Index

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

Constructor Index

 o Real()
Constructs a Real object with a default value of 0.0.
 o Real(double)
Initializes the underlying double primitive data type.

Method Index

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

Variables

 o MIN_VALUE
 public static final double MIN_VALUE
The smallest value of type Real.

 o MAX_VALUE
 public static final double MAX_VALUE
The largest value of type Real.

 o value
 public double value
The underlying primitive data type.

Constructors

 o Real
 public Real(double v)
Initializes the underlying double primitive data type.

Parameters:
v - the initial double value.
 o Real
 public Real()
Constructs a Real object with a default value of 0.0.

Methods

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