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>
  • Constructor Summary

    Constructors
    Constructor
    Description
    AggregateExpressionRealizer(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 Type
    Method
    Description
    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.
    nz.org.riskscape.problem.ResultOrProblems<nz.org.riskscape.engine.rl.agg.RealizedAggregateExpression>
     
    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
    visit(nz.org.riskscape.rl.ast.Constant expression, List<nz.org.riskscape.problem.Problem> data)
     
    nz.org.riskscape.rl.ast.Expression
    visit(nz.org.riskscape.rl.ast.FunctionCall expression, List<nz.org.riskscape.problem.Problem> data)
     
    nz.org.riskscape.rl.ast.Expression
    visit(nz.org.riskscape.rl.ast.Lambda expression, List<nz.org.riskscape.problem.Problem> data)
     
    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)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 a RealizedAggregateExpression does not expose as much 'structure' via its API (compared to a RealizedExpression. 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 interface nz.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 interface nz.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 interface nz.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 interface nz.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 interface nz.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 interface nz.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 interface nz.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 interface nz.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 interface nz.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 interface nz.org.riskscape.rl.ast.ExpressionVisitor<List<nz.org.riskscape.problem.Problem>,nz.org.riskscape.rl.ast.Expression>