Class SumExpression<T>
- java.lang.Object
-
- org.apache.qpid.server.query.engine.parsing.expression.AbstractExpressionNode<T,R>
-
- org.apache.qpid.server.query.engine.parsing.expression.function.AbstractFunctionExpression<T,R>
-
- org.apache.qpid.server.query.engine.parsing.expression.function.aggregation.AbstractAggregationExpression<T,java.lang.Number>
-
- org.apache.qpid.server.query.engine.parsing.expression.function.aggregation.SumExpression<T>
-
- Type Parameters:
T- Input parameter type
- All Implemented Interfaces:
java.util.function.Function<T,java.lang.Number>,Expression<T,java.lang.Number>,ExpressionNode<T,java.lang.Number>
public class SumExpression<T> extends AbstractAggregationExpression<T,java.lang.Number>
The SUM() function returns the total sum of a numeric collection.
-
-
Field Summary
-
Fields inherited from class org.apache.qpid.server.query.engine.parsing.expression.function.AbstractFunctionExpression
_functionName
-
Fields inherited from class org.apache.qpid.server.query.engine.parsing.expression.AbstractExpressionNode
_metadata
-
-
Constructor Summary
Constructors Constructor Description SumExpression(java.lang.String alias, java.util.List<ExpressionNode<T,?>> args)Constructor initializes children expression list
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Numberaggregate(java.util.List<T> items)Performs sum operation using parameters and the value suppliedCollectorTypegetCollectorType()Returns summing collector type-
Methods inherited from class org.apache.qpid.server.query.engine.parsing.expression.function.aggregation.AbstractAggregationExpression
apply, getArguments, getSource, setSelect, setValue
-
Methods inherited from class org.apache.qpid.server.query.engine.parsing.expression.function.AbstractFunctionExpression
evaluateChild, getFunctionName, getOptionalConstantParameter, getOptionalParameter, getRequiredParameter
-
Methods inherited from class org.apache.qpid.server.query.engine.parsing.expression.AbstractExpressionNode
containsAggregation, ctx, evaluateChild, getAggregations, getAlias, getChild, getChildren, getParent, isAccessor, isInstantlyEvaluable, setAlias, setParent, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.qpid.server.query.engine.parsing.expression.Expression
andThen
-
-
-
-
Constructor Detail
-
SumExpression
public SumExpression(java.lang.String alias, java.util.List<ExpressionNode<T,?>> args)Constructor initializes children expression list- Parameters:
alias- Expression aliasargs- List of children expressions
-
-
Method Detail
-
getCollectorType
public CollectorType getCollectorType()
Returns summing collector type- Specified by:
getCollectorTypein classAbstractAggregationExpression<T,java.lang.Number>- Returns:
- CollectorType instance
-
aggregate
public java.lang.Number aggregate(java.util.List<T> items)
Performs sum operation using parameters and the value supplied- Specified by:
aggregatein classAbstractAggregationExpression<T,java.lang.Number>- Parameters:
items- Collection to perform aggregation on- Returns:
- Aggregated result
-
-