Package sim.util
Class MutableDouble
java.lang.Object
java.lang.Number
sim.util.MutableDouble
- All Implemented Interfaces:
Serializable
,Cloneable
,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:
-
Field Details
-
val
public double val
-
-
Constructor Details
-
MutableDouble
public MutableDouble() -
MutableDouble
public MutableDouble(double val) -
MutableDouble
-
-
Method Details
-
toDouble
-
doubleValue
public double doubleValue()- Specified by:
doubleValue
in interfaceValuable
- Specified by:
doubleValue
in classNumber
-
floatValue
public float floatValue()- Specified by:
floatValue
in classNumber
-
intValue
public int intValue() -
longValue
public long longValue() -
clone
-
toString
-
isNaN
public boolean isNaN() -
isInfinite
public boolean isInfinite()
-