org.qtitools.qti.value
Class DurationValue

java.lang.Object
  extended by org.qtitools.qti.value.SingleValue
      extended by org.qtitools.qti.value.DurationValue
All Implemented Interfaces:
java.io.Serializable, Value

public class DurationValue
extends SingleValue

Implementation of BaseType duration value.

The number of seconds, expressed as A floating point number and bound according to the rules for the simple type float.

This class is not mutable and cannot contain NULL value.

Cardinality of this class is always single and BaseType is always duration.

Author:
Jiri Kajaba
See Also:
Cardinality, BaseType, FloatValue, Serialized Form

Constructor Summary
DurationValue(double value)
          Constructs DurationValue from given double.
DurationValue(java.lang.String value)
          Constructs DurationValue from given String representation.
 
Method Summary
 double doubleValue()
          Returns the value of this DurationValue as A double.
 boolean equals(java.lang.Object object)
           
 BaseType getBaseType()
          Returns baseType of this value.
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class org.qtitools.qti.value.SingleValue
getCardinality, isNull
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DurationValue

public DurationValue(double value)
              throws java.lang.IllegalArgumentException
Constructs DurationValue from given double.

Parameters:
value - double
Throws:
java.lang.IllegalArgumentException - if given double is negative

DurationValue

public DurationValue(java.lang.String value)
              throws QTIParseException
Constructs DurationValue from given String representation.

Parameters:
value - String representation of DurationValue
Throws:
QTIParseException - if String representation of DurationValue is not valid
Method Detail

getBaseType

public BaseType getBaseType()
Description copied from interface: Value
Returns baseType of this value.

If value is NULL or record cardinality returns null.

Returns:
baseType of this value

doubleValue

public double doubleValue()
Returns the value of this DurationValue as A double.

Returns:
the value of this DurationValue as A double

equals

public boolean equals(java.lang.Object object)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2009. All Rights Reserved.