Class BucketRange

java.lang.Object
nz.org.riskscape.defaults.function.BucketRange
All Implemented Interfaces:
nz.org.riskscape.engine.rl.agg.AggregationFunction

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

Aggregate function for applying the given select aggregate expression to rows whose picked value falls between a range of user-defined numbers. This function is essentially a wrapper around the BucketFunction, but with a simpler, terse argument syntax that is optimized for bucketing according to values within a range.

  • Constructor Summary

    Constructors
    Constructor
    Description
    BucketRange(nz.org.riskscape.engine.rl.agg.AggregationFunction bucketFunction)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    nz.org.riskscape.engine.function.ArgumentList
     
    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)
    Maps the given args into a BucketFunction call by turning the pick attribute into a lambda expression, and converting the range list into a bucket struct expression with start/end members for each range band.

    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

    getReturnType
  • Constructor Details

    • BucketRange

      public BucketRange(nz.org.riskscape.engine.rl.agg.AggregationFunction bucketFunction)
  • 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)

      Maps the given args into a BucketFunction call by turning the pick attribute into a lambda expression, and converting the range list into a bucket struct expression with start/end members for each range band.

      Specified by:
      realize in interface nz.org.riskscape.engine.rl.agg.AggregationFunction
    • getArguments

      public nz.org.riskscape.engine.function.ArgumentList getArguments()
      Specified by:
      getArguments in interface nz.org.riskscape.engine.rl.agg.AggregationFunction