Record Class PivotField

java.lang.Object
java.lang.Record
io.keikai.axyra.sheets.PivotField
Record Components:
name - the source column name
sourceIndex - the 0-based source column index in the pivot cache; for a calculated field in the values area, sourceFields().size() plus its position in PivotTableView.calculatedFields()
aggregation - the aggregate function (data fields; null for row / column / filter fields)
customName - the explicit caption override, or null when the default caption applies. For data fields this is dataField@name (ECMA-376 Part 1 §18.10.1.18); for row / column / filter fields it is the pivotField@name display rename (§18.10.1.69, set via PivotTableView.setRowFieldCaption(int, java.lang.String))
displayName - the resolved caption — customName when set, otherwise the "Sum of Sales"-style default for data fields, or name for row / column / filter fields
showSubtotals - whether subtotals are shown for this field (ECMA-376 Part 1 §18.10.1.69 defaultSubtotal); always true for values-area fields

public record PivotField(String name, int sourceIndex, AggregateFunction aggregation, String customName, String displayName, boolean showSubtotals) extends Record
One placed pivot field, as returned by the PivotTableView area read-backs (rowFields(), columnFields(), dataFields(), filterFields()). A value, not a live view: it does not follow later changes to the pivot.
  • Constructor Details

    • PivotField

      public PivotField(String name, int sourceIndex, AggregateFunction aggregation, String customName, String displayName, boolean showSubtotals)
      Creates an instance of a PivotField record class.
      Parameters:
      name - the value for the name record component
      sourceIndex - the value for the sourceIndex record component
      aggregation - the value for the aggregation record component
      customName - the value for the customName record component
      displayName - the value for the displayName record component
      showSubtotals - the value for the showSubtotals record component
  • Method Details

    • toString

      public final 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
    • hashCode

      public final 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
    • equals

      public final 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • sourceIndex

      public int sourceIndex()
      Returns the value of the sourceIndex record component.
      Returns:
      the value of the sourceIndex record component
    • aggregation

      public AggregateFunction aggregation()
      Returns the value of the aggregation record component.
      Returns:
      the value of the aggregation record component
    • customName

      public String customName()
      Returns the value of the customName record component.
      Returns:
      the value of the customName record component
    • displayName

      public String displayName()
      Returns the value of the displayName record component.
      Returns:
      the value of the displayName record component
    • showSubtotals

      public boolean showSubtotals()
      Returns the value of the showSubtotals record component.
      Returns:
      the value of the showSubtotals record component