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

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

public abstract class Node
extends java.lang.Object
implements java.io.Serializable

Basic abstract node of linked list.

Contains index (position in linked list; first position = 0), references to previous and next node in linked list and assessment object (test, test part, section, item reference, precondition or branch rule).

Author:
Jiri Kajaba
See Also:
Serialized Form

Field Summary
protected static org.slf4j.Logger logger
          Logger.
 
Constructor Summary
protected Node(Node prev, XmlObject object)
          Constructs node.
 
Method Summary
 int getIndex()
          Gets index (position in linked list) of this node.
 Node getNext()
          Gets next node in linked list (can be null).
 XmlObject getObject()
          Gets assessment object (test, test part, section, item reference, precondition or branch rule) of this node.
 Node getPrev()
          Gets previous node in linked list (can be null).
 boolean isBorder()
          Returns true if this node is border node; false otherwise.
 boolean isBranchRule()
          Returns true if this node is branch rule node; false otherwise.
 boolean isEnd()
          Returns true if this node is end node; false otherwise.
 boolean isItemRef()
          Returns true if this node is item reference node; false otherwise.
 boolean isJump()
          Returns true if this node is jump node; false otherwise.
 boolean isMiddle()
          Returns true if this node is middle node; false otherwise.
 boolean isPreCondition()
          Returns true if this node is precondition node; false otherwise.
 boolean isStart()
          Returns true if this node is start node; false otherwise.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

protected static org.slf4j.Logger logger
Logger.

Constructor Detail

Node

protected Node(Node prev,
               XmlObject object)
Constructs node.

Parameters:
prev - previous node in linked list
object - assessment object (test, test part, section, item reference, precondition or branch rule)
Method Detail

isBorder

public boolean isBorder()
Returns true if this node is border node; false otherwise.

Border node is node on border. It is either start or end node, and it is not middle node.

Returns:
true if this node is border node; false otherwise

isStart

public boolean isStart()
Returns true if this node is start node; false otherwise.

Start node is node on beginning of test, test part, section or item reference.

Returns:
true if this node is start node; false otherwise

isEnd

public boolean isEnd()
Returns true if this node is end node; false otherwise.

End node is node on end of test, test part, section or item reference.

Returns:
true is this node is end node; false otherwise

isMiddle

public boolean isMiddle()
Returns true if this node is middle node; false otherwise.

Middle node is node which is between start and end node. There can be more middle nodes between one start and end node.

Returns:
true is this node is middle node; false otherwise

isItemRef

public boolean isItemRef()
Returns true if this node is item reference node; false otherwise.

Item reference node is middle node with item reference object.

Returns:
true if this node is item reference node; false otherwise

isJump

public boolean isJump()
Returns true if this node is jump node; false otherwise.

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

Returns:
true if this node is jump node; false otherwise

isPreCondition

public boolean isPreCondition()
Returns true if this node is precondition node; false otherwise.

Precondition node is jump node with precondition object.

Returns:
true is this node is precondition node; false otherwise

isBranchRule

public boolean isBranchRule()
Returns true if this node is branch rule node; false otherwise.

Branch rule node is jump node with branch rule object.

Returns:
true is this node is branch rule node; false otherwise

getIndex

public int getIndex()
Gets index (position in linked list) of this node.

Index of first node in linked list is 0.

Returns:
index (position in linked list) of this node

getPrev

public Node getPrev()
Gets previous node in linked list (can be null).

Returns:
previous node in linked list (can be null)

getNext

public Node getNext()
Gets next node in linked list (can be null).

Returns:
next node in linked list (can be null)

getObject

public XmlObject getObject()
Gets assessment object (test, test part, section, item reference, precondition or branch rule) of this node.

Returns:
assessment object (test, test part, section, item reference, precondition or branch rule) of this node

toString

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


Copyright © 2009. All Rights Reserved.