DocAndScoreAccBuffer (Lucene 10.5.1 core API)
Description: declaration: package: org.apache.lucene.search, class: DocAndScoreAccBuffer

Package org.apache.lucene.search

# Class DocAndScoreAccBuffer

java.lang.Object
org.apache.lucene.search.DocAndScoreAccBuffer

public final class DocAndScoreAccBuffer extends Object
Wrapper around parallel arrays storing doc IDs and their corresponding score accumulators.

NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `int[]`
  `docs`
  Doc IDs
  `double[]`
  `scores`
  Scores
  `int`
  `size`
  Number of valid entries in the doc ID and score arrays.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DocAndScoreAccBuffer()`
  Sole constructor.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `copyFrom(DocAndFloatFeatureBuffer buffer)`
  Copy content from the given `DocAndFloatFeatureBuffer`, expanding float scores to doubles.
  `void`
  `grow(int minSize)`
  Grow both arrays to ensure that they can store at least the given number of entries.
  `void`
  `growNoCopy(int minSize)`
  Grow both arrays to ensure that they can store at least the given number of entries.

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

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

- ## Field Details

  - ### docs

    public int[] docs
    Doc IDs

  - ### scores

    public double[] scores
    Scores

  - ### size

    public int size
    Number of valid entries in the doc ID and score arrays.

- ## Constructor Details

  - ### DocAndScoreAccBuffer

    public DocAndScoreAccBuffer()
    Sole constructor.

- ## Method Details

  - ### growNoCopy

    public void growNoCopy(int minSize)
    Grow both arrays to ensure that they can store at least the given number of entries. Existing content may be discarded.

  - ### grow

    public void grow(int minSize)
    Grow both arrays to ensure that they can store at least the given number of entries. Existing content is preserved.

  - ### copyFrom

    public void copyFrom(DocAndFloatFeatureBuffer buffer)
    Copy content from the given `DocAndFloatFeatureBuffer`, expanding float scores to doubles.