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 RealizedAggregateExpression
create
(Type inputType, Type resultType, Expression from, Supplier<Accumulator> constructor) Create aRealizedAggregateExpression
from the given parametersTheType
that this expression's accumulators accept viaAccumulator.accumulate(Object)
TheType
that this expression's accumulators emit viaAccumulator.process()
-
Method Details
-
create
static RealizedAggregateExpression create(Type inputType, Type resultType, Expression from, Supplier<Accumulator> constructor) Create a
RealizedAggregateExpression
from the given parameters- Parameters:
inputType
- returned fromgetInputType()
resultType
- returned fromgetResultType()
from
- returned fromgetExpression()
constructor
- used to supplyAccumulator
s fornewAccumulator()
-
getInputType
Type getInputType()The
Type
that this expression's accumulators accept viaAccumulator.accumulate(Object)
-
getResultType
Type getResultType()The
Type
that this expression's accumulators emit viaAccumulator.process()
-
newAccumulator
Accumulator newAccumulator()- Returns:
- an
Accumulator
that 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
Expression
that was used to create thisRealizedAggregateExpression
-