Class GenericSortedViewIterator<T>

  • Type Parameters:
    T - The generic item class type

    public class GenericSortedViewIterator<T>
    extends SortedViewIterator
    Iterator over quantile sketches of generic type.
    • Constructor Detail

      • GenericSortedViewIterator

        public GenericSortedViewIterator​(T[] quantiles,
                                         long[] cumWeights)
        Constructor
        Parameters:
        quantiles - the given array of quantiles
        cumWeights - 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 Detail

      • getQuantile

        public T 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

        public T getQuantile​(QuantileSearchCriteria searchCrit)
        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.