Package nz.org.riskscape.engine.function
Class ExpressionAggregationFunction
java.lang.Object
nz.org.riskscape.engine.function.ExpressionAggregationFunction
- All Implemented Interfaces:
nz.org.riskscape.engine.rl.agg.AggregationFunction
public class ExpressionAggregationFunction
extends Object
implements nz.org.riskscape.engine.rl.agg.AggregationFunction
Build an AggregationFunction
based on a set of riskscape expressions that reduce the input into an
accumulator value, combine accumulated values (to support parallelism) and then emit a collected value.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Wee builder to decrease chances of bugs due to mis-assigned constructor args.static interface
-
Constructor Summary
ConstructorDescriptionExpressionAggregationFunction
(nz.org.riskscape.rl.ast.Expression identityExpression, nz.org.riskscape.rl.ast.Lambda mapExpression, nz.org.riskscape.rl.ast.Lambda reduceExpression, nz.org.riskscape.rl.ast.Lambda processExpression) -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Construct a new Builder to build an ExpressionSetFunctionprotected boolean
boolean
int
hashCode()
boolean
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) toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface nz.org.riskscape.engine.rl.agg.AggregationFunction
getArguments, getReturnType
-
Constructor Details
-
ExpressionAggregationFunction
public ExpressionAggregationFunction(nz.org.riskscape.rl.ast.Expression identityExpression, nz.org.riskscape.rl.ast.Lambda mapExpression, nz.org.riskscape.rl.ast.Lambda reduceExpression, nz.org.riskscape.rl.ast.Lambda processExpression)
-
-
Method Details
-
builder
Construct a new Builder to build an ExpressionSetFunction
- Returns:
- new Builder
-
hasIdentity
public boolean hasIdentity()- Returns:
- true if an identity expression has been given. Note that it's possible for this to realize to a nullable type, but it's probably a user error - not sure we want that to happen
-
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
-
toString
-
equals
-
canEqual
-
hashCode
public int hashCode()
-