T
- The generic item class typepublic class GenericSortedViewIterator<T> extends SortedViewIterator
cumWeights, index, totalN
Constructor and Description |
---|
GenericSortedViewIterator(T[] quantiles,
long[] cumWeights)
Constructor
|
Modifier and Type | Method and Description |
---|---|
T |
getQuantile()
Gets the quantile at the current index
This is equivalent to getQuantile(INCLUSIVE).
|
T |
getQuantile(QuantileSearchCriteria searchCrit)
Gets the quantile at the current index (or previous index)
based on the chosen search criterion.
|
getN, getNaturalRank, getNaturalRank, getNormalizedRank, getNormalizedRank, getWeight, next
public GenericSortedViewIterator(T[] quantiles, long[] cumWeights)
quantiles
- the given array of quantilescumWeights
- the array of cumulative weights, corresponding to the array of quantiles,
starting with the value one and the end value must equal N, the total number of items input to the sketch.public T getQuantile()
Don't call this before calling next() for the first time or after getting false from next().
public T getQuantile(QuantileSearchCriteria searchCrit)
Don't call this before calling next() for the first time or after getting false from next().
searchCrit
- if INCLUSIVE, includes the quantile at the current index.
Otherwise, returns the quantile of the previous index.Copyright © 2015–2024 The Apache Software Foundation. All rights reserved.