Package nz.org.riskscape.engine.rl.agg
Class AggregateExpressionRealizer
java.lang.Object
nz.org.riskscape.engine.rl.agg.AggregateExpressionRealizer
- All Implemented Interfaces:
nz.org.riskscape.rl.ast.ExpressionVisitor<List<nz.org.riskscape.problem.Problem>,
nz.org.riskscape.rl.ast.Expression>
public class AggregateExpressionRealizer
extends Object
implements nz.org.riskscape.rl.ast.ExpressionVisitor<List<nz.org.riskscape.problem.Problem>,nz.org.riskscape.rl.ast.Expression>
Does all the work for DefaultExpressionRealizer.realizeAggregate(Type, Expression)
-
Constructor Summary
ConstructorDescriptionAggregateExpressionRealizer
(nz.org.riskscape.engine.rl.RealizationContext context, nz.org.riskscape.engine.types.Type inputType, nz.org.riskscape.rl.ast.Expression root) -
Method Summary
Modifier and TypeMethodDescriptionstatic String
getImplicitName
(nz.org.riskscape.rl.ast.FunctionCall aggregateFunctionCall, Collection<String> used) Returns an identifier for use in an aggregate struct expression for the given aggregation function call, where the user hasn't specified one.nz.org.riskscape.problem.ResultOrProblems<nz.org.riskscape.engine.rl.agg.RealizedAggregateExpression>
realize()
nz.org.riskscape.rl.ast.Expression
visit
(nz.org.riskscape.rl.ast.BinaryOperation expression, List<nz.org.riskscape.problem.Problem> data) nz.org.riskscape.rl.ast.Expression
visit
(nz.org.riskscape.rl.ast.BracketedExpression expression, List<nz.org.riskscape.problem.Problem> data) nz.org.riskscape.rl.ast.Expression
nz.org.riskscape.rl.ast.Expression
nz.org.riskscape.rl.ast.Expression
nz.org.riskscape.rl.ast.Expression
visit
(nz.org.riskscape.rl.ast.ListDeclaration expression, List<nz.org.riskscape.problem.Problem> data) nz.org.riskscape.rl.ast.Expression
visit
(nz.org.riskscape.rl.ast.ParameterToken parameterToken, List<nz.org.riskscape.problem.Problem> data) nz.org.riskscape.rl.ast.Expression
visit
(nz.org.riskscape.rl.ast.PropertyAccess expression, List<nz.org.riskscape.problem.Problem> data) nz.org.riskscape.rl.ast.Expression
visit
(nz.org.riskscape.rl.ast.SelectAllExpression expression, List<nz.org.riskscape.problem.Problem> data) nz.org.riskscape.rl.ast.Expression
visit
(nz.org.riskscape.rl.ast.StructDeclaration expression, List<nz.org.riskscape.problem.Problem> data)
-
Constructor Details
-
AggregateExpressionRealizer
public AggregateExpressionRealizer(nz.org.riskscape.engine.rl.RealizationContext context, nz.org.riskscape.engine.types.Type inputType, nz.org.riskscape.rl.ast.Expression root)
-
-
Method Details
-
getImplicitName
public static String getImplicitName(nz.org.riskscape.rl.ast.FunctionCall aggregateFunctionCall, Collection<String> used) Returns an identifier for use in an aggregate struct expression for the given aggregation function call, where the user hasn't specified one.
Note this is a simpler routine than that adopted for scalar expressions
ExpressionRealizer.getImplicitName(RealizationContext, RealizedExpression, Collection)
as aRealizedAggregateExpression
does not expose as much 'structure' via its API (compared to aRealizedExpression
. Given how realization for aggregate expressions is currently implemented, it doesn't really matter in practice and decent names are given in most situations that agree with the names that scalar struct expressions would be given. -
realize
public nz.org.riskscape.problem.ResultOrProblems<nz.org.riskscape.engine.rl.agg.RealizedAggregateExpression> realize() -
visit
public nz.org.riskscape.rl.ast.Expression visit(nz.org.riskscape.rl.ast.BinaryOperation expression, List<nz.org.riskscape.problem.Problem> data) - Specified by:
visit
in interfacenz.org.riskscape.rl.ast.ExpressionVisitor<List<nz.org.riskscape.problem.Problem>,
nz.org.riskscape.rl.ast.Expression>
-
visit
public nz.org.riskscape.rl.ast.Expression visit(nz.org.riskscape.rl.ast.BracketedExpression expression, List<nz.org.riskscape.problem.Problem> data) - Specified by:
visit
in interfacenz.org.riskscape.rl.ast.ExpressionVisitor<List<nz.org.riskscape.problem.Problem>,
nz.org.riskscape.rl.ast.Expression>
-
visit
public nz.org.riskscape.rl.ast.Expression visit(nz.org.riskscape.rl.ast.Constant expression, List<nz.org.riskscape.problem.Problem> data) - Specified by:
visit
in interfacenz.org.riskscape.rl.ast.ExpressionVisitor<List<nz.org.riskscape.problem.Problem>,
nz.org.riskscape.rl.ast.Expression>
-
visit
public nz.org.riskscape.rl.ast.Expression visit(nz.org.riskscape.rl.ast.FunctionCall expression, List<nz.org.riskscape.problem.Problem> data) - Specified by:
visit
in interfacenz.org.riskscape.rl.ast.ExpressionVisitor<List<nz.org.riskscape.problem.Problem>,
nz.org.riskscape.rl.ast.Expression>
-
visit
public nz.org.riskscape.rl.ast.Expression visit(nz.org.riskscape.rl.ast.ListDeclaration expression, List<nz.org.riskscape.problem.Problem> data) - Specified by:
visit
in interfacenz.org.riskscape.rl.ast.ExpressionVisitor<List<nz.org.riskscape.problem.Problem>,
nz.org.riskscape.rl.ast.Expression>
-
visit
public nz.org.riskscape.rl.ast.Expression visit(nz.org.riskscape.rl.ast.PropertyAccess expression, List<nz.org.riskscape.problem.Problem> data) - Specified by:
visit
in interfacenz.org.riskscape.rl.ast.ExpressionVisitor<List<nz.org.riskscape.problem.Problem>,
nz.org.riskscape.rl.ast.Expression>
-
visit
public nz.org.riskscape.rl.ast.Expression visit(nz.org.riskscape.rl.ast.StructDeclaration expression, List<nz.org.riskscape.problem.Problem> data) - Specified by:
visit
in interfacenz.org.riskscape.rl.ast.ExpressionVisitor<List<nz.org.riskscape.problem.Problem>,
nz.org.riskscape.rl.ast.Expression>
-
visit
public nz.org.riskscape.rl.ast.Expression visit(nz.org.riskscape.rl.ast.SelectAllExpression expression, List<nz.org.riskscape.problem.Problem> data) - Specified by:
visit
in interfacenz.org.riskscape.rl.ast.ExpressionVisitor<List<nz.org.riskscape.problem.Problem>,
nz.org.riskscape.rl.ast.Expression>
-
visit
public nz.org.riskscape.rl.ast.Expression visit(nz.org.riskscape.rl.ast.Lambda expression, List<nz.org.riskscape.problem.Problem> data) - Specified by:
visit
in interfacenz.org.riskscape.rl.ast.ExpressionVisitor<List<nz.org.riskscape.problem.Problem>,
nz.org.riskscape.rl.ast.Expression>
-
visit
public nz.org.riskscape.rl.ast.Expression visit(nz.org.riskscape.rl.ast.ParameterToken parameterToken, List<nz.org.riskscape.problem.Problem> data) - Specified by:
visit
in interfacenz.org.riskscape.rl.ast.ExpressionVisitor<List<nz.org.riskscape.problem.Problem>,
nz.org.riskscape.rl.ast.Expression>
-