T - The generic quantile typepublic class GenericSortedViewIterator<T> extends Object implements SortedViewIterator
SortedViewIterator| Constructor and Description |
|---|
GenericSortedViewIterator(T[] quantiles,
long[] cumWeights) |
| Modifier and Type | Method and Description |
|---|---|
long |
getCumulativeWeight(QuantileSearchCriteria searchCrit)
Gets the cumulative weight at the current index (or previous index) based on the chosen search criterion.
|
long |
getN()
Gets the total count of all items presented to the sketch.
|
double |
getNormalizedRank(QuantileSearchCriteria searchCrit)
Gets the normalized rank at the current index (or previous index)
based on the chosen search criterion.
|
T |
getQuantile() |
long |
getWeight()
Gets the natural weight at the current index.
|
boolean |
next()
Advances the index and checks if it is valid.
|
public GenericSortedViewIterator(T[] quantiles, long[] cumWeights)
public long getCumulativeWeight(QuantileSearchCriteria searchCrit)
SortedViewIteratorDon't call this before calling next() for the first time or after getting false from next().
getCumulativeWeight in interface SortedViewIteratorsearchCrit - if INCLUSIVE, includes the weight at the current index in the cumulative sum.
Otherwise, it will return the cumulative weight of the previous index.public T getQuantile()
public long getN()
SortedViewIteratorgetN in interface SortedViewIteratorpublic double getNormalizedRank(QuantileSearchCriteria searchCrit)
SortedViewIteratorDon't call this before calling next() for the first time or after getting false from next().
getNormalizedRank in interface SortedViewIteratorsearchCrit - if INCLUSIVE, includes the normalized rank at the current index.
Otherwise, returns the normalized rank of the previous index.public long getWeight()
SortedViewIteratorDon't call this before calling next() for the first time or after getting false from next().
getWeight in interface SortedViewIteratorpublic boolean next()
SortedViewIteratornext in interface SortedViewIteratorCopyright © 2015–2022 The Apache Software Foundation. All rights reserved.