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

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

public class AutoMedBoolean
extends AutoMedType

Provides generic representation boolean values.

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
AutoMedBoolean()
          Create a new AutoMedBoolean that is null in value.
AutoMedBoolean(boolean value)
          Create a new AutoMedBoolean
AutoMedBoolean(java.lang.String value)
          Create a new AutoMedBoolean from a String value.
 
Method Summary
 boolean booleanValue()
          Return a boolean representation of this AutoMedBoolean.
 double doubleValue()
          Return a double representation of this AutoMedBoolean, where true is 1.0 and false 0.0
 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 AutoMedBoolean.
 
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

AutoMedBoolean

public AutoMedBoolean(boolean value)
Create a new AutoMedBoolean


AutoMedBoolean

public AutoMedBoolean(java.lang.String value)
Create a new AutoMedBoolean from a String value.

Parameters:
value - the string used to set the boolean value, where any string beginning with `t' or `T' will result in true as the boolean value, and any other string will result in false

AutoMedBoolean

public AutoMedBoolean()
Create a new AutoMedBoolean that is null in value.

Method Detail

booleanValue

public boolean booleanValue()
Return a boolean representation of this AutoMedBoolean.


doubleValue

public double doubleValue()
Return a double representation of this AutoMedBoolean, where true is 1.0 and false 0.0

Specified by:
doubleValue in class AutoMedType

toString

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

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