Class AbstractNode
- java.lang.Object
-
- com.aquima.interactions.dtree.impl.AbstractNode
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
AssetAction
,AttributeAction
,ContainerAction
,DecisionTreeCondition
,SubTreeAction
public abstract class AbstractNode extends Object implements Serializable
Base class for decision tree nodes.- Since:
- 5.0
- Author:
- F. van der Meer
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractNode(IDecisionTree tree, AbstractNode parent, InitializationLookup lookup, IDecisionTreeNodeDS nodeDS)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract AbstractNode[]
getChildren()
This method returns an array containing the child nodes.protected ICondition
getCondition()
The condition expression in which the 'question-attribute' is used.protected AttributeReference
getQuestionAttribute()
Returns the question attribute when a question is in place for this condition.protected IDecisionTree
getTree()
boolean
isActionNode()
This method returns a boolean indicating if this node represents an action node.protected boolean
isAssetAction()
protected boolean
isAttributeAction()
boolean
isCondition()
This method returns a boolean indicating if this node represents a condition node.protected boolean
isContainerAction()
protected boolean
isSubtreeAction()
protected AssetAction
toAssetAction()
protected AttributeAction
toAttributeAction()
protected ContainerAction
toContainerAction()
String
toString()
protected SubTreeAction
toSubtreeAction()
-
-
-
Constructor Detail
-
AbstractNode
protected AbstractNode(IDecisionTree tree, AbstractNode parent, InitializationLookup lookup, IDecisionTreeNodeDS nodeDS) throws InitializationException
- Throws:
InitializationException
-
-
Method Detail
-
getChildren
public abstract AbstractNode[] getChildren()
This method returns an array containing the child nodes.
Note: This method is public to allow test-case access, but should not be used outside the tree engine.
- Returns:
- an array containing the child nodes.
-
getTree
protected IDecisionTree getTree()
-
getQuestionAttribute
protected AttributeReference getQuestionAttribute()
Returns the question attribute when a question is in place for this condition.- Returns:
- AttributeReference, can be null
-
getCondition
protected ICondition getCondition()
The condition expression in which the 'question-attribute' is used.- Returns:
- the condition which is never null
-
isActionNode
public boolean isActionNode()
This method returns a boolean indicating if this node represents an action node.- Returns:
- a boolean indicating if this node represents an action node.
-
isCondition
public boolean isCondition()
This method returns a boolean indicating if this node represents a condition node.- Returns:
- a boolean indicating if this node represents a condition node.
-
isAssetAction
protected boolean isAssetAction()
-
isAttributeAction
protected boolean isAttributeAction()
-
isContainerAction
protected boolean isContainerAction()
-
isSubtreeAction
protected boolean isSubtreeAction()
-
toAssetAction
protected AssetAction toAssetAction() throws DecisionTreeException
- Throws:
DecisionTreeException
-
toAttributeAction
protected AttributeAction toAttributeAction() throws DecisionTreeException
- Throws:
DecisionTreeException
-
toContainerAction
protected ContainerAction toContainerAction() throws DecisionTreeException
- Throws:
DecisionTreeException
-
toSubtreeAction
protected SubTreeAction toSubtreeAction() throws DecisionTreeException
- Throws:
DecisionTreeException
-
-