linearalgebra.symbolic
Class PairOperator

java.lang.Object
  extended by linearalgebra.symbolic.AbstractUnknown
      extended by linearalgebra.symbolic.PairOperator
All Implemented Interfaces:
SymbolicValue
Direct Known Subclasses:
Addition, Multiplication

public abstract class PairOperator
extends AbstractUnknown


Field Summary
private  SymbolicValue m_left
           
private  SymbolicValue m_right
           
 
Fields inherited from interface linearalgebra.symbolic.SymbolicValue
ADDS, LEAF, MULT
 
Constructor Summary
PairOperator(SymbolicValue left, SymbolicValue right)
           
 
Method Summary
protected abstract  PairOperator createNewInstance(SymbolicValue left, SymbolicValue right)
           
protected abstract  double doOperation(double left, double right)
           
 SymbolicValue getChild(int index)
          Returns the child node specifed by this index.
 int getChildCount()
          Returns the number of child nodes beneath this tree.
 double getNumericValue()
           
protected abstract  java.lang.String getOperator()
           
protected  void reorderChildren(int[] order)
           
 void setChild(int index, SymbolicValue v)
           
 java.lang.String 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
 
Methods inherited from interface linearalgebra.symbolic.SymbolicValue
getPrecedence
 

Field Detail

m_left

private SymbolicValue m_left

m_right

private SymbolicValue m_right
Constructor Detail

PairOperator

public PairOperator(SymbolicValue left,
                    SymbolicValue right)
Method Detail

setChild

public final void setChild(int index,
                           SymbolicValue v)

getChild

public final SymbolicValue getChild(int index)
Description copied from interface: SymbolicValue
Returns the child node specifed by this index. Throws ArrayOutOfBoundsException if index is invalid.


getChildCount

public final int getChildCount()
Description copied from interface: SymbolicValue
Returns the number of child nodes beneath this tree.


getNumericValue

public double getNumericValue()
                       throws UnboundValueError
Throws:
UnboundValueError

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

reorderChildren

protected void reorderChildren(int[] order)

doOperation

protected abstract double doOperation(double left,
                                      double right)

getOperator

protected abstract java.lang.String getOperator()

createNewInstance

protected abstract PairOperator createNewInstance(SymbolicValue left,
                                                  SymbolicValue right)