Class AppendStore

All Implemented Interfaces:
PopupActivationListener, Serializable, Comparable, EventListener, ListSelectionListener, TableModel

public class AppendStore extends AttributeStore
This class appends several input tables together in to a single table. The transformation of data from the component tables to the output columns may be customized for each table.

See the AppendStoreBuilder class for a convenient was to provide the parameters to create an AppendStore.

This is a read-only data store: write operations throw exceptions.

When reselect expressions are used this table only supports one period, regardless of the number of periods in the input table. In this case each input table specifies the period of interest to be used.

When reselect statements are not used then this table supports multiple periods (data cube) so long as all tables being appended all contain multiple periods.

See Also:
AppendStoreBuilder, Serialized Form
  • Constructor Details

    • AppendStore

      public AppendStore(AttributeStore[] stores, String[] reselects, int[] periods, AppendColumnSpec[] columnSpecs)
      Construct the appending data store from a series of stores. If the columnSpecs field is null then use all of the columns from the first store in the list, and try to match all of the columns from the rest of the stores.
      Parameters:
      stores - A list of stores to append.
      reselects - A list of reselect expressions to use to choose records from the table. This parameter may be null in which case the resulting table will contain multiple periods. When reselects are specified there should be one expression for each input table.
      periods - A list of periods to evaluate each table at in which case this table will only show a single period. If periods is null then this table will contain multiple periods.
      columnSpecs - A list of columns to include in the output store, as well as a set of transformations for each of the stores. If this value is null then select all of the columns from the first store, and include all matching columns from the rest of the stores.
      See Also:
      AppendStoreBuilder
  • Method Details

    • getSnapshot

      public AttributeStore getSnapshot(boolean useSelected)
      Get a snapshot of this append definition. This will request snpashots of the input data stores, in case any of those are crosstabs. The results will be contained in the snapshot and will not change even if the underlying data set changes.
      Overrides:
      getSnapshot in class AttributeStore
      Parameters:
      useSelected - The calculations will only be computed on the selected records.
      Returns:
      This method will return a new shapshot that captures the state of the crosstab definition for the current data set.
    • getSnapshot

      public AttributeStore getSnapshot(boolean useSelected, Observer progress)
      Get a snapshot of this append definition. This will request snpashots of the input data stores, in case any of those are crosstabs. The results will be contained in the snapshot and will not change even if the underlying data set changes.
      Overrides:
      getSnapshot in class AttributeStore
      Parameters:
      useSelected - The calculations will only be computed on the selected records.
      progress - A reference to a progress widget that will be updated with the progress of the calculations.
      Returns:
      This method will return a new shapshot that captures the state of the append definition for the input current data sets.
    • getTables

      public AttributeStore[] getTables()
      Get the list of the input tables that are being appended
    • getTableReselects

      public String[] getTableReselects()
      Get the list of the reselect expression used to filter the input data
    • getTablePeriods

      public int[] getTablePeriods()
      Get the list of periods to retrieve data from the tables
    • getRowCount

      public int getRowCount()
      Description copied from class: AttributeStore
      Get the number of rows in this store
      Specified by:
      getRowCount in interface TableModel
      Specified by:
      getRowCount in class AttributeStore
      Returns:
      the number of rows in this store
    • getPeriodCount

      public int getPeriodCount()
      Description copied from class: AttributeStore
      Get the total number of periods that this store supports
      Specified by:
      getPeriodCount in class AttributeStore
      Returns:
      The number of periods in this store
    • getYearForPeriod

      public int getYearForPeriod(int period)
      Description copied from class: AttributeStore
      Get the ending year for a given period.
      Specified by:
      getYearForPeriod in class AttributeStore
      Parameters:
      period - The period of interest
      Returns:
      the year for a given period
    • getValueAt

      public Object getValueAt(int row, int column, int period)
      Description copied from class: AttributeStore
      Get a cell value
      Specified by:
      getValueAt in class AttributeStore
      Parameters:
      row - The row containing the cell
      column - The column containing the cell
      period - The period of interest
      Returns:
      An object containing the cell value.
    • setValueAt

      public void setValueAt(Object object, int row, int column, int period)
      This method is not supported in the AppendStore because it is not always possible to map backwards from expressions to original columns.
      Overrides:
      setValueAt in class AttributeStore
      Parameters:
      object - The value to be set.
      row - The row containing the cell
      column - The column containing the cell
      period - The period of interest