Package nz.org.riskscape.engine.rl.agg
Interface AggregationFunction
public interface AggregationFunction
A RiskscapeFunction
sub-interface for a function that can be applied across many Tuple
s as part of a
RealizedAggregateExpression
.
-
Method Summary
Modifier and TypeMethodDescriptionstatic RiskscapeFunction
addAggregationTo
(AggregationFunction setFunction, RiskscapeFunction wrapped) static RiskscapeFunction
asFunction
(AggregationFunction aggregationFunction) default ArgumentList
Returns the arguments this function expects, used for help and other introspectiondefault Type
The return type this function produces, used for help and other introspectionrealize
(RealizationContext context, Type inputType, FunctionCall fc) Realize this function so that it can be called (via an Accumulator)
-
Method Details
-
addAggregationTo
static RiskscapeFunction addAggregationTo(AggregationFunction setFunction, RiskscapeFunction wrapped) - Returns:
- a new
RiskscapeFunction
that returns the givenAggregationFunction
whenRiskscapeFunction.getAggregationFunction()
is called. Useful for patching an existing function with an aggregate version.
-
asFunction
- Returns:
- a
RiskscapeFunction
that works on a list of the same elements supported by the given aggregation function.
-
realize
ResultOrProblems<RealizedAggregateExpression> realize(RealizationContext context, Type inputType, FunctionCall fc) Realize this function so that it can be called (via an Accumulator)
- Parameters:
context
- the context it will be used underfc
- the expression being realized- Returns:
- either a successfully realized function, or reasons why it could not be realized.
-
getArguments
Returns the arguments this function expects, used for help and other introspection
-
getReturnType
The return type this function produces, used for help and other introspection
-