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.| Modifier | Constructor and Description |
|---|---|
protected |
WithExactSummaryStatistics(QS sketch,
double count,
double sum,
double sumCompensation,
double simpleSum,
double min,
double max) |
|
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. |
protected void |
addToCount(double addend) |
protected void |
addToSum(double addend) |
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) |
protected double |
max() |
void |
mergeWith(WithExactSummaryStatistics<QS> other)
Merges the other sketch into this one.
|
protected double |
min() |
protected double |
simpleSum() |
protected QS |
sketch() |
protected double |
sum() |
protected double |
sumCompensation() |
protected void |
updateMax(double value) |
protected void |
updateMin(double value) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAverage, isEmptypublic WithExactSummaryStatistics(java.util.function.Supplier<QS> sketchSupplier)
protected WithExactSummaryStatistics(QS sketch, double count, double sum, double sumCompensation, double simpleSum, double min, double max)
protected final QS sketch()
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 oneprotected final void addToCount(double addend)
protected final void addToSum(double addend)
protected final void updateMin(double value)
protected final void updateMax(double value)
public 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>>>protected final double sum()
protected final double sumCompensation()
protected final double simpleSum()
protected final double min()
protected final double max()
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)