EDU.ksu.cis.calculator
Interface Operation
- All Known Subinterfaces:
- EncodedOperation
- All Known Implementing Classes:
- Add, Add, ChangeSigns, ChangeSigns, ClearStack, ClearStack, ConvertBase, Divide, Divide, Multiply, Multiply, Pop, Pop, Power, Power, Push, Push, Remainder, Remainder, RotateDown, RotateDown, RotateUp, RotateUp, Subtract, Subtract, TenToPower, TenToPower, TwoToPower, TwoToPower
- public interface Operation
An interface abstracting any operation. The operation may be
explicitly encoded in an implementing subclass, or may defer the
operation to some method receiving the Operation as a parameter.
Arithmetic operations should be encoded explicitly; in this case,
subclasses should implement EncodedOperation
. In this way,
the encoding of an arithmetic operation can be decoupled from the
control of evaluation order.
- Author:
- Rod Howell
(howell@cis.ksu.edu)
Method Summary |
int |
numOperands()
Returns the number of operands required by this Operation. |
numOperands
public int numOperands()
- Returns the number of operands required by this Operation.