Package ca.spatial.table
Class AppendStore
java.lang.Object
javax.swing.table.AbstractTableModel
ca.spatial.table.AttributeStore
ca.spatial.table.AppendStore
- All Implemented Interfaces:
PopupActivationListener
,Serializable
,Comparable
,EventListener
,ListSelectionListener
,TableModel
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
-
Field Summary
Fields inherited from class ca.spatial.table.AttributeStore
SELECT_ADD, SELECT_FROM, SELECT_NEW
-
Constructor Summary
ConstructorsConstructorDescriptionAppendStore(AttributeStore[] stores, String[] reselects, int[] periods, AppendColumnSpec[] columnSpecs)
Construct the appending data store from a series of stores. -
Method Summary
Modifier and TypeMethodDescriptionint
Get the total number of periods that this store supportsint
Get the number of rows in this storegetSnapshot(boolean useSelected)
Get a snapshot of this append definition.getSnapshot(boolean useSelected, Observer progress)
Get a snapshot of this append definition.int[]
Get the list of periods to retrieve data from the tablesString[]
Get the list of the reselect expression used to filter the input dataGet the list of the input tables that are being appendedgetValueAt(int row, int column, int period)
Get a cell valueint
getYearForPeriod(int period)
Get the ending year for a given period.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.Methods inherited from class ca.spatial.table.AttributeStore
absoluteFile, absoluteFile, absolutePath, absolutePath, addCellEditors, addMenuItems, addPopupActivationListener, addRelate, addRelate, addTableModelListener, addToGlobalStoreList, allowsEditing, booleanValue, booleanValue, buildIndex, calculate, calculateField, calculateField, canIndex, changeSelection, clearSelection, close, compareTo, decodeCharset, doubleValue, doubleValue, exportCSV, exportCSV, exportCSV, exportCSV, exportCSV, exportCSV, exportDBF, exportDBF, exportDBF, exportDBF, exportDBF, findColumn, findColumn, findSimilarColumnNames, getAttributeFormat, getCacheParent, getCachingLayer, getCachingLayer, getCanonicalName, getColumnClass, getColumnCount, getColumnName, getColumnNames, getContextPeriods, getCwd, getEditMode, getFullColumnName, getListSelectionModel, getMinMax, getMinMax, getMinMax, getMinMax, getMinMax, getOpenStore, getOpenStore, getOpenStore, getOpenStores, getPeriod, getPeriodWidth, getRowNodeRemap, getSelectedRowCount, getSelection, getSelection, getSelection, getShortName, getStoreByShortName, getStoreByTitle, getSynchronizer, getTableName, getTableSpec, getTitle, getValueAt, hasIndex, identifyRecords, integerValue, integerValue, isCellEditable, isSelectedIndex, isSelectionEmpty, listify, listValue, listValue, lookupRow, makeLu, maybePopup, notifyPopupActivationListeners, openOrReuse, openOrReuse, queryTable, queryTable, quoteIfRequired, relativePath, removeFromGlobalStoreList, removePopupActivationListener, removeTableModelListener, select, select, selectAdd, selectFrom, selectNew, setCwd, setCwd, setEditMode, setListSelectionModel, setPeriod, setRowNodeRemap, setShortName, setTableSpec, setTitle, setValueAt, showCube, showTable, toString, uniqueValues, uniqueValues, uniqueValues, uniqueValues, uniqueValues, uniqueValues, uniqueValues, uniqueValues, valueChanged
Methods inherited from class javax.swing.table.AbstractTableModel
fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners
-
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
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 classAttributeStore
- 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
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 classAttributeStore
- 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
Get the list of the input tables that are being appended -
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 interfaceTableModel
- Specified by:
getRowCount
in classAttributeStore
- 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 classAttributeStore
- 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 classAttributeStore
- Parameters:
period
- The period of interest- Returns:
- the year for a given period
-
getValueAt
Description copied from class:AttributeStore
Get a cell value- Specified by:
getValueAt
in classAttributeStore
- Parameters:
row
- The row containing the cellcolumn
- The column containing the cellperiod
- The period of interest- Returns:
- An object containing the cell value.
-
setValueAt
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 classAttributeStore
- Parameters:
object
- The value to be set.row
- The row containing the cellcolumn
- The column containing the cellperiod
- The period of interest
-