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

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

# Interface ComparableSupplier<T extends Comparable<T>>

Type Parameters:
  `T` - something ordinals can be compared by.

public interface ComparableSupplier<T extends Comparable<T>>
Generates `Comparable` for provided ordinal. For example, it can be used to find topN facet ordinals.

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

- ## Method Summary

  Modifier and Type
  Method
  Description
  `T`
  `createComparable(int ord)`
  For given ordinal, create something it can be compared by.
  `void`
  `reuseComparable(int ord, T reuse)`
  For given ordinal, get something it can be compared by.

- ## Method Details

  - ### reuseComparable

    void reuseComparable(int ord, T reuse)
    For given ordinal, get something it can be compared by.
    Parameters:
      `ord` - ordinal.
      `reuse` - object to reuse for building result. Must not be null.

  - ### createComparable

    T createComparable(int ord)
    For given ordinal, create something it can be compared by.
    Parameters:
      `ord` - ordinal.
    Returns:
      Comparable.