Package nz.org.riskscape.engine.rl.agg
Class ListCollecting
java.lang.Object
nz.org.riskscape.engine.rl.agg.ListCollecting
- All Implemented Interfaces:
nz.org.riskscape.engine.rl.agg.AggregationFunction
- Direct Known Subclasses:
MedianAggregationFunction
,ModeAggregationFunction
,PercentileAggregationFunction
,StandardDeviationAggregationFunction
public abstract class ListCollecting
extends Object
implements nz.org.riskscape.engine.rl.agg.AggregationFunction
Base class for an AggregationFunction
that needs to collect encountered items into a list
that the ListCollecting.ListProcessor
can extract the aggregated result from.
By convention the first argument of any function that uses this class should contain the values to be aggregated.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static interface
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract ListCollecting.ListProcessor
buildProcessor
(nz.org.riskscape.engine.types.RSList listType, nz.org.riskscape.engine.rl.RealizationContext context, nz.org.riskscape.engine.types.Type inputType, nz.org.riskscape.rl.ast.FunctionCall fc) Build aListCollecting.ListProcessor
that can produce the aggregated result.nz.org.riskscape.problem.ResultOrProblems<nz.org.riskscape.engine.rl.agg.RealizedAggregateExpression>
realize
(nz.org.riskscape.engine.rl.RealizationContext context, nz.org.riskscape.engine.types.Type inputType, nz.org.riskscape.rl.ast.FunctionCall fc) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface nz.org.riskscape.engine.rl.agg.AggregationFunction
getArguments, getReturnType
-
Constructor Details
-
ListCollecting
public ListCollecting()
-
-
Method Details
-
realize
public nz.org.riskscape.problem.ResultOrProblems<nz.org.riskscape.engine.rl.agg.RealizedAggregateExpression> realize(nz.org.riskscape.engine.rl.RealizationContext context, nz.org.riskscape.engine.types.Type inputType, nz.org.riskscape.rl.ast.FunctionCall fc) - Specified by:
realize
in interfacenz.org.riskscape.engine.rl.agg.AggregationFunction
-
buildProcessor
protected abstract ListCollecting.ListProcessor buildProcessor(nz.org.riskscape.engine.types.RSList listType, nz.org.riskscape.engine.rl.RealizationContext context, nz.org.riskscape.engine.types.Type inputType, nz.org.riskscape.rl.ast.FunctionCall fc) throws nz.org.riskscape.problem.ProblemException Build a
ListCollecting.ListProcessor
that can produce the aggregated result.- Parameters:
listType
- type of the list that will be passed to built processorcontext
- context to realize any other expressions withinputType
-fc
-- Returns:
- list processor to capable of producing aggregated result
- Throws:
nz.org.riskscape.problem.ProblemException
- with any problems encountered
-