sim.util
Class MutableDouble
java.lang.Object
java.lang.Number
sim.util.MutableDouble
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, Valuable
public class MutableDouble
- extends java.lang.Number
- implements Valuable, java.lang.Cloneable
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
Methods inherited from class java.lang.Number |
byteValue, shortValue |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
val
public double val
MutableDouble
public MutableDouble()
MutableDouble
public MutableDouble(double val)
MutableDouble
public MutableDouble(MutableDouble md)
doubleValue
public double doubleValue()
- Specified by:
doubleValue
in interface Valuable
- Specified by:
doubleValue
in class java.lang.Number
floatValue
public float floatValue()
- Specified by:
floatValue
in class java.lang.Number
intValue
public int intValue()
- Specified by:
intValue
in class java.lang.Number
longValue
public long longValue()
- Specified by:
longValue
in class java.lang.Number
clone
public java.lang.Object clone()
- Overrides:
clone
in class java.lang.Object