linearalgebra.symbolic
Class Addition

java.lang.Object
  extended by linearalgebra.symbolic.AbstractUnknown
      extended by linearalgebra.symbolic.PairOperator
          extended by linearalgebra.symbolic.Addition
All Implemented Interfaces:
SymbolicValue

public class Addition
extends PairOperator


Field Summary
 
Fields inherited from interface linearalgebra.symbolic.SymbolicValue
ADDS, LEAF, MULT
 
Constructor Summary
Addition(SymbolicValue a, SymbolicValue b)
           
 
Method Summary
protected  PairOperator createNewInstance(SymbolicValue left, SymbolicValue right)
           
protected  double doOperation(double left, double right)
           
protected  java.lang.String getOperator()
           
 int getPrecedence()
          Returns an order-of-operations indicator.
 
Methods inherited from class linearalgebra.symbolic.PairOperator
getChild, getChildCount, getNumericValue, reorderChildren, setChild, toString
 
Methods inherited from class linearalgebra.symbolic.AbstractUnknown
addParent, appendParenthesisString, contains, getParent, getParentCount, isNormal, removeParent, scale, subTreeChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Addition

public Addition(SymbolicValue a,
                SymbolicValue b)
Method Detail

getPrecedence

public int getPrecedence()
Description copied from interface: SymbolicValue
Returns an order-of-operations indicator. Lower numbers mean lower precedence. This does not influence the execution order of the tree. It was originally intended to allow the tree to insert parenthesis when printing itself.


doOperation

protected final double doOperation(double left,
                                   double right)
Specified by:
doOperation in class PairOperator

getOperator

protected final java.lang.String getOperator()
Specified by:
getOperator in class PairOperator

createNewInstance

protected PairOperator createNewInstance(SymbolicValue left,
                                         SymbolicValue right)
Specified by:
createNewInstance in class PairOperator