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

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.NullableNumber
              extended by au.gov.tas.dpiwe.mr.util.NullableLong
All Implemented Interfaces:
TypedNumber, Serializable, Cloneable, Comparable

public class NullableLong
extends NullableNumber
implements Comparable

This is an emulation of Long which can simulate a null reference. It can be used to indicate a search for null values in a find[All]WhereFieldEqual() and find[All]InOrder() method.

Since:
Ms Architecture 1.3
Version:
1.0.0.6
Author:
Kade Hansson, au.gov.tas.dpiwe.mr.tool.NullableMaker
See Also:
Serialized Form

Constructor Summary
NullableLong(long notnullable)
          Construct a new NullableLong.
NullableLong(Long nullable)
          Construct a new NullableLong.
 
Method Summary
 byte byteValue()
           
 double doubleValue()
           
 boolean equals(Object object1)
           
 float floatValue()
           
 Number getNumber()
          The Long underlying this NullableLong.
 int hashCode()
           
 int intValue()
           
 boolean isNull()
          Returns true if this NullableLong represents the null value.
 long longValue()
           
 short shortValue()
           
 String toString()
           
 
Methods inherited from class au.gov.tas.dpiwe.mr.util.NullableNumber
compareTo
 
Methods inherited from class au.gov.tas.dpiwe.mr.util.MrNumber
clone, 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 java.lang.Comparable
compareTo
 
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

NullableLong

public NullableLong(Long nullable)
Construct a new NullableLong.

Parameters:
nullable - a Long instance or null.

NullableLong

public NullableLong(long notnullable)
Construct a new NullableLong.

Parameters:
notnullable - a long value.
Method Detail

getNumber

public Number getNumber()
The Long underlying this NullableLong.

Specified by:
getNumber in class MrNumber
Returns:
a Long instance or null.

isNull

public boolean isNull()
Returns true if this NullableLong represents the null value.

Returns:
true if this NullableLong represents the null value, false otherwise.

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object object1)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object
Returns:
"null" if this object represents a null, otherwise a string representation of the underlying Long.

byteValue

public byte byteValue()
               throws RuntimeException
Overrides:
byteValue in class Number
Throws:
RuntimeException

shortValue

public short shortValue()
                 throws RuntimeException
Overrides:
shortValue in class Number
Throws:
RuntimeException

intValue

public int intValue()
             throws RuntimeException
Specified by:
intValue in class Number
Throws:
RuntimeException

longValue

public long longValue()
               throws RuntimeException
Specified by:
longValue in class Number
Throws:
RuntimeException

floatValue

public float floatValue()
                 throws RuntimeException
Specified by:
floatValue in class Number
Throws:
RuntimeException

doubleValue

public double doubleValue()
                   throws RuntimeException
Specified by:
doubleValue in class Number
Throws:
RuntimeException