BinaryDocValues (Lucene 10.5.0 core API)
Description: declaration: package: org.apache.lucene.index, class: BinaryDocValues

Package org.apache.lucene.index

# Class BinaryDocValues

java.lang.Object
org.apache.lucene.search.DocIdSetIterator
org.apache.lucene.index.BinaryDocValues

Direct Known Subclasses:
  `BinaryRangeDocValues`, `FilterBinaryDocValues`

public abstract class BinaryDocValues extends DocIdSetIterator
A per-document numeric value.

- ## Field Summary

  ### Fields inherited from class org.apache.lucene.search.DocIdSetIterator

  `NO_MORE_DOCS`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `BinaryDocValues()`
  Sole constructor.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `abstract boolean`
  `advanceExact(int target)`
  Advance the iterator to exactly `target` and return whether `target` has a value.
  `abstract BytesRef`
  `binaryValue()`
  Returns the binary value for the current document ID.

  ### Methods inherited from class org.apache.lucene.search.DocIdSetIterator

  `advance, all, cost, docID, docIDRunEnd, empty, intoBitSet, nextDoc, range, slowAdvance`

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

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

- ## Constructor Details

  - ### BinaryDocValues

    protected BinaryDocValues()
    Sole constructor. (For invocation by subclass constructors, typically implicit.)

- ## Method Details

  - ### binaryValue

    public abstract BytesRef binaryValue() throws IOException
    Returns the binary value for the current document ID. It is illegal to call this method after `advanceExact(int)` returned `false`.
    Returns:
      binary value
    Throws:
      `IOException`

  - ### advanceExact

    public abstract boolean advanceExact(int target) throws IOException
    Advance the iterator to exactly `target` and return whether `target` has a value. `target` must be greater than or equal to the current `doc ID` and must be a valid doc ID, ie. ≥ 0 and < `maxDoc`. After this method returns, `DocIdSetIterator.docID()` returns `target`.

    Note: it is illegal to call `DocIdSetIterator.intoBitSet(int, org.apache.lucene.util.FixedBitSet, int)` or `DocIdSetIterator.docIDRunEnd()` when this method returns false.

    Throws:
      `IOException`