org.qtitools.qti.value
Class PointValue

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

public class PointValue
extends SingleValue

Implementation of BaseType point value.

A space separated list of two integer values. The first value is the horizontal component, the second the vertical.

Example values: '10 50', '32 16'. Character ' is not part of point value.

This class is not mutable and cannot contain NULL value.

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

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

Constructor Summary
PointValue(int horizontalValue, int verticalValue)
          Constructs PointValue from given horizontal and vertical values.
PointValue(java.lang.String value)
          Constructs PointValue from given String representation.
 
Method Summary
 boolean equals(java.lang.Object object)
           
 BaseType getBaseType()
          Returns baseType of this value.
 int hashCode()
           
 int horizontalValue()
          Returns horizontal value of this point.
 java.lang.String toString()
           
 int verticalValue()
          Returns vertical value of this point.
 
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

PointValue

public PointValue(int horizontalValue,
                  int verticalValue)
Constructs PointValue from given horizontal and vertical values.

Parameters:
horizontalValue - horizontal value
verticalValue - vertical value

PointValue

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

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

horizontalValue

public int horizontalValue()
Returns horizontal value of this point.

Returns:
horizontal value of this point

verticalValue

public int verticalValue()
Returns vertical value of this point.

Returns:
vertical value of this point

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.