|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectlij.model.TreeNode
public class TreeNode
This class is used to construct clause trees. Each node in the tree contains a Token (the "contents" of the node), as well as two children nodes (left and right).
Field Summary | |
---|---|
private Result.State |
evaluationResult
|
private TreeNode |
left
|
private TreeNode |
right
|
private TreeNodeToken |
token
|
Constructor Summary | |
---|---|
TreeNode(TreeNodeToken _token)
Constructor. |
Method Summary | |
---|---|
java.lang.Object |
clone()
|
private void |
evaluate(Interpreter interpreter,
AgentInstance agentInstance)
Performs the evaluation of this node (and its children, recursively) |
Result.State |
getEvaluationResult(Interpreter interpreter,
AgentInstance agentInstance)
Returns the evaluation result of this node. |
TreeNode |
getLeft()
Accessor. |
TreeNode |
getRight()
Accessor. |
TreeNodeToken |
getToken()
Accessor. |
void |
resetEvaluationResult()
Resets the state of the evaluation result of this node and all of its children to MAYBE. |
void |
setLeft(TreeNode _left)
Accessor. |
void |
setRight(TreeNode _right)
Accessor. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private TreeNodeToken token
private TreeNode left
private TreeNode right
private Result.State evaluationResult
Constructor Detail |
---|
public TreeNode(TreeNodeToken _token)
_token
- The token object contained in this node.Method Detail |
---|
public TreeNodeToken getToken()
public void setLeft(TreeNode _left)
_left
- The node at the left branch of the tree.public TreeNode getLeft()
public void setRight(TreeNode _right)
_right
- The node at the right branch of the tree.public TreeNode getRight()
public void resetEvaluationResult()
public Result.State getEvaluationResult(Interpreter interpreter, AgentInstance agentInstance) throws InterpreterException
interpreter
- A reference to the current Interpreter instance.agentInstance
- A reference to the current agent instance.
InterpreterException
private void evaluate(Interpreter interpreter, AgentInstance agentInstance) throws InterpreterException
interpreter
- A reference to the current Interpreter instance.agentInstance
- A reference to the current agent instance.
InterpreterException
public java.lang.Object clone()
clone
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |