Interface PivotTable.PivotSnapshot

All Superinterfaces:
AutoCloseable, SafeCloseable
Enclosing interface:
PivotTable

public static interface PivotTable.PivotSnapshot extends SafeCloseable
A pivot snapshot contains three logical tables (represented as parallel definitions and chunks) that can be assembled into a view on the screen:
  1. Rows: The rows "table" contain the values of the row keys, their depth, and expanded state. The total column for each row is present in the rows table, with one chunk per output value.
  2. Columns: The columns "table" contain the values of the column keys, their depth, and expanded state. Similarly, the total for each column is present in the columns table, with one chunk per output value.
  3. Grand totals: There is one value column for each of the requested output values. Each value chunk has one element, for the grand total for that value.
  4. Values: There is one value column for each of the requested output values. Each value chunk has r * c elements. The first column is located in positions 0..r-1, the next column in r..2r-1, until the final column located in positions (c-1)*r..r*c-1.

The returned snapshot has allocated Chunks for the result. After completing processing, the caller must call SafeCloseable.close() on the snapshot to release these chunks.

  • Method Details

    • expandedRowSize

      long expandedRowSize()
      Returns:
      the total expanded data size (in rows) or an estimate thereof
    • expandedColumnSize

      long expandedColumnSize()
      Returns:
      the total expanded data size (in columns) or an estimate thereof
    • rowsDefinition

      @NotNull @NotNull ColumnDefinition<?>[] rowsDefinition()
      Get the definition for the row chunks in this snapshot. This may differ from the PivotTable's row definition, because the snapshot may not include all possible output columns.
      Returns:
      the definition of the rowsSnapshot chunks
    • columnsDefinition

      @NotNull @NotNull ColumnDefinition<?>[] columnsDefinition()
      Get the definition for the column chunks in this snapshot. This may differ from the PivotTable's column definition, because the snapshot may not include all possible output columns.
      Returns:
      the definition of the rowsSnapshot chunks
    • valuesDefinition

      @NotNull @NotNull ColumnDefinition<?>[] valuesDefinition()
      Get the definition for the value chunks in this snapshot. This may differ from the PivotTable's value definition, because the snapshot may not include all possible output columns.
      Returns:
      the definition of the valuesSnapshot and grandTotalsSnapshot chunks
    • rowsSnapshot

      @NotNull @NotNull WritableChunk<Values>[] rowsSnapshot()
      Returns:
      the chunks containing the row snapshot
    • columnsSnapshot

      @NotNull @NotNull WritableChunk<Values>[] columnsSnapshot()
      Returns:
      the chunks containing the columns snapshot
    • grandTotalsSnapshot

      @NotNull @NotNull WritableChunk<Values>[] grandTotalsSnapshot()
      Returns:
      the grand total values; using valuesDefinition()
    • valuesSnapshot

      @NotNull @NotNull WritableChunk<Values>[] valuesSnapshot()
      Returns:
      the chunks for the grid of values, stored in column major order