Interface CellValue

All Known Implementing Classes:
CellValue.Array, CellValue.Blank, CellValue.Bool, CellValue.Error, CellValue.Number, CellValue.Text

A single cell's value — a short-lived, immutable marshalling object.

CellValue instances are produced when reading a Range or Sheet.value(int, int) and consumed when writing. They are not persistent per-cell state (the engine remains the single source of truth), so they do not violate the "no object-per-cell" principle: a bulk read produces them in one pass from the primitive arrays that crossed JNI once.

A formula error (e.g. #DIV/0!) is data, carried by CellValue.Error — it is never thrown as an exception.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final record 
    A rectangular, row-major matrix of scalar values (rows[r][c]).
    static final record 
    The empty cell value.
    static final record 
    A boolean cell value.
    static final record 
    An error cell value, identified by its Excel ERROR.TYPE code (mirrors the engine's FormulaError::code).
    static final record 
    A numeric cell value.
    static final record 
    A text cell value.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final CellValue.Blank
    Shared singleton for empty cells.
    static final CellValue.Bool
    Shared singleton for FALSE.
    static final CellValue.Bool
    Shared singleton for TRUE.
  • Method Summary

    Static Methods
    Modifier and Type
    Method
    Description
    static CellValue
    array(CellValue[][] rows)
    A row-major matrix value (see CellValue.Array) — the shape of a range argument to a typed user-defined function, or of an array result returned from one.
    static CellValue
    The empty-cell singleton.
    static CellValue
    bool(boolean value)
    A boolean value (returns a cached singleton).
    static CellValue
    error(int code)
    An error value from its Excel ERROR.TYPE code (1–14).
    static String
    errorString(int code)
    Maps an Excel ERROR.TYPE code to its display string.
    static CellValue
    number(double value)
    A numeric value (Excel stores integers and decimals both as f64).
    static CellValue
    text(String value)
    A text value.
  • Field Details

    • BLANK

      static final CellValue.Blank BLANK
      Shared singleton for empty cells.
    • TRUE

      static final CellValue.Bool TRUE
      Shared singleton for TRUE.
    • FALSE

      static final CellValue.Bool FALSE
      Shared singleton for FALSE.
  • Method Details

    • number

      static CellValue number(double value)
      A numeric value (Excel stores integers and decimals both as f64).
    • text

      static CellValue text(String value)
      A text value.
    • bool

      static CellValue bool(boolean value)
      A boolean value (returns a cached singleton).
    • error

      static CellValue error(int code)
      An error value from its Excel ERROR.TYPE code (1–14).
    • blank

      static CellValue blank()
      The empty-cell singleton.
    • array

      static CellValue array(CellValue[][] rows)
      A row-major matrix value (see CellValue.Array) — the shape of a range argument to a typed user-defined function, or of an array result returned from one. Not writable to a single cell.
    • errorString

      static String errorString(int code)
      Maps an Excel ERROR.TYPE code to its display string. Mirror of the engine's FormulaError::from_code; unknown codes fall back to #VALUE!.