public class IntegerPercentileAggregatorFunction extends Object implements Function<List<Integer>,Integer>
AbstractListBackedAggregator
which retrieves the percentile value for a
given percentile. The percentile rank/index for a value P can be obtained
using formula: n = round((P / 100) * N + 0.5)
where N is the
number of items in a list.Constructor and Description |
---|
IntegerPercentileAggregatorFunction(double percentile)
Similar to
IntPercentilAggregatorFunction(percentile,true) . |
IntegerPercentileAggregatorFunction(double percentile,
boolean useCopy)
Initializes the function with the given percentile and decides whether
the function will modify the original list or not.
|
Modifier and Type | Method and Description |
---|---|
Integer |
evaluate(List<Integer> data)
Traverses the list and computes the percentile.
|
double |
getPercentile()
Getter for
percentile . |
boolean |
isUseCopy()
Does this instance modify the passed in list or not?
|
String |
toString() |
public IntegerPercentileAggregatorFunction(double percentile)
IntPercentilAggregatorFunction(percentile,true)
.percentile
- Percentile this function will return the value forpublic IntegerPercentileAggregatorFunction(double percentile, boolean useCopy)
percentile
- Percentile this function will return the value foruseCopy
- If set to true, the original list will not be modified and
will contain the data in sorted order, if false, this instance
will operate on a copy of the listpublic Integer evaluate(List<Integer> data)
isUseCopy()
.public double getPercentile()
percentile
.public boolean isUseCopy()
IntegerPercentileAggregatorFunction(double,
boolean)
Copyright © 2003–2014 The Apache Software Foundation. All rights reserved.