org.qtitools.qti.group.expression
Class ExpressionGroup

java.lang.Object
  extended by org.qtitools.qti.group.AbstractNodeGroup
      extended by org.qtitools.qti.group.expression.ExpressionGroup
All Implemented Interfaces:
java.io.Serializable, NodeGroup, Validatable

public class ExpressionGroup
extends AbstractNodeGroup

Group of expression children.

Author:
Jonathon Hare
See Also:
Serialized Form

Constructor Summary
ExpressionGroup(ExpressionParent parent, java.lang.Integer minimum, java.lang.Integer maximum)
          Constructs group.
 
Method Summary
 Expression create(java.lang.String classTag)
          Creates child with given QTI class name.
 java.util.List<java.lang.String> getCurrentSupportedClasses(int index)
          Returns list of all currently possible QTI class names (all currently possible children in this group).
 Expression getExpression()
          Gets child.
 java.util.List<Expression> getExpressions()
          Gets list of all children.
 ExpressionParent getParent()
          Gets parent node of group.
 boolean isGeneral()
          Returns true if group can contain children with different QTI class name; false otherwise.
 void setExpression(Expression expression)
          Sets new child.
 
Methods inherited from class org.qtitools.qti.group.AbstractNodeGroup
getAllSupportedClasses, getChild, getChildren, getFullName, getMaximum, getMinimum, getName, load, setChild, toXmlString, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExpressionGroup

public ExpressionGroup(ExpressionParent parent,
                       java.lang.Integer minimum,
                       java.lang.Integer maximum)
Constructs group.

Parameters:
parent - parent of created group
minimum - minimum required children of created group
maximum - maximum allowed children of created group
Method Detail

getParent

public ExpressionParent getParent()
Description copied from interface: NodeGroup
Gets parent node of group.

Specified by:
getParent in interface NodeGroup
Overrides:
getParent in class AbstractNodeGroup
Returns:
parent node of group

isGeneral

public boolean isGeneral()
Description copied from interface: NodeGroup
Returns true if group can contain children with different QTI class name; false otherwise.

Specified by:
isGeneral in interface NodeGroup
Overrides:
isGeneral in class AbstractNodeGroup
Returns:
true if group can contain children with different QTI class name; false otherwise

getCurrentSupportedClasses

public java.util.List<java.lang.String> getCurrentSupportedClasses(int index)
Description copied from interface: NodeGroup
Returns list of all currently possible QTI class names (all currently possible children in this group).

This list can change in time (it contains every possible QTI class name for current time (conditions)).

For example: expression delete can contain on first position only expressions which produce single value and on second position only expressions which produce multiple or ordered cardinality.

Specified by:
getCurrentSupportedClasses in interface NodeGroup
Overrides:
getCurrentSupportedClasses in class AbstractNodeGroup
Parameters:
index - index of children in group
Returns:
list of all currently possible QTI class names (all currently possible children in this group)

getExpression

public Expression getExpression()
Gets child.

Returns:
child
See Also:
setExpression(org.qtitools.qti.node.expression.Expression)

setExpression

public void setExpression(Expression expression)
Sets new child.

Parameters:
expression - new child
See Also:
getExpression()

getExpressions

public java.util.List<Expression> getExpressions()
Gets list of all children.

Returns:
list of all children

create

public Expression create(java.lang.String classTag)
Creates child with given QTI class name.

Parameter classTag is needed only if group can contain children with different QTI class names.

Parameters:
classTag - QTI class name (this parameter is needed)
Returns:
created child


Copyright © 2009. All Rights Reserved.