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

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

public class AutoMedString
extends AutoMedType

Provides generic representation of string values of abritrary size.

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
AutoMedString(java.lang.String value)
          Create a new AutoMedString
 
Method Summary
 double doubleValue()
          Return the double representation of this AutoMedType.
 boolean equals(AutoMedType v)
          Test two AutoMedTypes for equality, performing conversions as appropriate.
 int getType()
          Return the Type (INTEGER, TUPLE, ...) of this AutoMedType
 java.lang.String toString()
          Return a string representation of this AutoMedString.
 
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

AutoMedString

public AutoMedString(java.lang.String value)
Create a new AutoMedString

Method Detail

toString

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

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

doubleValue

public double doubleValue()
Description copied from class: AutoMedType
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.

Specified by:
doubleValue in class AutoMedType