public interface SortedViewIterator
Prototype example of the recommended iteration loop:
SortedViewIterator itr = sketch.getSortedView().iterator();
while (itr.next()) {
long weight = itr.getWeight();
...
}
| 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.
|
long |
getWeight()
Gets the natural weight at the current index.
|
boolean |
next()
Advances the index and checks if it is valid.
|
long getCumulativeWeight(QuantileSearchCriteria searchCrit)
Don't call this before calling next() for the first time or after getting false from next().
searchCrit - if INCLUSIVE, includes the weight at the current index in the cumulative sum.
Otherwise, it will return the cumulative weight of the previous index.long getN()
double getNormalizedRank(QuantileSearchCriteria searchCrit)
Don't call this before calling next() for the first time or after getting false from next().
searchCrit - if INCLUSIVE, includes the normalized rank at the current index.
Otherwise, returns the normalized rank of the previous index.long getWeight()
Don't call this before calling next() for the first time or after getting false from next().
boolean next()
Copyright © 2015–2022 The Apache Software Foundation. All rights reserved.