Package nz.org.riskscape.engine.rl.agg
Interface RealizedAggregateExpression
public interface RealizedAggregateExpression
An expression that can be evaluated across many inputs to eventually yield a single 'scalar' result
-
Method Summary
Modifier and TypeMethodDescriptionstatic RealizedAggregateExpressioncreate(Type inputType, Type resultType, Expression from, Supplier<Accumulator> constructor) Create aRealizedAggregateExpressionfrom the given parametersTheTypethat this expression's accumulators accept viaAccumulator.accumulate(Object)TheTypethat this expression's accumulators emit viaAccumulator.process()
-
Method Details
-
create
static RealizedAggregateExpression create(Type inputType, Type resultType, Expression from, Supplier<Accumulator> constructor) Create a
RealizedAggregateExpressionfrom the given parameters- Parameters:
inputType- returned fromgetInputType()resultType- returned fromgetResultType()from- returned fromgetExpression()constructor- used to supplyAccumulators fornewAccumulator()
-
getInputType
Type getInputType()The
Typethat this expression's accumulators accept viaAccumulator.accumulate(Object) -
getResultType
Type getResultType()The
Typethat this expression's accumulators emit viaAccumulator.process() -
newAccumulator
Accumulator newAccumulator()- Returns:
- an
Accumulatorthat can be used for collecting inputs for later processing. Note that this can be called many times to create many accumulators, and that their results can be combined viaAccumulator.combine(Accumulator)to support parallelism
-
getExpression
Expression getExpression()- Returns:
- the
Expressionthat was used to create thisRealizedAggregateExpression
-