infix2postfix
Class BinaryOperator

java.lang.Object
  extended byinfix2postfix.Operator
      extended byinfix2postfix.BinaryOperator
Direct Known Subclasses:
BinaryFunctionOperator

public abstract class BinaryOperator
extends Operator

This class models a binary operator. A binary operator operates on two operands.

Author:
Maulin H. Vasavada

Field Summary
 
Fields inherited from class infix2postfix.Operator
priority, symbol
 
Constructor Summary
BinaryOperator(java.lang.String symbol, int priority)
           
 
Method Summary
abstract  java.lang.Object applyOperator(java.lang.Object operand1, java.lang.Object operand2)
          Applies this binary operator on two operands.
 
Methods inherited from class infix2postfix.Operator
equals, getPriority, getSymbol, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BinaryOperator

public BinaryOperator(java.lang.String symbol,
                      int priority)
Method Detail

applyOperator

public abstract java.lang.Object applyOperator(java.lang.Object operand1,
                                               java.lang.Object operand2)
                                        throws InvalidOperandException
Applies this binary operator on two operands. Both the operands must match the "validity criteria" defined by the OperandManager being used.

Parameters:
operand1 - First operand
operand2 - Second operand
Returns:
java.lang.Object Result of this operator's applicability on two operands
Throws:
InvalidOperandException - If any of the given operands is invalid according to the "validity criteria"
See Also:
OperandManager