org.encog.ml.prg
Class ProgramNode

java.lang.Object
  extended by org.encog.ml.tree.basic.BasicTreeNode
      extended by org.encog.ml.prg.ProgramNode
All Implemented Interfaces:
Serializable, TreeNode

public class ProgramNode
extends BasicTreeNode
implements Serializable

Represents a program node in an EPL program.

See Also:
Serialized Form

Constructor Summary
ProgramNode(EncogProgram theOwner, ProgramExtensionTemplate theTemplate, ProgramNode[] theArgs)
          Construct the program node.
 
Method Summary
 boolean allConstChildren()
           
 boolean allConstDescendants()
           
 ExpressionValue evaluate()
           
 ProgramNode getChildNode(int index)
          Get the specified child node.
 ExpressionValue[] getData()
           
 String getName()
           
 EncogProgram getOwner()
           
 ProgramExtensionTemplate getTemplate()
           
 boolean isVariable()
           
 String toString()
          
 
Methods inherited from class org.encog.ml.tree.basic.BasicTreeNode
addChildNodes, allLeafChildren, getChildNodes, isLeaf, size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ProgramNode

public ProgramNode(EncogProgram theOwner,
                   ProgramExtensionTemplate theTemplate,
                   ProgramNode[] theArgs)
Construct the program node.

Parameters:
theOwner - The owner of the node.
theTemplate - The opcode that this node is based on.
theArgs - The child nodes to this node.
Method Detail

allConstChildren

public boolean allConstChildren()
Returns:
True if all children are constant.

allConstDescendants

public boolean allConstDescendants()
Returns:
True if all descendants are constant.

evaluate

public ExpressionValue evaluate()
Returns:
The evaluated value of this node.

getChildNode

public ProgramNode getChildNode(int index)
Get the specified child node.

Parameters:
index - The index of this node.
Returns:
The child node requested.

getData

public ExpressionValue[] getData()
Returns:
The node data.

getName

public String getName()
Returns:
The name of this node (from the opcode template).

getOwner

public EncogProgram getOwner()
Returns:
The EncogProgram that owns this node.

getTemplate

public ProgramExtensionTemplate getTemplate()
Returns:
the template

isVariable

public boolean isVariable()
Returns:
Returns true if this node's value is variable.

toString

public String toString()

Overrides:
toString in class Object


Copyright © 2014. All Rights Reserved.