org.qtitools.qti.node.outcome.declaration
Class LookupTable

java.lang.Object
  extended by org.qtitools.qti.node.AbstractNode
      extended by org.qtitools.qti.node.AbstractObject
          extended by org.qtitools.qti.node.outcome.declaration.LookupTable
All Implemented Interfaces:
java.io.Serializable, XmlNode, XmlObject, Validatable
Direct Known Subclasses:
InterpolationTable, MatchTable

public abstract class LookupTable
extends AbstractObject

An abstract class associated with an outcomeDeclaration used to create A lookup table from A numeric source value to A single outcome value in the declared value set. A lookup table works in the reverse sense to the similar mapping as it defines how A source numeric value is transformed into the outcome value, whereas A (response) mapping defines how the response value is mapped onto A target numeric value.

The transformation takes place using the lookupOutcomeValue rule within responseProcessing or outcomeProcessing.

Author:
Jiri Kajaba
See Also:
Serialized Form

Field Summary
static SingleValue ATTR_DEFAULT_VALUE_DEFAULT_VALUE
          Default value of defaultValue attribute.
static java.lang.String ATTR_DEFAULT_VALUE_NAME
          Name of defaultValue attribute in xml schema.
static java.lang.String DISPLAY_NAME
          Display name of this class.
 
Fields inherited from interface org.qtitools.qti.node.XmlNode
INDENT, NEW_LINE, SIMPLE_NAME_INNER_SEPARATOR, SIMPLE_NAMES_SEPARATOR
 
Constructor Summary
LookupTable(OutcomeDeclaration parent)
          Creates object.
 
Method Summary
 SingleValue getDefaultValue()
          Gets value of defaultValue attribute.
abstract  java.util.List<? extends LookupTableEntry> getLookupEntries()
          Gets lookupTableEntry children.
 OutcomeDeclaration getParent()
          Gets parent of this node or null (if node is root; for example AssessmentTest).
 SingleValue getTargetValue(NumberValue sourceValue)
          Gets target value for given source value.
 BaseType getTargetValueBaseType()
          Gets required baseType of target value.
 void setDefaultValue(SingleValue defaultValue)
          Sets new value of defaultValue attribute.
protected  ValidationResult validateAttributes()
          Validates attributes of this node.
protected  ValidationResult validateChildren()
          Validates children (body) of this node.
 
Methods inherited from class org.qtitools.qti.node.AbstractObject
getParentItem, getParentResult, getParentTest, setParent
 
Methods inherited from class org.qtitools.qti.node.AbstractNode
attrToXmlString, bodyToXmlString, getAttributes, getClassTag, getFullName, getIndent, getNode, getNode, getNode, getNodeGroups, getParentRoot, getSimpleName, getSourceFile, getSourceNode, getSourceString, getSourceUrl, hasChildNodes, load, load, load, load, loadAttributes, readChild, readChildren, setParent, setSourceFile, setSourceNode, setSourceString, setSourceUrl, toXmlString, toXmlString, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.qtitools.qti.node.XmlNode
getAttributes, getClassTag, getFullName, getNodeGroups, getParentRoot, getSimpleName, getSourceFile, getSourceNode, getSourceString, getSourceUrl, hasChildNodes, load, load, load, load, setSourceFile, setSourceNode, setSourceString, setSourceUrl, toXmlString, toXmlString
 
Methods inherited from interface org.qtitools.qti.validation.Validatable
validate
 

Field Detail

DISPLAY_NAME

public static final java.lang.String DISPLAY_NAME
Display name of this class.

See Also:
Constant Field Values

ATTR_DEFAULT_VALUE_NAME

public static final java.lang.String ATTR_DEFAULT_VALUE_NAME
Name of defaultValue attribute in xml schema.

See Also:
Constant Field Values

ATTR_DEFAULT_VALUE_DEFAULT_VALUE

public static final SingleValue ATTR_DEFAULT_VALUE_DEFAULT_VALUE
Default value of defaultValue attribute.

Constructor Detail

LookupTable

public LookupTable(OutcomeDeclaration parent)
Creates object.

Parameters:
parent - parent of this object
Method Detail

getParent

public OutcomeDeclaration getParent()
Description copied from interface: XmlNode
Gets parent of this node or null (if node is root; for example AssessmentTest).

While testing some nodes (for example expressions) don't have properly set parent, but it is usable only for testing. (Some nodes cannot exists without parent even for testing).

Specified by:
getParent in interface XmlNode
Specified by:
getParent in interface XmlObject
Overrides:
getParent in class AbstractObject
Returns:
parent of this node or null (if node is root; for example AssessmentTest)

getTargetValueBaseType

public BaseType getTargetValueBaseType()
Gets required baseType of target value.

Returns:
required baseType of target value

getDefaultValue

public SingleValue getDefaultValue()
Gets value of defaultValue attribute.

Returns:
value of defaultValue attribute
See Also:
setDefaultValue(org.qtitools.qti.value.SingleValue)

setDefaultValue

public void setDefaultValue(SingleValue defaultValue)
Sets new value of defaultValue attribute.

Parameters:
defaultValue - new value of defaultValue attribute
See Also:
getDefaultValue()

getLookupEntries

public abstract java.util.List<? extends LookupTableEntry> getLookupEntries()
Gets lookupTableEntry children.

Returns:
lookupTableEntry children

getTargetValue

public SingleValue getTargetValue(NumberValue sourceValue)
Gets target value for given source value.

Parameters:
sourceValue - given source value
Returns:
target value for given source value

validateAttributes

protected ValidationResult validateAttributes()
Description copied from class: AbstractNode
Validates attributes of this node.

Overrides:
validateAttributes in class AbstractNode
Returns:
result of validation

validateChildren

protected ValidationResult validateChildren()
Description copied from class: AbstractNode
Validates children (body) of this node.

Overrides:
validateChildren in class AbstractNode
Returns:
result of validation


Copyright © 2009. All Rights Reserved.