public class ObjectTableModel extends Object implements TableModel
Modifier and Type | Field and Description |
---|---|
protected List<List<Object>> |
data |
protected List<?> |
header |
Constructor and Description |
---|
ObjectTableModel()
Empty constructor.
|
ObjectTableModel(List<?> header)
Constructor with header.
|
ObjectTableModel(List<List<Object>> data,
List<?> header)
Constructor with data and header.
|
Modifier and Type | Method and Description |
---|---|
void |
addRow(List<?> row)
Add a row at the bottom of tablemodel.
|
void |
addTableModelListener(TableModelListener l)
This method does nothing.
|
Class<?> |
getColumnClass(int c)
Get the class of the column.
|
int |
getColumnCount()
Get the amount of colums of the tablemodel.
|
Object |
getColumnHeader(int c)
Returns the header at column c.
|
String |
getColumnName(int c)
Get the name of the Column.
|
List<List<Object>> |
getData() |
List<?> |
getHeader()
Return the header of the table model.
|
int |
getRowCount()
Get amount of rows in the tablemodel.
|
Object |
getValueAt(int r,
int c)
Returns the value for the cell at columnIndex and rowIndex.
|
boolean |
isCellEditable(int r,
int c)
This method returns always true.
|
void |
removeTableModelListener(TableModelListener l)
This method does nothing.
|
void |
setHeader(List<?> header)
Set the header of the table model.
|
void |
setValueAt(Object val,
int r,
int c)
Sets a cell value in the table model.
|
public ObjectTableModel()
public ObjectTableModel(List<?> header)
header
- public int getRowCount()
getRowCount
in interface TableModel
public int getColumnCount()
getColumnCount
in interface TableModel
public String getColumnName(int c)
getColumnName
in interface TableModel
c
- the column indexpublic Class<?> getColumnClass(int c)
getColumnClass
in interface TableModel
public boolean isCellEditable(int r, int c)
isCellEditable
in interface TableModel
public Object getValueAt(int r, int c)
getValueAt
in interface TableModel
r
- the row indexc
- the column indexpublic void setValueAt(Object val, int r, int c)
setValueAt
in interface TableModel
r
- the row indexc
- the column indexval
- the objectpublic void addTableModelListener(TableModelListener l)
addTableModelListener
in interface TableModel
public void removeTableModelListener(TableModelListener l)
removeTableModelListener
in interface TableModel
public void setHeader(List<?> header)
header
- a list of objectspublic void addRow(List<?> row)
row
- the new rowpublic Object getColumnHeader(int c)
c
- the column indexpublic List<?> getHeader()
@enterprise 10.0.39049 Copyright © 2024 FREQUENTIS AG. All Rights Reserved.