com.graphbuilder.math
Class OpNode

java.lang.Object
  extended bycom.graphbuilder.math.Expression
      extended bycom.graphbuilder.math.OpNode
Direct Known Subclasses:
AddNode, DivNode, MultNode, PowNode, SubNode

public abstract class OpNode
extends Expression

A node of an expression tree that has exactly 2 children, a left child and a right child. After the children are evaluated, a mathematical operation is applied and the result is returned.


Field Summary
protected  Expression leftChild
           
protected  Expression rightChild
           
 
Fields inherited from class com.graphbuilder.math.Expression
parent
 
Constructor Summary
OpNode(Expression leftChild, Expression rightChild)
           
 
Method Summary
 Expression getLeftChild()
           
 Expression getRightChild()
           
abstract  java.lang.String getSymbol()
          Returns the text symbol that represents the operation.
 void setLeftChild(Expression x)
           
 void setRightChild(Expression x)
           
 
Methods inherited from class com.graphbuilder.math.Expression
checkBeforeAccept, eval, getFunctionNames, getParent, getVariableNames, isDescendent, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

leftChild

protected Expression leftChild

rightChild

protected Expression rightChild
Constructor Detail

OpNode

public OpNode(Expression leftChild,
              Expression rightChild)
Method Detail

setLeftChild

public void setLeftChild(Expression x)

setRightChild

public void setRightChild(Expression x)

getLeftChild

public Expression getLeftChild()

getRightChild

public Expression getRightChild()

getSymbol

public abstract java.lang.String getSymbol()
Returns the text symbol that represents the operation.