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

Package org.apache.lucene.document.column

# Class Column

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

Direct Known Subclasses:
  `BinaryColumn`, `DictionaryColumn`, `LongColumn`, `TokenStreamColumn`, `VectorColumn`

public abstract class Column extends Object
A single field's values across multiple documents in a `ColumnBatch`. A Column carries only metadata (name, field type, and density); iteration is performed via cursors obtained from `LongColumn`, `BinaryColumn`, or `VectorColumn`.

Each call that requests a cursor returns a fresh cursor positioned at the first value, so columns can be consumed multiple times (for example, once in the row-oriented pass for stored fields and again in the column-oriented pass for doc values).

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

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static enum`
  `Column.Density`
  Whether a column has a value for every document in the batch.

- ## Constructor Summary

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

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Column.Density`
  `density()`
  Returns the density of this column (whether every doc has a value).
  `IndexableFieldType`
  `fieldType()`
  Returns the field type describing how this field is indexed.
  `String`
  `name()`
  Returns the field name.

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

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

- ## Constructor Details

  - ### Column

    protected Column(String name, IndexableFieldType fieldType, Column.Density density)
    Creates a Column with the given field name, type, and density.
    Parameters:
      `name` - the field name
      `fieldType` - describes how this field should be indexed
      `density` - whether this column has a value for every document in the batch

- ## Method Details

  - ### name

    public String name()
    Returns the field name.

  - ### fieldType

    public IndexableFieldType fieldType()
    Returns the field type describing how this field is indexed.

  - ### density

    public Column.Density density()
    Returns the density of this column (whether every doc has a value).