edu.indiana.util
Class MutableDouble

java.lang.Object
  extended by edu.indiana.util.MutableDouble
All Implemented Interfaces:
java.io.Serializable

public class MutableDouble
extends java.lang.Object
implements java.io.Serializable

This class is like the Double class, except that it is mutable.

See Also:
Serialized Form

Constructor Summary
protected MutableDouble()
           
  MutableDouble(double value)
          Creates new MutableDouble
 
Method Summary
 double doubleValue()
          Get the double associated with this MutableDouble.
 boolean equals(java.lang.Object other)
           
 int hashCode()
          Unique hashCodes for doubles up to 4 decimal places.
 void relativeChange(double delta)
          Change the value associated with this object by a specified amount.
 void setValue(double newValue)
           
 java.lang.String toString()
          Get a String representation of this MutableDouble.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MutableDouble

protected MutableDouble()

MutableDouble

public MutableDouble(double value)
Creates new MutableDouble

Method Detail

relativeChange

public void relativeChange(double delta)
Change the value associated with this object by a specified amount.


setValue

public void setValue(double newValue)

doubleValue

public double doubleValue()
Get the double associated with this MutableDouble.


toString

public java.lang.String toString()
Get a String representation of this MutableDouble.

Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Unique hashCodes for doubles up to 4 decimal places.

Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object