public class GenericTableModel extends AbstractTableModel
listenerList| Constructor and Description |
|---|
GenericTableModel()
Default constructor
|
| Modifier and Type | Method and Description |
|---|---|
<T,V> void |
addColumn(String name,
Class<? extends V> type,
Function<T,V> getter)
Add the specified column to this model
|
<T,V> void |
addColumn(String name,
Class<? extends V> type,
Function<T,V> getter,
BiConsumer<T,V> setter)
Add the specified column to this model
|
void |
addRow(Object element)
Add the given element as one row of the table
|
Class<?> |
getColumnClass(int c) |
int |
getColumnCount() |
String |
getColumnName(int c) |
int |
getRowCount() |
Object |
getValueAt(int r,
int c) |
void |
insertRow(int index,
Object element)
Add the given element as one row of the table
|
boolean |
isCellEditable(int r,
int c) |
void |
removeColumn(int index)
Remove the column at the given index
|
void |
removeRow(int index)
Remove the specified row from this model
|
void |
setValueAt(Object value,
int r,
int c) |
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListenerpublic <T,V> void addColumn(String name, Class<? extends V> type, Function<T,V> getter)
T - The row typeV - The value typename - The column nametype - The column typegetter - The getter for the column valuepublic <T,V> void addColumn(String name, Class<? extends V> type, Function<T,V> getter, BiConsumer<T,V> setter)
T - The row typeV - The value typename - The column nametype - The column typegetter - The getter for the column valuesetter - The optional setter for the column valuepublic void removeColumn(int index)
index - The indexpublic int getRowCount()
public int getColumnCount()
public String getColumnName(int c)
getColumnName in interface TableModelgetColumnName in class AbstractTableModelpublic Class<?> getColumnClass(int c)
getColumnClass in interface TableModelgetColumnClass in class AbstractTableModelpublic boolean isCellEditable(int r,
int c)
isCellEditable in interface TableModelisCellEditable in class AbstractTableModelpublic void addRow(Object element)
element - The elementpublic void insertRow(int index,
Object element)
index - The row indexelement - The elementpublic void removeRow(int index)
index - The row indexpublic void setValueAt(Object value, int r, int c)
setValueAt in interface TableModelsetValueAt in class AbstractTableModelpublic Object getValueAt(int r, int c)
Copyright © 2022. All rights reserved.