au.gov.tas.dpiwe.mr.util
Class MutableLong

java.lang.Object
  extended by java.lang.Number
      extended by au.gov.tas.dpiwe.mr.util.MrNumber
          extended by au.gov.tas.dpiwe.mr.util.MutableLong
All Implemented Interfaces:
TypedNumber, Serializable, Cloneable, Comparable
Direct Known Subclasses:
LongRange

public class MutableLong
extends MrNumber
implements TypedNumber

The MutableLong class wraps a value of the primitive type long in an object. An object of type MutableLong contains a single field whose type is long, as well as a type value which suggests the preferred formatting.

Since:
Mr Architecture 2.3
Version:
1.0.0.3
Author:
Kade Hansson
See Also:
Serialized Form

Constructor Summary
MutableLong()
          Allocates a MutableLong object with the value 0.
MutableLong(long l)
          Allocates a MutableLong object.
 
Method Summary
 byte byteValue()
          Returns the value of this MutableLong as a byte primitive.
 double doubleValue()
          Returns the value of this MutableLong as a double primitive.
 boolean equals(Object obj)
          Compares this object to the specified object.
 float floatValue()
          Returns the value of this MutableLong as a float primitive.
 long getLong()
          Returns the value of this MutableLong object as an long primitive.
 Number getNumber()
          Returns the value of this MutableLong object as an immutable Long.
 int hashCode()
          Returns a hash code for this MutableLong.
 int intValue()
          Returns the value of this MutableLong as an int primitive.
 long longValue()
          Returns the value of this MutableLong as a long primitive.
 MutableLong setLong(long l)
          Changes the long primitive value of this MutableLong object.
 short shortValue()
          Returns the value of this MutableLong as a short primitive.
 String toString()
          Returns a String representing this MutableLong's value.
 
Methods inherited from class au.gov.tas.dpiwe.mr.util.MrNumber
clone, compareTo, divide, getMaximumFractionDigits, getMaximumIntegerDigits, getMinimumFractionDigits, getMinimumIntegerDigits, getType, getUnit, multiply, setMaximumFractionDigits, setMaximumIntegerDigits, setMinimumFractionDigits, setMinimumIntegerDigits, setType, setUnit
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface au.gov.tas.dpiwe.mr.util.TypedNumber
clone, divide, getMaximumFractionDigits, getMaximumIntegerDigits, getMinimumFractionDigits, getMinimumIntegerDigits, getType, getUnit, multiply, setMaximumFractionDigits, setMaximumIntegerDigits, setMinimumFractionDigits, setMinimumIntegerDigits, setType, setUnit
 

Constructor Detail

MutableLong

public MutableLong()
Allocates a MutableLong object with the value 0.


MutableLong

public MutableLong(long l)
Allocates a MutableLong object.

Parameters:
i - the long value to be wrapped.
Method Detail

getLong

public long getLong()
Returns the value of this MutableLong object as an long primitive.

Returns:
the primitive long value of this object.

getNumber

public Number getNumber()
Returns the value of this MutableLong object as an immutable Long.

Specified by:
getNumber in class MrNumber
Returns:
the Number value of this object.

setLong

public MutableLong setLong(long l)
Changes the long primitive value of this MutableLong object.

Parameters:
l - the new long value of this object.
Returns:
this object, containing the new value.

byteValue

public byte byteValue()
Returns the value of this MutableLong as a byte primitive.

Overrides:
byteValue in class Number

shortValue

public short shortValue()
Returns the value of this MutableLong as a short primitive.

Overrides:
shortValue in class Number

intValue

public int intValue()
Returns the value of this MutableLong as an int primitive.

Specified by:
intValue in class Number

longValue

public long longValue()
Returns the value of this MutableLong as a long primitive.

Specified by:
longValue in class Number

floatValue

public float floatValue()
Returns the value of this MutableLong as a float primitive.

Specified by:
floatValue in class Number

doubleValue

public double doubleValue()
Returns the value of this MutableLong as a double primitive.

Specified by:
doubleValue in class Number

toString

public String toString()
Returns a String representing this MutableLong's value.

The value is converted to signed decimal representation and returned as a string.

Overrides:
toString in class Object
Returns:
a string representation of the value of this object in base 10.

hashCode

public int hashCode()
Returns a hash code for this MutableLong.

Overrides:
hashCode in class Object
Returns:
a hash code value for this object.

equals

public boolean equals(Object obj)
Compares this object to the specified object.

The result is true if and only if the argument is not null and is an Long ot MutableLong object that contains the same long primitive value as this object.

Overrides:
equals in class Object
Parameters:
obj - the object to compare with.
Returns:
true if the objects are the same, false otherwise.