Class CalculatorOperation<OperationIdT extends java.lang.Enum<OperationIdT>>

  • All Implemented Interfaces:
    Operation<OperationIdT>

    public abstract class CalculatorOperation<OperationIdT extends java.lang.Enum<OperationIdT>>
    extends java.lang.Object
    implements Operation<OperationIdT>
    • Method Detail

      • validTypes

        public boolean validTypes​(Data... operands)
        Description copied from interface: Operation
        Performs type check on the specified operands.
        Specified by:
        validTypes in interface Operation<OperationIdT extends java.lang.Enum<OperationIdT>>
        Parameters:
        operands - A variable array of operands.
        Returns:
        true if operand types are valid for the operation or false otherwise.
      • calculate

        public abstract Data calculate​(Data... operands)
        Description copied from interface: Operation
        Performs an operation on the specified operands.
        Specified by:
        calculate in interface Operation<OperationIdT extends java.lang.Enum<OperationIdT>>
        Parameters:
        operands - A variable array of operands.
        Returns:
        Data object containing the calculated value.