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 Tuples as part of a
RealizedAggregateExpression.
-
Method Summary
Modifier and TypeMethodDescriptionstatic RiskscapeFunctionaddAggregationTo(AggregationFunction setFunction, RiskscapeFunction wrapped) static RiskscapeFunctionasFunction(AggregationFunction aggregationFunction) default ArgumentListReturns the arguments this function expects, used for help and other introspectiondefault TypeThe 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
RiskscapeFunctionthat returns the givenAggregationFunctionwhenRiskscapeFunction.getAggregationFunction()is called. Useful for patching an existing function with an aggregate version.
-
asFunction
- Returns:
- a
RiskscapeFunctionthat 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
-