Constructor and Description |
---|
CalculatorOperation(OperationIdT id,
ArityRange arity) |
Modifier and Type | Method and Description |
---|---|
abstract Data |
calculate(Data... operands)
Performs an operation on the specified operands.
|
ArityRange |
getOperationArity()
Returns the range that describes the allowed arity of the operation.
|
OperationIdT |
getOperationId()
Returns the identifier of the operation.
|
boolean |
validTypes(Data... operands)
Performs type check on the specified operands.
|
public CalculatorOperation(OperationIdT id, ArityRange arity)
public OperationIdT getOperationId()
Operation
getOperationId
in interface Operation<OperationIdT extends java.lang.Enum<OperationIdT>>
public ArityRange getOperationArity()
Operation
getOperationArity
in interface Operation<OperationIdT extends java.lang.Enum<OperationIdT>>
public boolean validTypes(Data... operands)
Operation
validTypes
in interface Operation<OperationIdT extends java.lang.Enum<OperationIdT>>
operands
- A variable array of operands.true
if operand types are valid for the operation or false
otherwise.public abstract Data calculate(Data... operands)
Operation
calculate
in interface Operation<OperationIdT extends java.lang.Enum<OperationIdT>>
operands
- A variable array of operands.