org.qtitools.qti.value
Class AbstractPairValue

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

public abstract class AbstractPairValue
extends SingleValue

Superclass for pair and directedPair values.

Classes PairValue and DirectedPairValue have different only isDirected and equals methods.

This class is not mutable and cannot contain NULL value.

Cardinality of this class is always single.

Author:
Jiri Kajaba
See Also:
Cardinality, Serialized Form

Field Summary
protected  java.lang.String destValue
          Destination value.
protected  java.lang.String sourceValue
          Source value.
 
Constructor Summary
AbstractPairValue(java.lang.String value)
          Constructs AbstractPairValue from given String representation.
AbstractPairValue(java.lang.String sourceValue, java.lang.String destValue)
          Constructs AbstractPairValue from given pair of identifiers.
 
Method Summary
 java.lang.String destValue()
          Returns destination (second) identifier.
 int hashCode()
           
abstract  boolean isDirected()
          Returns true if this pair is directed false otherwise.
 java.lang.String sourceValue()
          Returns source (first) identifier.
 java.lang.String toString()
           
 
Methods inherited from class org.qtitools.qti.value.SingleValue
getCardinality, isNull
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.qtitools.qti.value.Value
getBaseType
 

Field Detail

sourceValue

protected java.lang.String sourceValue
Source value.


destValue

protected java.lang.String destValue
Destination value.

Constructor Detail

AbstractPairValue

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

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

AbstractPairValue

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

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

isDirected

public abstract boolean isDirected()
Returns true if this pair is directed false otherwise.

Returns:
true if this pair is directed false otherwise

sourceValue

public java.lang.String sourceValue()
Returns source (first) identifier.

Returns:
source (first) identifier

destValue

public java.lang.String destValue()
Returns destination (second) identifier.

Returns:
destination (second) identifier

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.