MultiLongValues (Lucene 10.5.1 facet API)
Description: declaration: package: org.apache.lucene.facet, class: MultiLongValues

Package org.apache.lucene.facet

# Class MultiLongValues

java.lang.Object
org.apache.lucene.facet.MultiLongValues

public abstract class MultiLongValues extends Object
Per-segment, per-document long values, which can be calculated at search-time. Documents may produce multiple values. See also `LongValues` for a single-valued version.

Currently meant only for use within the faceting module. Could be further generalized and made available for more use-cases outside faceting if there is a desire to do so.

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

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `MultiLongValues()`
  Instantiates a new MultiLongValues

- ## Method Summary

  Modifier and Type
  Method
  Description
  `abstract boolean`
  `advanceExact(int doc)`
  Advance to exactly `target` and return whether `target` has a value.
  `abstract long`
  `getValueCount()`
  Retrieves the number of values for the current document.
  `abstract long`
  `nextValue()`
  Iterates to the next value in the current document.

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

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

- ## Constructor Details

  - ### MultiLongValues

    public MultiLongValues()
    Instantiates a new MultiLongValues

- ## Method Details

  - ### getValueCount

    public abstract long getValueCount()
    Retrieves the number of values for the current document. This must always be greater than zero. It is illegal to call this method after `advanceExact(int)` returned `false`.

  - ### nextValue

    public abstract long nextValue() throws IOException
    Iterates to the next value in the current document. Do not call this more than `getValueCount()` times for the document.
    Throws:
      `IOException`

  - ### advanceExact

    public abstract boolean advanceExact(int doc) throws IOException
    Advance to exactly `target` and return whether `target` has a value.
    Throws:
      `IOException`