Class SumFunction

  • All Implemented Interfaces:
    Expression

    public final class SumFunction
    extends AggregateFunction
    One of the aggregate functions. The arguments must be numeric.

    SUM returns Long when applied to state-fields of integral types (other than BigInteger); Double when applied to state-fields of floating point types; BigInteger when applied to state-fields of type BigInteger; and BigDecimal when applied to state-fields of type BigDecimal. If SUM, AVG, MAX, or MIN is used, and there are no values to which the aggregate function can be applied, the result of the aggregate function is NULL. If COUNT is used, and there are no values to which COUNT can be applied, the result of the aggregate function is 0.

    BNF: expression ::= SUM([DISTINCT] state_field_path_expression)
    Version:
    2.5
    Author:
    Pascal Filion
    Since:
    2.3