# Interface QuantilesSketchIteratorAPI

All Known Subinterfaces:
  `QuantilesDoublesSketchIteratorAPI, QuantilesFloatsSketchIterator, QuantilesGenericSketchIteratorAPI<T>, QuantilesLongsSketchIterator`

All Known Implementing Classes:
  `KllDoublesSketchIterator, KllFloatsSketchIterator, KllItemsSketchIterator, KllLongsSketchIterator, KllSketchIterator, QuantilesDoublesSketchIterator, QuantilesItemsSketchIterator, ReqSketchIterator`

public interface QuantilesSketchIteratorAPI
This is the base API for the iterator hierarchy used for viewing the non-ordered quantiles retained by the classic Quantiles* sketches and KLL sketches, for example.

Prototype example of the recommended iteration loop:

      SketchIterator itr = sketch.iterator();
      while (itr.next()) {
        ...get*();
      }

Author:
  Lee Rhodes

## Method Summary

Modifier and Type
Method
Description
`long`
`getWeight()`
Gets the natural weight at the current index.
`boolean`
`next()`
Advances the index and checks if it is valid.

## Method Details

### getWeight

long getWeight()
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().

Returns:
  the natural weight at the current index.

### next

boolean next()
Advances the index and checks if it is valid. The state of this iterator is undefined before the first call of this method.

Returns:
  true if the next index is valid.