Class ListCollecting

java.lang.Object
nz.org.riskscape.engine.rl.agg.ListCollecting
All Implemented Interfaces:
nz.org.riskscape.engine.rl.agg.AggregationFunction
Direct Known Subclasses:
MedianAggregationFunction, ModeAggregationFunction, PercentileAggregationFunction, StandardDeviationAggregationFunction

public abstract class ListCollecting extends Object implements nz.org.riskscape.engine.rl.agg.AggregationFunction

Base class for an AggregationFunction that needs to collect encountered items into a list that the ListCollecting.ListProcessor can extract the aggregated result from.

By convention the first argument of any function that uses this class should contain the values to be aggregated.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
    static interface 
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract ListCollecting.ListProcessor
    buildProcessor(nz.org.riskscape.engine.types.RSList listType, nz.org.riskscape.engine.rl.RealizationContext context, nz.org.riskscape.engine.types.Type inputType, nz.org.riskscape.rl.ast.FunctionCall fc)
    Build a ListCollecting.ListProcessor that can produce the aggregated result.
    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)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface nz.org.riskscape.engine.rl.agg.AggregationFunction

    getArguments, getReturnType
  • Constructor Details

    • ListCollecting

      public ListCollecting()
  • Method Details

    • 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 interface nz.org.riskscape.engine.rl.agg.AggregationFunction
    • buildProcessor

      protected abstract ListCollecting.ListProcessor buildProcessor(nz.org.riskscape.engine.types.RSList listType, nz.org.riskscape.engine.rl.RealizationContext context, nz.org.riskscape.engine.types.Type inputType, nz.org.riskscape.rl.ast.FunctionCall fc) throws nz.org.riskscape.problem.ProblemException

      Build a ListCollecting.ListProcessor that can produce the aggregated result.

      Parameters:
      listType - type of the list that will be passed to built processor
      context - context to realize any other expressions with
      inputType -
      fc -
      Returns:
      list processor to capable of producing aggregated result
      Throws:
      nz.org.riskscape.problem.ProblemException - with any problems encountered