com.wm.data
Class MDouble

java.lang.Object
  extended by java.lang.Number
      extended by com.wm.data.MDouble
All Implemented Interfaces:
java.io.Serializable

public class MDouble
extends java.lang.Number

This class is a wrapper for double values and is similar to the existing Java wrapper class Double. However, unlike the Double class, MDouble is mutable, allowing you to change the double value that it wraps.

See Also:
MBoolean, MByte, MFloat, MInteger, MLong, MShort, Serialized Form

Constructor Summary
MDouble(double num)
          Constructs an MDouble object and sets it to the specified double value.
MDouble(java.lang.String s)
          Constructs an MDouble object and sets it according to the value specified in the String parameter, s.
 
Method Summary
 byte byteValue()
          Returns the value of this MDouble object as a byte.
 double doubleValue()
          Returns the value of the MDouble object as a double.
 float floatValue()
          Returns the value of the MDouble object as a float.
 double getValue()
          Returns the value of this MDouble object as a double.
 int intValue()
          Returns the value of the MDouble object as an int.
 long longValue()
          Returns the value of the MDouble object as a long.
 void setValue(double num)
          Sets this MDouble object to the specified double value.
 short shortValue()
          Returns the value of this MDouble object as a short.
 java.lang.String toString()
          Returns a String representation of this MDouble object's value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MDouble

public MDouble(double num)
Constructs an MDouble object and sets it to the specified double value.

Parameters:
num - A double specifying the value to which you want the new MDouble object set.

MDouble

public MDouble(java.lang.String s)
        throws java.lang.NumberFormatException
Constructs an MDouble object and sets it according to the value specified in the String parameter, s. (The Double object's valueOf method is used to convert the string to a numeric value.)

Parameters:
s - A String specifying the value to which you want the new MDouble object set.
Throws:
java.lang.NumberFormatException - If s does not contain a String that can be successfully converted to a double value.
Method Detail

setValue

public void setValue(double num)
Sets this MDouble object to the specified double value.

Parameters:
num - A double specifying the value to which you want this MDouble object set.

getValue

public double getValue()
Returns the value of this MDouble object as a double.

Returns:
A double that has the numeric value represented by this MDouble object.

toString

public java.lang.String toString()
Returns a String representation of this MDouble object's value. (The Double object's toString method is used to convert the object's value to a String.)

Overrides:
toString in class java.lang.Object
Returns:
A String representation of the numeric value contained in this MDouble object.

byteValue

public byte byteValue()
Returns the value of this MDouble object as a byte.

Overrides:
byteValue in class java.lang.Number
Returns:
A byte that has the numeric value represented by this MFDouble object.

shortValue

public short shortValue()
Returns the value of this MDouble object as a short.

Overrides:
shortValue in class java.lang.Number
Returns:
A short that has the numeric value represented by this MDouble object.

intValue

public int intValue()
Returns the value of the MDouble object as an int.

Specified by:
intValue in class java.lang.Number
Returns:
An int that has the numeric value represented by this MDouble object.

longValue

public long longValue()
Returns the value of the MDouble object as a long.

Specified by:
longValue in class java.lang.Number
Returns:
A long that has the numeric value represented by this MDouble object.

floatValue

public float floatValue()
Returns the value of the MDouble object as a float.

Specified by:
floatValue in class java.lang.Number
Returns:
A float that has the numeric value represented by this MDouble object.

doubleValue

public double doubleValue()
Returns the value of the MDouble object as a double.

Specified by:
doubleValue in class java.lang.Number
Returns:
A double that has the numeric value represented by this MDouble object.