MVT API

math.objects
Class BinaryExpression

java.lang.Object
  |
  +--math.objects.Expression
        |
        +--math.objects.BinaryExpression
Direct Known Subclasses:
Add, Divide, Log, Multiply, Power, Subtract

public abstract class BinaryExpression
extends Expression

The BinaryExpression class defines an extends of the Expression class to include binary expressions like Add and Mulitply and a left child and right child each pointing to a expr class object

Since:
JDK1.1
Author:
Peter Staab
, Pete Fox , both for the Mathematical Visualization Project for the Department of Applied Mathematics, University of Colorado at Boulder

Field Summary
protected  Expression leftChild
          The variables leftChild and rightChild store the first and second children of binary expressions.
protected  Expression rightChild
          The variables leftChild and rightChild store the first and second children of binary expressions.
 
Constructor Summary
protected BinaryExpression(Expression left, Expression right)
          Creates a new BinaryExpression instance.
 
Method Summary
 Expression getLeftChild()
          The method getLeftChild returns the left child of a binary expression.
 Expression getRightChild()
          The method getRightChild returns the right child of a binary expression.
 void setLeftChild(Expression expr)
          The method setLeftChild sets the left child.
 void setRightChild(Expression expr)
          The method setRightChild sets the right child expression.
 Expression simplify()
          A method that returns a Expression representation of the Log object with its Children in a simplified form with redundant terms combined and terms multiplied by zero eliminated.
 
Methods inherited from class math.objects.Expression
differentiate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluateVariables
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

leftChild

protected Expression leftChild
The variables leftChild and rightChild store the first and second children of binary expressions.


rightChild

protected Expression rightChild
The variables leftChild and rightChild store the first and second children of binary expressions.

Constructor Detail

BinaryExpression

protected BinaryExpression(Expression left,
                           Expression right)
Creates a new BinaryExpression instance.

Parameters:
left - an Expression value
right - an Expression value
Method Detail

getLeftChild

public Expression getLeftChild()
The method getLeftChild returns the left child of a binary expression.

Returns:
an Expression value

setLeftChild

public void setLeftChild(Expression expr)
The method setLeftChild sets the left child.

Parameters:
expr - an Expression value

getRightChild

public Expression getRightChild()
The method getRightChild returns the right child of a binary expression.

Returns:
an Expression value

setRightChild

public void setRightChild(Expression expr)
The method setRightChild sets the right child expression.

Parameters:
expr - an Expression value

simplify

public Expression simplify()
A method that returns a Expression representation of the Log object with its Children in a simplified form with redundant terms combined and terms multiplied by zero eliminated.

Specified by:
simplify in class Expression
Returns:
an Expression object in a simplified form

MVT API

mvt.icons