FloatFacetSet (Lucene 10.5.0 facet API)
Description: declaration: package: org.apache.lucene.facet.facetset, class: FloatFacetSet

Package org.apache.lucene.facet.facetset

# Class FloatFacetSet

java.lang.Object
org.apache.lucene.facet.facetset.FacetSet
org.apache.lucene.facet.facetset.FloatFacetSet

public class FloatFacetSet extends FacetSet
A `FacetSet` which encodes float dimension values.

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

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `final float[]`
  `values`
  The raw dimension values of this facet set.

  ### Fields inherited from class org.apache.lucene.facet.facetset.FacetSet

  `dims`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `FloatFacetSet(float... values)`
  Constructs a new instance of a facet set which stores `float` dimension values.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `long[]`
  `getComparableValues()`
  Returns the dimension values in this facet set as comparable longs.
  `int`
  `packValues(byte[] buf, int start)`
  Packs the dimension values into the given `byte[]` and returns the number of packed-values bytes.
  `int`
  `sizePackedBytes()`
  Returns the size of the packed values in this facet set.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### values

    public final float[] values
    The raw dimension values of this facet set.

- ## Constructor Details

  - ### FloatFacetSet

    public FloatFacetSet(float... values)
    Constructs a new instance of a facet set which stores `float` dimension values.

- ## Method Details

  - ### getComparableValues

    public long[] getComparableValues()
    Description copied from class: `FacetSet`
    Returns the dimension values in this facet set as comparable longs.
    Specified by:
      `getComparableValues` in class `FacetSet`

  - ### packValues

    public int packValues(byte[] buf, int start)
    Description copied from class: `FacetSet`
    Packs the dimension values into the given `byte[]` and returns the number of packed-values bytes. The default implementation packs the `comparable values`, and you can override to implement your own scheme.
    Overrides:
      `packValues` in class `FacetSet`

  - ### sizePackedBytes

    public int sizePackedBytes()
    Description copied from class: `FacetSet`
    Returns the size of the packed values in this facet set. If the value is unknown in advance (e.g. if the values are compressed), this method can return an upper limit. The default implementations returns `dims * Long.BYTES` per the default implementation of `FacetSet.packValues(byte[], int)`. You should override if you implement `FacetSet.packValues(byte[], int)` differently.
    Overrides:
      `sizePackedBytes` in class `FacetSet`