Class GenericSortedViewIterator<T>
java.lang.Object
org.apache.datasketches.quantilescommon.SortedViewIterator
org.apache.datasketches.quantilescommon.GenericSortedViewIterator<T>
- Type Parameters:
T
- The generic item class type
Iterator over quantile sketches of generic type.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGets the quantile at the current index This is equivalent to getQuantile(INCLUSIVE).getQuantile
(QuantileSearchCriteria searchCrit) Gets the quantile at the current index (or previous index) based on the chosen search criterion.Methods inherited from class org.apache.datasketches.quantilescommon.SortedViewIterator
getN, getNaturalRank, getNaturalRank, getNormalizedRank, getNormalizedRank, getWeight, next
-
Constructor Details
-
GenericSortedViewIterator
Constructor- Parameters:
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.
-
-
Method Details
-
getQuantile
Gets the quantile at the current index This is equivalent to getQuantile(INCLUSIVE).Don't call this before calling next() for the first time or after getting false from next().
- Returns:
- the quantile at the current index.
-
getQuantile
Gets the quantile at the current index (or previous index) based on the chosen search criterion.Don't call this before calling next() for the first time or after getting false from next().
- Parameters:
searchCrit
- if INCLUSIVE, includes the quantile at the current index. Otherwise, returns the quantile of the previous index.- Returns:
- the quantile at the current index (or previous index) based on the chosen search criterion. If the chosen search criterion is EXCLUSIVE and the current index is at zero, this will return null.
-