QS - the type of the wrapped sketch that is used to compute quantilespublic class WithExactSummaryStatistics<QS extends QuantileSketch<QS>> extends java.lang.Object implements QuantileSketch<WithExactSummaryStatistics<QS>>
QuantileSketch to keep track of quantiles.| Constructor and Description |
|---|
WithExactSummaryStatistics(java.util.function.Supplier<QS> sketchSupplier) |
| 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.
|
WithExactSummaryStatistics<QS> |
copy() |
double |
getCount() |
double |
getMaxValue() |
double |
getMinValue() |
double |
getSum() |
double |
getValueAtQuantile(double quantile) |
double[] |
getValuesAtQuantiles(double[] quantiles) |
void |
mergeWith(WithExactSummaryStatistics<QS> other)
Merges the other sketch into this one.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAverage, isEmptypublic WithExactSummaryStatistics(java.util.function.Supplier<QS> sketchSupplier)
public void accept(double value)
QuantileSketchaccept in interface QuantileSketch<WithExactSummaryStatistics<QS extends QuantileSketch<QS>>>accept in interface java.util.function.DoubleConsumervalue - the value to be addedpublic void accept(double value,
double count)
QuantileSketchcount.
If count is an integer, calling accept(value, count) is equivalent to
calling accept(value) count times.
accept in interface QuantileSketch<WithExactSummaryStatistics<QS extends QuantileSketch<QS>>>value - the value to be addedcount - the weight associated with the value to be addedpublic void mergeWith(WithExactSummaryStatistics<QS> other)
QuantileSketchmergeWith in interface QuantileSketch<WithExactSummaryStatistics<QS extends QuantileSketch<QS>>>other - the sketch to be merged into this onepublic WithExactSummaryStatistics<QS> copy()
copy in interface QuantileSketch<WithExactSummaryStatistics<QS extends QuantileSketch<QS>>>public void clear()
QuantileSketchclear in interface QuantileSketch<WithExactSummaryStatistics<QS extends QuantileSketch<QS>>>public double getCount()
getCount in interface QuantileSketch<WithExactSummaryStatistics<QS extends QuantileSketch<QS>>>public double getSum()
getSum in interface QuantileSketch<WithExactSummaryStatistics<QS extends QuantileSketch<QS>>>public double getMinValue()
getMinValue in interface QuantileSketch<WithExactSummaryStatistics<QS extends QuantileSketch<QS>>>public double getMaxValue()
getMaxValue in interface QuantileSketch<WithExactSummaryStatistics<QS extends QuantileSketch<QS>>>public double getValueAtQuantile(double quantile)
getValueAtQuantile in interface QuantileSketch<WithExactSummaryStatistics<QS extends QuantileSketch<QS>>>quantile - a number between 0 and 1 (both included)public double[] getValuesAtQuantiles(double[] quantiles)
getValuesAtQuantiles in interface QuantileSketch<WithExactSummaryStatistics<QS extends QuantileSketch<QS>>>quantiles - number between 0 and 1 (both included)