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

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Wee builder to decrease chances of bugs due to mis-assigned constructor args.
    static interface 
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    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 Summary

    Modifier and Type
    Method
    Description
    Construct a new Builder to build an ExpressionSetFunction
    protected boolean
     
    boolean
     
    int
     
    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)
     
     

    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

      public static ExpressionAggregationFunction.Builder 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 interface nz.org.riskscape.engine.rl.agg.AggregationFunction
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object