Class CSVTableModel
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- org.pentaho.reporting.engine.classic.core.modules.misc.tablemodel.CSVTableModel
-
- All Implemented Interfaces:
Serializable
,TableModel
public class CSVTableModel extends AbstractTableModel
TableModel
used by theCSVTableModelProducer
class. It has a feature which generates the column name if it is not know.- Author:
- Mimil
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
-
-
Constructor Summary
Constructors Constructor Description CSVTableModel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getColumnCount()
Counts columns of thisTableModel
.String
getColumnName(int column)
Return the column name at a specified position.String[]
getColumnNames()
Object[][]
getData()
int
getMaxColumnCount()
int
getRowCount()
Counts rows of thisTableModel
.Object
getValueAt(int rowIndex, int columnIndex)
Gets the Object at specified row and column positions.void
setColumnNames(String[] columnNames)
void
setData(Object[][] data)
void
setMaxColumnCount(int maxColumnCount)
Sets the maximum column count if it is bigger than the current one.-
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
-
-
-
-
Method Detail
-
getData
public Object[][] getData()
-
setData
public void setData(Object[][] data)
-
getColumnNames
public String[] getColumnNames()
-
setColumnNames
public void setColumnNames(String[] columnNames)
-
getColumnCount
public int getColumnCount()
Counts columns of thisTableModel
.- Returns:
- the column count
-
getRowCount
public int getRowCount()
Counts rows of thisTableModel
.- Returns:
- the row count
-
getValueAt
public Object getValueAt(int rowIndex, int columnIndex)
Gets the Object at specified row and column positions.- Parameters:
rowIndex
- row indexcolumnIndex
- column index- Returns:
- The requested Object
-
setMaxColumnCount
public void setMaxColumnCount(int maxColumnCount)
Sets the maximum column count if it is bigger than the current one.- Parameters:
maxColumnCount
-
-
getMaxColumnCount
public int getMaxColumnCount()
-
getColumnName
public String getColumnName(int column)
Return the column name at a specified position.- Specified by:
getColumnName
in interfaceTableModel
- Overrides:
getColumnName
in classAbstractTableModel
- Parameters:
column
- column index- Returns:
- the column name
-
-