OperationIdT
- Type of the enumeration that describes a group of operations.public interface Operation<OperationIdT extends java.lang.Enum<OperationIdT>>
Operation
interface is a contract for objects implementing
operations on data objects.Modifier and Type | Method and Description |
---|---|
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.
|
OperationIdT getOperationId()
ArityRange getOperationArity()
Data calculate(Data... operands)
operands
- A variable array of operands.java.lang.IllegalArgumentException
- if null
is passed to the method.java.lang.UnsupportedOperationException
- if the operation requires a number of arguments which is
different from the one passed to the method.boolean validTypes(Data... operands)
operands
- A variable array of operands.true
if operand types are valid for the operation or false
otherwise.