Class QuantitySumOrDifferenceOperation<S>

  • Type Parameters:
    S - the type of the scalars (field elements) on which all the operations are based on
    All Implemented Interfaces:
    java.io.Serializable, BinaryFunction<QuantifiedValue<S>,​QuantifiedValue<S>>, BinaryOperation<QuantifiedValue<S>>
    Direct Known Subclasses:
    QuantityAddition, QuantitySubtraction

    public class QuantitySumOrDifferenceOperation<S>
    extends QuantityBinaryOperation<S>
    Base class for operations on physical quantities, that can perform sum or difference, depending on the scalar operation that is passed into the constructor. The left and right operand will be converted to the same base (if they are not provided like this). The errors and validity flags will be propagated according to corresponding strategies given in the environment.
    See Also:
    Serialized Form
    • Method Detail

      • perform

        public QuantifiedValue<S> perform​(QuantifiedValue<S> left,
                                          QuantifiedValue<S> right)
        Description copied from interface: BinaryFunction
        Has to be implemented to perform the actual operation. The order of operands might be important or not, depending, if the operation is commutative or not.
        Parameters:
        left - the left operand to be used in the operation
        right - the right operand to be used in the operation
        Returns:
        the result of the operation