Package persistence
Class DBRecordTable
java.lang.Object
javax.swing.table.AbstractTableModel
persistence.DBRecordTable
- All Implemented Interfaces:
Serializable
,TableModel
Implementation of DBRecordTable class, which converts an ArrayList of DBRecords to a TableModel.
- See Also:
-
Field Summary
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
-
Constructor Summary
ConstructorsConstructorDescriptionDBRecordTable
(ArrayList<DBRecord> records) Constructs a new TableModel from the passed records. -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the count of columns in the table.getColumnName
(int i) Returns the table's column name at the passed column index.int
Returns the count of rows in the table.getValueAt
(int r, int c) Returns a value from the DBRecords at the passed row and column indexes.Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
-
Constructor Details
-
DBRecordTable
Constructs a new TableModel from the passed records.- Parameters:
records
- the ArrayList containing the records
-
-
Method Details
-
getRowCount
public int getRowCount()Returns the count of rows in the table.- Returns:
- the count of rows in the table
-
getColumnCount
public int getColumnCount()Returns the count of columns in the table.- Returns:
- the count of columns in the table
-
getValueAt
Returns a value from the DBRecords at the passed row and column indexes.- Parameters:
r
- the row's indexc
- the col's index- Returns:
- the value at the given indexes
-
getColumnName
Returns the table's column name at the passed column index.- Specified by:
getColumnName
in interfaceTableModel
- Overrides:
getColumnName
in classAbstractTableModel
- Parameters:
i
- the column's index- Returns:
- the table's column name at the passed column index
-