freegraph
Class ExpressionItem.BiOperator

java.lang.Object
  |
  +--freegraph.ExpressionItem
        |
        +--freegraph.ExpressionItem.BiOperator
Enclosing class:
ExpressionItem

public static class ExpressionItem.BiOperator
extends ExpressionItem

A BiOperator is an ExpressionItem used to hold a all binary operators. (Operators with two operands.) The doOperation() method is used by the ExpressionEvaluator, and the getOrderOfOperationsLevel() method is used by ExpressionStack.


Nested Class Summary
 
Nested classes inherited from class freegraph.ExpressionItem
ExpressionItem.BiOperator, ExpressionItem.Number, ExpressionItem.Parenthesis, ExpressionItem.UnOperator, ExpressionItem.Variable
 
Field Summary
static int ADD
           
static int DIV
           
static int MULT
           
static java.lang.String[] OPERATORS
           
static int POW
           
static int ROOT
           
static int SUBTR
           
 
Constructor Summary
ExpressionItem.BiOperator(int kind)
           
 
Method Summary
 int getAction(ExpressionItem exprItem)
          If exprItem is null or Parenthesis or if exprItem is a BiOperator with order of operations less than this, this item is moved to the hold stack.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ADD

public static final int ADD
See Also:
Constant Field Values

SUBTR

public static final int SUBTR
See Also:
Constant Field Values

MULT

public static final int MULT
See Also:
Constant Field Values

DIV

public static final int DIV
See Also:
Constant Field Values

POW

public static final int POW
See Also:
Constant Field Values

ROOT

public static final int ROOT
See Also:
Constant Field Values

OPERATORS

public static final java.lang.String[] OPERATORS
Constructor Detail

ExpressionItem.BiOperator

public ExpressionItem.BiOperator(int kind)
Method Detail

getAction

public int getAction(ExpressionItem exprItem)
If exprItem is null or Parenthesis or if exprItem is a BiOperator with order of operations less than this, this item is moved to the hold stack. If exprItem is an UnOperator or a BiOperator with order of operation greater than or equal to this, the item on the hold stack is moved to the RPN stack.

Specified by:
getAction in class ExpressionItem

toString

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