com.wm.data
Class MByte

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

public class MByte
extends java.lang.Number

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

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

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

Constructor Detail

MByte

public MByte(byte num)
Constructs an MByte object and sets it to the specified byte value.

Parameters:
num - A byte that specifies the value of the new MByte object.

MByte

public MByte(java.lang.String s)
      throws java.lang.NumberFormatException
Constructs an MByte object and sets it according to the value specified in the String parameter, s. When converting s to a byte value, the radix is assumed to be 10 (that is, the value is calculated using base 10).

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

setValue

public void setValue(byte num)
Sets this MByte object to the specified byte value.

Parameters:
num - A byte specifying the value to which this MByte object will be set.

getValue

public byte getValue()
Returns the value of this MByte object as a byte.

Returns:
A byte that has the numeric value represented by this MByte object.

toString

public java.lang.String toString()
Returns a String representation of this MByte object's value. When converting the object's value to a String, the radix is assumed to be 10 (that is, the value is calculated using base 10).

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

byteValue

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

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

shortValue

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

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

intValue

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

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

longValue

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

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

floatValue

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

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

doubleValue

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

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