Class HavingExpression<T,R>
- java.lang.Object
-
- org.apache.qpid.server.query.engine.parsing.expression.AbstractExpressionNode<T,R>
-
- org.apache.qpid.server.query.engine.parsing.query.HavingExpression<T,R>
-
- Type Parameters:
T- Input parameter typeR- Return parameter type
- All Implemented Interfaces:
Function<T,R>,Predicate<T>,Expression<T,R>,ExpressionNode<T,R>
public class HavingExpression<T,R> extends AbstractExpressionNode<T,R> implements Predicate<T>
Contains expression for evaluation of having clause predicate
-
-
Field Summary
-
Fields inherited from class org.apache.qpid.server.query.engine.parsing.expression.AbstractExpressionNode
_metadata
-
-
Constructor Summary
Constructors Constructor Description HavingExpression(SelectExpression<T,R> selectExpression, ExpressionNode<T,R> expression)Constructor initializes children expression list
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Rapply(T value)Evaluates an object against having clause<A> voidapplyAggregation(SelectExpression<T,R> selectExpression, List<T> items)Prepares boolean mask in form of a map having same structure as actual aggregation result, but containing boolean values instead of actual values.voidfilter(Map<String,R> result)Filters aggregation result in accordance with the having predicatebooleantest(T value)Evaluates an object against having clause-
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
-
HavingExpression
public HavingExpression(SelectExpression<T,R> selectExpression, ExpressionNode<T,R> expression)
Constructor initializes children expression list- Parameters:
selectExpression- Select expressionexpression- Having expression
-
-
Method Detail
-
test
public boolean test(T value)
Evaluates an object against having clause
-
applyAggregation
public <A> void applyAggregation(SelectExpression<T,R> selectExpression, List<T> items)
Prepares boolean mask in form of a map having same structure as actual aggregation result, but containing boolean values instead of actual values. Later this boolean mask is applied to the aggregation result to filter it in accordance with the having predicate.- Type Parameters:
A- Collector accumulation type- Parameters:
selectExpression- Select expressionitems- List of objects to be aggregated
-
-