public class Quantile extends Object implements DoubleConsumer
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.
Constructor and Description |
---|
Quantile(double quantile)
Create a new quantile accumulator with the given value.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(double value) |
boolean |
equals(Object obj) |
long |
getSamples() |
double |
getValue()
Return the computed quantile value.
|
int |
hashCode() |
void |
reset()
Reset this object to its initial state.
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
andThen
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 long getSamples()
public void accept(double value)
accept
in interface DoubleConsumer
© 2007-2014 Franz Wilhelmstötter (2014-12-28 10:45)