Constructor and Description |
---|
CalculatorOperation(OperationId 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.
|
OperationId |
getOperationId()
Returns the identifier of the operation.
|
boolean |
validTypes(Data... operands)
Performs type check on the specified operands.
|
public CalculatorOperation(OperationId id, ArityRange arity)
public OperationId getOperationId()
Operation
getOperationId
in interface Operation<OperationId extends java.lang.Enum<OperationId>>
public ArityRange getOperationArity()
Operation
getOperationArity
in interface Operation<OperationId extends java.lang.Enum<OperationId>>
public boolean validTypes(Data... operands)
Operation
validTypes
in interface Operation<OperationId extends java.lang.Enum<OperationId>>
public abstract Data calculate(Data... operands)
Operation
calculate
in interface Operation<OperationId extends java.lang.Enum<OperationId>>
operands
- A variable of operands.