infix2postfix
Class UnaryOperator

java.lang.Object
  extended byinfix2postfix.Operator
      extended byinfix2postfix.UnaryOperator
Direct Known Subclasses:
UnaryFunctionOperator

public abstract class UnaryOperator
extends Operator

This class represents unary operator. A unary operator operates on one operand.

Author:
Maulin H. Vasavada

Field Summary
 
Fields inherited from class infix2postfix.Operator
priority, symbol
 
Constructor Summary
UnaryOperator(java.lang.String symbol, int priority)
           
 
Method Summary
abstract  java.lang.Object applyOperator(java.lang.Object operand)
          Applies this unary operator on single 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

UnaryOperator

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

applyOperator

public abstract java.lang.Object applyOperator(java.lang.Object operand)
                                        throws InvalidOperandException
Applies this unary operator on single operands. The operand must match the "validity criteria" defined by the OperandManager being used.

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