Record Class CellValue.Array

java.lang.Object
java.lang.Record
io.keikai.axyra.sheets.CellValue.Array
All Implemented Interfaces:
CellValue
Enclosing interface:
CellValue

public static record CellValue.Array(CellValue[][] rows) extends Record implements CellValue
A rectangular, row-major matrix of scalar values (rows[r][c]).

Produced for a range (area) argument handed to a TypedUserFunction: the engine evaluates an area reference to a two-dimensional array of its cell values, and that shape crosses the bridge as-is. A typed UDF may also return one to produce an array result. Elements are always scalar variants (never nested Array); a single cell cannot hold an array, so this variant is rejected when writing cell values.

Unlike the scalar record variants, equality is by matrix content (Arrays.deepEquals), not array identity.

  • Constructor Details

    • Array

      public Array(CellValue[][] rows)
      Creates an instance of a Array record class.
      Parameters:
      rows - the value for the rows record component
  • Method Details

    • rowCount

      public int rowCount()
      Number of rows.
    • colCount

      public int colCount()
      Number of columns (0 for an empty matrix).
    • get

      public CellValue get(int row, int col)
      The value at (row, col), 0-based.
    • equals

      public boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • hashCode

      public int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • toString

      public String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • rows

      public CellValue[][] rows()
      Returns the value of the rows record component.
      Returns:
      the value of the rows record component