public class Quantile<N extends Number> extends MappedAccumulator<N>
Raj JAIN and Imrich CHLAMTAC:
The P2 Algorithm for Dynamic Calculation of Quantiles and
Histograms Without Storing Observations
[Communications
of the ACM; October 1985, Volume 28, Number 10]
Note that this implementation is not synchronized. If multiple threads access this object concurrently, and at least one of the threads modifies it, it must be synchronized externally.
_samples
Constructor and Description |
---|
Quantile(double quantile)
Create a new quantile accumulator with the given value.
|
Modifier and Type | Method and Description |
---|---|
void |
accumulate(N value)
Accumulate the given value.
|
Quantile<N> |
clone() |
boolean |
equals(Object obj) |
double |
getValue()
Return the computed quantile value.
|
int |
hashCode() |
void |
reset()
Reset this object to its initial state.
|
String |
toString() |
getSamples, map
public Quantile(double quantile)
quantile
- the wished quantile value.IllegalArgumentException
- if the quantile
is not in the
range [0, 1]
.public void reset()
public double getValue()
public void accumulate(N value)
Accumulator
accumulate
in interface Accumulator<N extends Number>
accumulate
in class MappedAccumulator<N extends Number>
value
- the value to accumulate.public int hashCode()
hashCode
in class MappedAccumulator<N extends Number>
public boolean equals(Object obj)
equals
in class MappedAccumulator<N extends Number>
© 2007-2014 Franz Wilhelmstötter (2014-10-03 19:44)