sim.util
Class MutableDouble

java.lang.Object
  extended byjava.lang.Number
      extended bysim.util.MutableDouble
All Implemented Interfaces:
java.io.Serializable, Valuable

public class MutableDouble
extends java.lang.Number
implements Valuable

MutableDouble simply holds a double value, which can be changed at any time. Can't get much simpler than a class like this! Note that this class is not synchronized, and shouldn't be used in a multithreaded environment without a lock. Note that MutableDouble hashes by ADDRESS and not by VALUE. Thus (new MutableDouble(2)).equals(new MutableDouble(2)) is FALSE.

See Also:
Serialized Form

Field Summary
 double val
           
 
Constructor Summary
MutableDouble()
           
MutableDouble(double val)
           
MutableDouble(MutableDouble md)
           
 
Method Summary
 double doubleValue()
           
 float floatValue()
           
 int intValue()
           
 long longValue()
           
 
Methods inherited from class java.lang.Number
byteValue, shortValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

val

public double val
Constructor Detail

MutableDouble

public MutableDouble()

MutableDouble

public MutableDouble(double val)

MutableDouble

public MutableDouble(MutableDouble md)
Method Detail

doubleValue

public double doubleValue()
Specified by:
doubleValue in interface Valuable

floatValue

public float floatValue()

intValue

public int intValue()

longValue

public long longValue()