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

java.lang.Object
  |
  +--uk.ac.ic.doc.automed.wrappers.AutoMedType
        |
        +--uk.ac.ic.doc.automed.wrappers.AutoMedFloat

public class AutoMedFloat
extends AutoMedType

Provides generic representation of floating values with abritrary 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
AutoMedFloat(java.math.BigDecimal value)
          Create a new AutoMedFloat from a BigDecimal.
AutoMedFloat(double value, int bits)
          Create a new AutoMedFloat from a 64 bit floating point value.
AutoMedFloat(float value, int bits)
          Create a new AutoMedFloat from a 32 bit floating point value.
 
Method Summary
 AutoMedFloat add(AutoMedFloat v)
          Return the sum of two AutoMedFloats.
 AutoMedFloat divide(AutoMedFloat v)
          Return the division of two AutoMedFloats.
 double doubleValue()
          Return the value of this AutoMedFloat as an double
 boolean equals(AutoMedType v)
          Test two AutoMedTypes for equality, performing conversions as appropriate.
 float floatValue()
          Return the value of this AutoMedFloat as an float
 int getType()
          Return the Type (INTEGER, TUPLE, ...) of this AutoMedType
 AutoMedFloat multiply(AutoMedFloat v)
          Return the multiplication of two AutoMedFloats.
 AutoMedFloat subtract(AutoMedFloat v)
          Return the difference of two AutoMedFloats.
 java.lang.String toString()
          Return a string representation of this AutoMedFloat.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AutoMedFloat

public AutoMedFloat(float value,
                    int bits)
Create a new AutoMedFloat from a 32 bit floating point value.


AutoMedFloat

public AutoMedFloat(double value,
                    int bits)
Create a new AutoMedFloat from a 64 bit floating point value.


AutoMedFloat

public AutoMedFloat(java.math.BigDecimal value)
Create a new AutoMedFloat from a BigDecimal.

Method Detail

floatValue

public float floatValue()
Return the value of this AutoMedFloat as an float


doubleValue

public double doubleValue()
Return the value of this AutoMedFloat as an double


add

public AutoMedFloat add(AutoMedFloat v)
Return the sum of two AutoMedFloats.


subtract

public AutoMedFloat subtract(AutoMedFloat v)
Return the difference of two AutoMedFloats.


divide

public AutoMedFloat divide(AutoMedFloat v)
Return the division of two AutoMedFloats.


multiply

public AutoMedFloat multiply(AutoMedFloat v)
Return the multiplication of two AutoMedFloats.


toString

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

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