Class NegationOperator

java.lang.Object
  |
  +--Operator
        |
        +--NegationOperator

public class NegationOperator
extends Operator

This represents the binary operator - in an arithmetic equation; as in -(3) = -3.


Fields inherited from class Operator
numberOperands, precedence, preceededByAnOperand, token
 
Constructor Summary
NegationOperator()
          Creates an Operator with: token: - precedence: 1 numberOperands: 1 preceededByAnOperand: false
 
Method Summary
 int operate(int[] x)
           
 
Methods inherited from class Operator
isHigherPrecedence, isLowerPrecedence, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NegationOperator

public NegationOperator()
Creates an Operator with:
Method Detail

operate

public int operate(int[] x)
Parameters:
x[] - the operands
Returns:
-x[0]
Overrides:
operate in class Operator