Class ReqIterator

java.lang.Object
org.apache.datasketches.req.ReqIterator

public class ReqIterator
extends Object
Iterator over all retained items of the ReqSketch. The order is not defined.
Author:
Lee Rhodes
  • Method Summary

    Modifier and Type Method Description
    int getCount()
    The number of items processed so far
    float getValue()
    Gets a value from the current entry in the sketch.
    long getWeight()
    Gets a weight for the value from the current entry in the sketch.
    boolean next()
    Advancing the iterator and checking existence of the next entry is combined here for efficiency.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • next

      public boolean next()
      Advancing the iterator and checking existence of the next entry is combined here for efficiency. This results in an undefined state of the iterator before the first call of this method.
      Returns:
      true if the next element exists
    • getValue

      public float getValue()
      Gets a value from the current entry in the sketch. Don't call this before calling next() for the first time or after getting false from next().
      Returns:
      value from the current entry
    • getWeight

      public long getWeight()
      Gets a weight for the value from the current entry in the sketch. Don't call this before calling next() for the first time or after getting false from next().
      Returns:
      weight for the value from the current entry
    • getCount

      public int getCount()
      The number of items processed so far
      Returns:
      The number of items processed so far