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

java.lang.Object
  |
  +--uk.ac.ic.doc.automed.wrappers.AutoMedType
        |
        +--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, STRING, TIME, TUPLE
 
Constructor Summary
AutoMedInteger(int value, int bits)
          Create a new AutoMedInteger from a 32 bit integer value.
AutoMedInteger(long value, int bits)
          Create a new AutoMedInteger
 
Method Summary
 AutoMedInteger add(AutoMedInteger v)
          Return the sum of two AutoMedIntegers.
 AutoMedInteger divide(AutoMedInteger v)
          Return the division of two AutoMedIntegers.
 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

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

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


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.

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