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
ConstructorsConstructorDescriptionBucketRange(nz.org.riskscape.engine.rl.agg.AggregationFunction bucketFunction) -
Method Summary
Modifier and TypeMethodDescriptionnz.org.riskscape.engine.function.ArgumentListnz.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 aBucketFunctioncall by turning thepickattribute into a lambda expression, and converting therangelist into abucketstruct 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, waitMethods 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
BucketFunctioncall by turning thepickattribute into a lambda expression, and converting therangelist into abucketstruct expression with start/end members for each range band.- Specified by:
realizein interfacenz.org.riskscape.engine.rl.agg.AggregationFunction
-
getArguments
public nz.org.riskscape.engine.function.ArgumentList getArguments()- Specified by:
getArgumentsin interfacenz.org.riskscape.engine.rl.agg.AggregationFunction
-