OrdinalIterator (Lucene 10.5.0 sandbox API)
Description: declaration: package: org.apache.lucene.sandbox.facet.iterators, interface: OrdinalIterator

Package org.apache.lucene.sandbox.facet.iterators

# Interface OrdinalIterator

All Known Subinterfaces:
  `LeafFacetCutter`

All Known Implementing Classes:
  `CandidateSetOrdinalIterator`, `LengthOrdinalIterator`, `TaxonomyChildrenOrdinalIterator`, `TopnOrdinalIterator`

public interface OrdinalIterator
Iterate over ordinals.

WARNING: This API is experimental and might change in incompatible ways in the next release.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final OrdinalIterator`
  `EMPTY`
  Return empty ordinal iterator
  `static final int`
  `NO_MORE_ORDS`
  This const is returned by nextOrd when there are no more ordinals.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static OrdinalIterator`
  `fromArray(int[] source)`
  Convert int array to ordinal iterator.
  `int`
  `nextOrd()`
  Returns next ord or `NO_MORE_ORDS`.
  `default int[]`
  `toArray()`
  Convert to int array.

- ## Field Details

  - ### NO_MORE_ORDS

    static final int NO_MORE_ORDS
    This const is returned by nextOrd when there are no more ordinals.
    See Also:
      - Constant Field Values

  - ### EMPTY

    static final OrdinalIterator EMPTY
    Return empty ordinal iterator

- ## Method Details

  - ### nextOrd

    int nextOrd() throws IOException
    Returns next ord or `NO_MORE_ORDS`. *
    Throws:
      `IOException`

  - ### toArray

    default int[] toArray() throws IOException
    Convert to int array. Note that after this method is called original OrdinalIterator is exhausted.
    Throws:
      `IOException`

  - ### fromArray

    static OrdinalIterator fromArray(int[] source)
    Convert int array to ordinal iterator.