|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Number org.jboss.util.MuNumber org.jboss.util.MuDouble
A mutable double class.
Constructor Summary | |
MuDouble()
Construct a new mutable double. |
|
MuDouble(double d)
Construct a new mutable double. |
|
MuDouble(Object obj)
Construct a new mutable double. |
Method Summary | |
double |
add(double amount)
Add the specified amount. |
byte |
byteValue()
Return the byte value of this object. |
Object |
clone()
Return a cloned copy of this mutable double. |
boolean |
commit(double assumed,
double b)
Set the value to value only if the current value is equal to the assumed value. |
int |
compareTo(double other)
Compares this object with the specified double for order. |
int |
compareTo(Object obj)
Compares this object with the specified object for order. |
double |
divide(double factor)
Divide by the specified factor. |
double |
doubleValue()
Return the double value of this object. |
boolean |
equals(Object obj)
Test the equality of this mutable double with another object. |
float |
floatValue()
Return the float value of this object. |
double |
get()
Get the current value. |
Object |
getValue()
Get the value of this mutable double. |
int |
hashCode()
Get the hash code for this mutable double. |
int |
intValue()
Return the int value of this object. |
long |
longValue()
Return the long value of this object. |
double |
multiply(double factor)
Multiply by the specified factor. |
double |
negate()
Set the value to the negative of its current value. |
double |
set(double f)
Set the value. |
void |
setValue(Object obj)
Set the value of this mutable double. |
short |
shortValue()
Return the short value of this object. |
double |
subtract(double amount)
Subtract the specified amount. |
double |
swap(MuDouble b)
Swap values with another mutable double. |
String |
toString()
Convert this mutable double to a string. |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public MuDouble()
public MuDouble(double d)
d
- double
value.public MuDouble(Object obj)
obj
- Object to convert to a double
value.Method Detail |
public double set(double f)
f
- double
value.
public double get()
public boolean commit(double assumed, double b)
assumed
- The assumed value.b
- The new value.
public double swap(MuDouble b)
b
- Mutable double to swap values with.
public double add(double amount)
amount
- Amount to add.
public double subtract(double amount)
amount
- Amount to subtract.
public double multiply(double factor)
factor
- Factor to multiply by.
public double divide(double factor)
factor
- Factor to divide by.
public double negate()
public int compareTo(double other)
other
- Value to compare with.
public int compareTo(Object obj)
ClassCastException
- Object is not a MuDouble.public String toString()
public int hashCode()
public boolean equals(Object obj)
obj
- Object to test
public Object clone()
public byte byteValue()
public short shortValue()
short
value of this object.
shortValue
in class MuNumber
short
value.public int intValue()
public long longValue()
long
value of this object.
long
value.public float floatValue()
float
value of this object.
floatValue
in class MuNumber
float
value.public double doubleValue()
double
value of this object.
double
value.public void setValue(Object obj)
obj
- Object to convert to a double
value.
NotCoercibleException
- Can not convert to double
.public Object getValue()
java.lang.Double
value
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |