uk.ac.ic.doc.automed.wrappers
Class AutoMedInteger

java.lang.Object
  extended by uk.ac.ic.doc.automed.wrappers.AutoMedType
      extended by uk.ac.ic.doc.automed.wrappers.AutoMedInteger

public class AutoMedInteger
extends AutoMedType

Provides generic representation of integer values with up to 64 bit precision.

Author:
Peter McBrien (pjm@doc.ic.ac.uk)

Field Summary
 
Fields inherited from class uk.ac.ic.doc.automed.wrappers.AutoMedType
BOOLEAN, FLOAT, INTEGER, NULL_STR, STRING, TIME, TUPLE
 
Constructor Summary
AutoMedInteger()
          Create a new AutoMedInteger that is a null value
AutoMedInteger(java.math.BigInteger value)
          Create a new AutoMedInteger from a BigInteger.
AutoMedInteger(int value, int bits)
          Create a new AutoMedInteger from a 32 bit integer value.
AutoMedInteger(long value, int bits)
          Create a new AutoMedInteger
AutoMedInteger(java.lang.String text)
          Create a new AutoMedInteger from text, creating a null value if the text cannon be parsed.
 
Method Summary
 AutoMedInteger add(AutoMedInteger v)
          Return the sum of two AutoMedIntegers.
 AutoMedInteger divide(AutoMedInteger v)
          Return the division of two AutoMedIntegers.
 double doubleValue()
          Return the value of this AutoMedInteger as a double
 boolean equals(AutoMedType v)
          Test two AutoMedTypes for equality, performing conversions as appropriate.
 int getType()
          Return the Type (INTEGER, TUPLE, ...) of this AutoMedType
 int intValue()
          Return the value of this AutoMedInteger as an int
 long longValue()
          Return the value of this AutoMedInteger as an long
 AutoMedInteger multiply(AutoMedInteger v)
          Return the multiplication of two AutoMedIntegers.
 AutoMedInteger subtract(AutoMedInteger v)
          Return the difference of two AutoMedIntegers.
 java.lang.String toString()
          Return a string representation of this AutoMedInteger.
 
Methods inherited from class uk.ac.ic.doc.automed.wrappers.AutoMedType
isLiteral, isNull, isNumeric
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AutoMedInteger

public AutoMedInteger(java.lang.String text)
Create a new AutoMedInteger from text, creating a null value if the text cannon be parsed.


AutoMedInteger

public AutoMedInteger(int value,
                      int bits)
Create a new AutoMedInteger from a 32 bit integer value.


AutoMedInteger

public AutoMedInteger(long value,
                      int bits)
Create a new AutoMedInteger


AutoMedInteger

public AutoMedInteger(java.math.BigInteger value)
Create a new AutoMedInteger from a BigInteger.


AutoMedInteger

public AutoMedInteger()
Create a new AutoMedInteger that is a null value

Method Detail

intValue

public int intValue()
Return the value of this AutoMedInteger as an int


longValue

public long longValue()
Return the value of this AutoMedInteger as an long


doubleValue

public double doubleValue()
Return the value of this AutoMedInteger as a double

Specified by:
doubleValue in class AutoMedType

add

public AutoMedInteger add(AutoMedInteger v)
Return the sum of two AutoMedIntegers.


subtract

public AutoMedInteger subtract(AutoMedInteger v)
Return the difference of two AutoMedIntegers.


divide

public AutoMedInteger divide(AutoMedInteger v)
Return the division of two AutoMedIntegers.


multiply

public AutoMedInteger multiply(AutoMedInteger v)
Return the multiplication of two AutoMedIntegers.


toString

public java.lang.String toString()
Return a string representation of this AutoMedInteger.

Specified by:
toString in class AutoMedType

equals

public boolean equals(AutoMedType v)
Description copied from class: AutoMedType
Test two AutoMedTypes for equality, performing conversions as appropriate. Note that, unlike SQL but like Java, two null types will return true when compared.

Specified by:
equals in class AutoMedType

getType

public final int getType()
Description copied from class: AutoMedType
Return the Type (INTEGER, TUPLE, ...) of this AutoMedType

Specified by:
getType in class AutoMedType