org.qtitools.qti.node.test.flow
Class JumpNode

java.lang.Object
  extended by org.qtitools.qti.node.test.flow.Node
      extended by org.qtitools.qti.node.test.flow.MiddleNode
          extended by org.qtitools.qti.node.test.flow.JumpNode
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
BranchRuleNode, PreConditionNode

public abstract class JumpNode
extends MiddleNode

Jump node is middle node with precondition or branch rule assessment object.

Author:
Jiri Kajaba
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.qtitools.qti.node.test.flow.Node
logger
 
Constructor Summary
protected JumpNode(Node prev, AbstractJump object)
          Constructs node.
 
Method Summary
 Node evaluate()
          Evaluates target of this jump node (which node will be next in item flow after this jump).
protected abstract  Node evaluate(boolean condition)
          Evaluates target of this jump node (which node will be next in item flow after this jump).
 AbstractJump getJump()
          Gets assessment object (precondition or branch rule) of this node.
 Node getTarget()
          Gets alternative (not default) target of this jump node.
 boolean isJump()
          Returns true if this node is jump node; false otherwise.
 void setTarget(Node target)
          Sets new alternative (not default) target of this jump node.
 java.lang.String toString()
           
 
Methods inherited from class org.qtitools.qti.node.test.flow.MiddleNode
isMiddle
 
Methods inherited from class org.qtitools.qti.node.test.flow.Node
getIndex, getNext, getObject, getPrev, isBorder, isBranchRule, isEnd, isItemRef, isPreCondition, isStart
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JumpNode

protected JumpNode(Node prev,
                   AbstractJump object)
Constructs node.

Parameters:
prev - previous node in linked list
object - assessment object (precondition or branch rule)
Method Detail

isJump

public boolean isJump()
Description copied from class: Node
Returns true if this node is jump node; false otherwise.

Jump node is middle node with precondition or branch rule object.

Overrides:
isJump in class Node
Returns:
true if this node is jump node; false otherwise

getJump

public AbstractJump getJump()
Gets assessment object (precondition or branch rule) of this node.

Returns:
assessment object (precondition or branch rule) of this node

getTarget

public Node getTarget()
Gets alternative (not default) target of this jump node.

Default target can be obtained with getNext method.

Returns:
alternative (not default) target of this jump node
See Also:
setTarget(org.qtitools.qti.node.test.flow.Node)

setTarget

public void setTarget(Node target)
Sets new alternative (not default) target of this jump node.

Default target can be obtained with getNext method.

Parameters:
target - new alternative (not default) target of this jump node
See Also:
getTarget()

evaluate

public Node evaluate()
Evaluates target of this jump node (which node will be next in item flow after this jump).

Returns:
next node in item flow after this jump

evaluate

protected abstract Node evaluate(boolean condition)
Evaluates target of this jump node (which node will be next in item flow after this jump).

Parameters:
condition - result of evaluation of jump's expression
Returns:
next node in item flow after this jump

toString

public java.lang.String toString()
Overrides:
toString in class Node


Copyright © 2009. All Rights Reserved.