BinaryColumn (Lucene 10.5.0 core API)
Description: declaration: package: org.apache.lucene.document.column, class: BinaryColumn

Package org.apache.lucene.document.column

# Class BinaryColumn

java.lang.Object
org.apache.lucene.document.column.Column
org.apache.lucene.document.column.BinaryColumn

public abstract class BinaryColumn extends Column
A `Column` that provides variable-size binary values via a tuple cursor. Used for `BINARY`, `SORTED`, and `SORTED_SET` doc values, and for stored/indexed binary or text fields. Values fed to points are passed through unchanged, so callers are responsible for producing sort-encoded bytes of the correct total length.

Numeric doc values (`NUMERIC` / `SORTED_NUMERIC`) and 1-D numeric points (int / long / float / double) are fed by `LongColumn` instead.

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

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class org.apache.lucene.document.column.Column

  `Column.Density`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `BinaryColumn(String name, IndexableFieldType fieldType, Column.Density density)`
  Creates a BinaryColumn with the given field name, type, and density.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `StoredValue.Type`
  `storedType()`
  The `StoredValue.Type` to emit when this column is written to stored fields.
  `abstract ObjectTupleCursor<BytesRef>`
  `tuples()`
  Returns a fresh tuple cursor starting at the beginning of the batch.
  `BytesRefValuesCursor`
  `values()`
  Returns a fresh values cursor iterating dense binary values for doc-ids `[0, numDocs)`.

  ### Methods inherited from class org.apache.lucene.document.column.Column

  `density, fieldType, name`

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

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

- ## Constructor Details

  - ### BinaryColumn

    protected BinaryColumn(String name, IndexableFieldType fieldType, Column.Density density)
    Creates a BinaryColumn with the given field name, type, and density.

- ## Method Details

  - ### storedType

    public StoredValue.Type storedType()
    The `StoredValue.Type` to emit when this column is written to stored fields. The default is `StoredValue.Type.BINARY`. Only `StoredValue.Type.BINARY` and `StoredValue.Type.STRING` are supported; numeric stored types require `LongColumn`.

  - ### tuples

    public abstract ObjectTupleCursor<BytesRef> tuples()
    Returns a fresh tuple cursor starting at the beginning of the batch.

  - ### values

    public BytesRefValuesCursor values()
    Returns a fresh values cursor iterating dense binary values for doc-ids `[0, numDocs)`. Must be overridden when `Column.density()` is `DENSE`; the default implementation throws `UnsupportedOperationException` and is never called for `SPARSE` columns.