linearalgebra.symbolic
Interface SymbolicValue

All Known Implementing Classes:
AbstractUnknown, Addition, ConstantSymbol, Inverse, LeafUnknown, Multiplication, Negative, PairOperator, UnaryOperator

public interface SymbolicValue


Field Summary
static int ADDS
           
static int LEAF
           
static int MULT
           
 
Method Summary
 void addParent(SymbolicValue parent)
          Adds a parent to the nodes parent list.
 boolean contains(SymbolicValue v, SymbolicValue parent)
          Searches the tree for the SymbolicValue v.
 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()
           
 SymbolicValue getParent(int index)
          Returns the parent specified by the index.
 int getParentCount()
          Returns the number of nodes that have this subtree as a child.
 int getPrecedence()
          Returns an order-of-operations indicator.
 boolean isNormal()
          Checks if each child in the tree should be operated on first according to the operator precedence.
 void removeParent(SymbolicValue parent)
           
 SymbolicValue scale(SymbolicValue v)
           
 void subTreeChanged()
          Invalidates cached information about the tree.
 

Field Detail

LEAF

static final int LEAF
See Also:
Constant Field Values

ADDS

static final int ADDS
See Also:
Constant Field Values

MULT

static final int MULT
See Also:
Constant Field Values
Method Detail

scale

SymbolicValue scale(SymbolicValue v)

getNumericValue

double getNumericValue()
                       throws UnboundValueError
Throws:
UnboundValueError

isNormal

boolean isNormal()
Checks if each child in the tree should be operated on first according to the operator precedence.


getPrecedence

int getPrecedence()
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.


getChildCount

int getChildCount()
Returns the number of child nodes beneath this tree.


getChild

SymbolicValue getChild(int index)
Returns the child node specifed by this index. Throws ArrayOutOfBoundsException if index is invalid.

Parameters:
index -

getParentCount

int getParentCount()
Returns the number of nodes that have this subtree as a child.


addParent

void addParent(SymbolicValue parent)
Adds a parent to the nodes parent list.

Parameters:
parent -

removeParent

void removeParent(SymbolicValue parent)

getParent

SymbolicValue getParent(int index)
Returns the parent specified by the index. Throws an ArrayOutOfBoundsException if the index is invalid.

Parameters:
index -

contains

boolean contains(SymbolicValue v,
                 SymbolicValue parent)
Searches the tree for the SymbolicValue v. Returns true if it contains the element, and false otherwise. The parent is passed in to allow easier tree traversal.

Parameters:
v -
parent -

subTreeChanged

void subTreeChanged()
Invalidates cached information about the tree.