public interface QuantileSketch<QS extends QuantileSketch<QS>>
extends java.util.function.DoubleConsumer
double values and can compute quantiles over the ingested
values.
Quantile values are usually computed with an approximation error that depends on the sketch implementation.
| Modifier and Type | Method and Description |
|---|---|
void |
accept(double value)
Adds a value to the sketch.
|
void |
accept(double value,
double count)
Adds a value to the sketch with a floating-point
count. |
void |
clear()
Sets all counts in the sketch to zero.
|
QS |
copy() |
default double |
getAverage() |
double |
getCount() |
default double |
getMaxValue() |
default double |
getMinValue() |
double |
getSum() |
double |
getValueAtQuantile(double quantile) |
double[] |
getValuesAtQuantiles(double[] quantiles) |
default boolean |
isEmpty() |
void |
mergeWith(QS other)
Merges the other sketch into this one.
|
void accept(double value)
accept in interface java.util.function.DoubleConsumervalue - the value to be addedvoid accept(double value,
double count)
count.
If count is an integer, calling accept(value, count) is equivalent to
calling accept(value) count times.
value - the value to be addedcount - the weight associated with the value to be addedjava.lang.IllegalArgumentException - if count is negativevoid mergeWith(QS other)
other - the sketch to be merged into this onejava.lang.NullPointerException - if other is nullQS copy()
default boolean isEmpty()
void clear()
double getCount()
double getSum()
default double getMinValue()
java.util.NoSuchElementException - if the sketch is emptydefault double getMaxValue()
java.util.NoSuchElementException - if the sketch is emptydouble getValueAtQuantile(double quantile)
quantile - a number between 0 and 1 (both included)java.util.NoSuchElementException - if the sketch is emptydouble[] getValuesAtQuantiles(double[] quantiles)
quantiles - number between 0 and 1 (both included)java.util.NoSuchElementException - if the sketch is emptydefault double getAverage()
java.util.NoSuchElementException - if the sketch is empty