com.wm.data
Class MShort

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

public class MShort
extends java.lang.Number

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

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

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

Constructor Detail

MShort

public MShort(short num)
Constructs an MShort object and sets it to the specified short value.

Parameters:
num - A short that specifies the value of the new MShort object.

MShort

public MShort(java.lang.String s)
       throws java.lang.NumberFormatException
Constructs an MShort object and sets it according to the value specified in the String parameter, s. (The Short object's parseShort method is used to convert the string to a numeric value. The radix is assumed to be 10.)

Parameters:
s - A String that specifies the value of the new MShort object.
Throws:
java.lang.NumberFormatException - If s does not contain a String that can be successfully converted to a short value.
Method Detail

setValue

public void setValue(short num)
Sets this MShort object to the specified short value.

Parameters:
num - A short specifying the value to which this MShort object is to be set.

getValue

public short getValue()
Returns the value of this MShort object as a short.

Returns:
A short that has the numeric value represented by this MShort object.

toString

public java.lang.String toString()
Returns a String representation of this MShort object's value. (The Short 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 MShort object.

byteValue

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

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

shortValue

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

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

intValue

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

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

longValue

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

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

floatValue

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

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

doubleValue

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

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