org.qtitools.qti.value
Class DirectedPairValue

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

public class DirectedPairValue
extends AbstractPairValue

Implementation of BaseType directedPair value.

A space separated list of two identifier values with the source identifier first, followed by the destination identifier.

Example values: 'A B', 'choice5 choice1', 'apple fruit', 'carrot vegetable'. Character ' is not part of directedPair value.

This class is not mutable and cannot contain NULL value.

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

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

Field Summary
 
Fields inherited from class org.qtitools.qti.value.AbstractPairValue
destValue, sourceValue
 
Constructor Summary
DirectedPairValue(java.lang.String value)
          Constructs DirectedPairValue from given String representation.
DirectedPairValue(java.lang.String sourceValue, java.lang.String destValue)
          Constructs DirectedPairValue from given pair of identifiers.
 
Method Summary
 boolean equals(java.lang.Object object)
           
 BaseType getBaseType()
          Returns baseType of this value.
 boolean isDirected()
          Returns true if this pair is directed false otherwise.
 
Methods inherited from class org.qtitools.qti.value.AbstractPairValue
destValue, hashCode, sourceValue, 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

DirectedPairValue

public DirectedPairValue(java.lang.String sourceValue,
                         java.lang.String destValue)
Constructs DirectedPairValue from given pair of identifiers.

Parameters:
sourceValue - source (first) identifier
destValue - destination (second) identifier

DirectedPairValue

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

Parameters:
value - String representation of DirectedPairValue
Throws:
QTIParseException - if String representation of DirectedPairValue 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

isDirected

public boolean isDirected()
Description copied from class: AbstractPairValue
Returns true if this pair is directed false otherwise.

Specified by:
isDirected in class AbstractPairValue
Returns:
true if this pair is directed false otherwise

equals

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


Copyright © 2009. All Rights Reserved.