Class AggregateNAryFunction<T extends AggregateCollector,D>
java.lang.Object
org.eclipse.rdf4j.query.parser.sparql.aggregate.AggregateNAryFunction<T,D>
- Type Parameters:
T-D-
- All Implemented Interfaces:
AggregateProcessor<T,List<D>>
@Experimental
public abstract class AggregateNAryFunction<T extends AggregateCollector,D>
extends Object
implements AggregateProcessor<T,List<D>>
N-ary aggregate function processor.
- Author:
- Nik Kozlov
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAggregateNAryFunction(BiFunction<Integer, BindingSet, Value> evaluationStepByIndex) -
Method Summary
Modifier and TypeMethodDescriptionprotected Valueevaluate(Integer index, BindingSet s) abstract voidprocessAggregate(BindingSet bindingSet, Predicate<List<D>> distinctTuple, T agv) Process an aggregate with tuple-level distinctness for n-ary functions.
-
Field Details
-
evaluationStepByIndex
-
-
Constructor Details
-
AggregateNAryFunction
-
-
Method Details
-
processAggregate
public abstract void processAggregate(BindingSet bindingSet, Predicate<List<D>> distinctTuple, T agv) throws QueryEvaluationException Process an aggregate with tuple-level distinctness for n-ary functions.- Specified by:
processAggregatein interfaceAggregateProcessor<T extends AggregateCollector,D> - Parameters:
bindingSet- the current binding setdistinctTuple- predicate to check if the tuple of argument values is distinct. The tuple may contain an arbitrary amount of arguments, therefore if necessary single argument distinctness can be checked inside the predicate. Mixing argument sizes of tuples is not recommended. Note: do not mutate (or reuse) a mutableListinstance after passing it todistinctTuple.test(...)because the predicate may keep it in a hash-based set. If you construct tuples using a mutable list, pass an immutable snapshot (e.g.List.copyOf(tuple)).agv- the aggregate collector- Throws:
QueryEvaluationException- if evaluation fails
-
evaluate
- Throws:
QueryEvaluationException
-