Package nz.org.riskscape.engine.rl.agg
Class PercentileAggregationFunction
java.lang.Object
nz.org.riskscape.engine.rl.agg.ListCollecting
nz.org.riskscape.engine.rl.agg.PercentileAggregationFunction
- All Implemented Interfaces:
nz.org.riskscape.engine.rl.agg.AggregationFunction
- Direct Known Subclasses:
PercentileAggregationFunction.Single
,PercentileAggregationFunction.SingleFixed
Calculates percentiles using the nearest-rank method.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
static class
APercentileAggregationFunction
that returns a single percentile.static class
APercentileAggregationFunction
that returns a single predefined percentile.Nested classes/interfaces inherited from class nz.org.riskscape.engine.rl.agg.ListCollecting
ListCollecting.ListProcessor
-
Field Summary
Modifier and TypeFieldDescriptionstatic final nz.org.riskscape.engine.types.Type
static final nz.org.riskscape.engine.types.RSList
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected 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 aListCollecting.ListProcessor
that can produce the aggregated result.protected Object
buildResult
(Object[] results, nz.org.riskscape.engine.types.Type resultType) nz.org.riskscape.engine.function.ArgumentList
getPercentiles
(nz.org.riskscape.engine.rl.RealizationContext context, nz.org.riskscape.rl.ast.FunctionCall fc) protected nz.org.riskscape.engine.types.Type
getResultTypeFor
(nz.org.riskscape.engine.types.Type internalType, List<Long> percentiles) Methods inherited from class nz.org.riskscape.engine.rl.agg.ListCollecting
realize
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
-
Field Details
-
PERCENTILE_TYPE
public static final nz.org.riskscape.engine.types.Type PERCENTILE_TYPE -
PERCENTILES_TYPE
public static final nz.org.riskscape.engine.types.RSList PERCENTILES_TYPE
-
-
Constructor Details
-
PercentileAggregationFunction
public PercentileAggregationFunction()
-
-
Method Details
-
getArguments
public nz.org.riskscape.engine.function.ArgumentList getArguments() -
buildProcessor
protected 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 Description copied from class:ListCollecting
Build a
ListCollecting.ListProcessor
that can produce the aggregated result.- Specified by:
buildProcessor
in classListCollecting
- Parameters:
listType
- type of the list that will be passed to built processorcontext
- context to realize any other expressions with- Returns:
- list processor to capable of producing aggregated result
- Throws:
nz.org.riskscape.problem.ProblemException
- with any problems encountered
-
getPercentiles
protected List<Long> getPercentiles(nz.org.riskscape.engine.rl.RealizationContext context, nz.org.riskscape.rl.ast.FunctionCall fc) throws nz.org.riskscape.problem.ProblemException - Returns:
- list of percentiles that need to be found.
- Throws:
nz.org.riskscape.problem.ProblemException
-
buildResult
-
getResultTypeFor
protected nz.org.riskscape.engine.types.Type getResultTypeFor(nz.org.riskscape.engine.types.Type internalType, List<Long> percentiles) throws nz.org.riskscape.problem.ProblemException - Throws:
nz.org.riskscape.problem.ProblemException
-