Class ItemsSketchIterator<T>

java.lang.Object
org.apache.datasketches.quantiles.ItemsSketchIterator<T>
Type Parameters:
T - type of item
All Implemented Interfaces:
QuantilesGenericSketchIterator<T>, QuantilesSketchIterator

public final class ItemsSketchIterator<T> extends Object implements QuantilesGenericSketchIterator<T>
Iterator over ItemsSketch. The order is not defined.
  • Method Details

    • getQuantile

      public T getQuantile()
      Description copied from interface: QuantilesGenericSketchIterator
      Gets the generic quantile at the current index.

      Don't call this before calling next() for the first time or after getting false from next().

      Specified by:
      getQuantile in interface QuantilesGenericSketchIterator<T>
      Returns:
      the generic quantile at the current index.
    • getWeight

      public long getWeight()
      Description copied from interface: QuantilesSketchIterator
      Gets the natural weight at the current index.

      Don't call this before calling next() for the first time or after getting false from next().

      Specified by:
      getWeight in interface QuantilesSketchIterator
      Returns:
      the natural weight at the current index.
    • next

      public boolean next()
      Description copied from interface: QuantilesSketchIterator
      Advances the index and checks if it is valid. The state of this iterator is undefined before the first call of this method.
      Specified by:
      next in interface QuantilesSketchIterator
      Returns:
      true if the next index is valid.