public class DataKeyTableModel
extends javax.swing.table.AbstractTableModel
DataKey
s to enhance type
checking and support conversion and smart data inserting. This code
determines how data actually is ordered for display. Only adding of rows
(containing one result) is supported.Constructor and Description |
---|
DataKeyTableModel(java.util.LinkedHashMap<DataKey,java.lang.Integer> colspec) |
Modifier and Type | Method and Description |
---|---|
void |
addRow(java.util.Map<DataKey,java.lang.Object> newValues)
Adds a row with new values.
|
int |
getColumnCount() |
java.lang.String |
getColumnName(int col) |
int |
getRowCount() |
java.lang.Object |
getValueAt(int row,
int col) |
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
public DataKeyTableModel(java.util.LinkedHashMap<DataKey,java.lang.Integer> colspec)
colspec
- a TreeMap
containing tuples [DataKey,Integer] that
specifies the columns for the table. The DataKey is the column
to show, the Integer is the maximum multiplicity of that
column. When a column multiplicity has been set to a value
>1, and a row is added that has a List
for that
DataKey
, then the list is expanded to separate
columns. All multiplicities must be ≥ 1.
The order of the DataKeys determines the order of the columns.public void addRow(java.util.Map<DataKey,java.lang.Object> newValues)
DataKey
K, and the
value for K in the given map is a List
, then the list is expanded
to separate columns.newValues
- a Map
with DataKeys and objects as values.public int getColumnCount()
public int getRowCount()
public java.lang.String getColumnName(int col)
getColumnName
in interface javax.swing.table.TableModel
getColumnName
in class javax.swing.table.AbstractTableModel
public java.lang.Object getValueAt(int row, int col)