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

java.lang.Object
  extended by uk.ac.ic.doc.automed.wrappers.AutoMedType
Direct Known Subclasses:
AutoMedBoolean, AutoMedFloat, AutoMedInteger, AutoMedString, AutoMedTime, AutoMedTuple

public abstract class AutoMedType
extends java.lang.Object

Provides a base for the representation of basic types supported by AutoMed.

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

Field Summary
static int BOOLEAN
          Type to represent a boolean true/false value.
static int FLOAT
          Type to represent a floating point atomic type
static int INTEGER
          Type to represent a twos-complement integer atomic type
static java.lang.String NULL_STR
          String to use to represent null values
static int STRING
          Type to represent an arbitrary length string in the unicode character set.
static int TIME
          Type to represent a time (on a particular day)
static int TUPLE
          Type to represent a tuple of atomic types
 
Constructor Summary
AutoMedType()
           
 
Method Summary
abstract  double doubleValue()
          Return the double representation of this AutoMedType.
abstract  boolean equals(AutoMedType v)
          Test two AutoMedTypes for equality, performing conversions as appropriate.
abstract  int getType()
          Return the Type (INTEGER, TUPLE, ...) of this AutoMedType
 boolean isLiteral()
          Check if this is a literal type
 boolean isNull()
          Is this type a null value?
 boolean isNumeric()
          Check if this is a numeric type
abstract  java.lang.String toString()
          Return a string representation of this AutoMedType.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NULL_STR

public static final java.lang.String NULL_STR
String to use to represent null values

See Also:
Constant Field Values

INTEGER

public static final int INTEGER
Type to represent a twos-complement integer atomic type

See Also:
Constant Field Values

TUPLE

public static final int TUPLE
Type to represent a tuple of atomic types

See Also:
Constant Field Values

FLOAT

public static final int FLOAT
Type to represent a floating point atomic type

See Also:
Constant Field Values

TIME

public static final int TIME
Type to represent a time (on a particular day)

See Also:
Constant Field Values

STRING

public static final int STRING
Type to represent an arbitrary length string in the unicode character set.

See Also:
Constant Field Values

BOOLEAN

public static final int BOOLEAN
Type to represent a boolean true/false value.

See Also:
Constant Field Values
Constructor Detail

AutoMedType

public AutoMedType()
Method Detail

toString

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

Overrides:
toString in class java.lang.Object

doubleValue

public abstract double doubleValue()
Return the double representation of this AutoMedType. Booleans will be converted to 1.0 if true, 0 otherwise. Strings are parsed as doubles, and if that parsing fails then 0 is returned. Tuples return the arity of the tuple.


getType

public abstract int getType()
Return the Type (INTEGER, TUPLE, ...) of this AutoMedType


equals

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


isNull

public boolean isNull()
Is this type a null value?


isNumeric

public boolean isNumeric()
Check if this is a numeric type


isLiteral

public boolean isLiteral()
Check if this is a literal type