public class CSVTableModel extends AbstractTableModel implements FilteredTableModel
listenerList| Constructor and Description |
|---|
CSVTableModel()
Create an empty table model (no rows, no columns).
|
CSVTableModel(InputStream pCSVData,
boolean pFirstRowIsHeader,
String pCSVSeparator,
String pEncoding)
Create a new table model by parsing the input stream as CSV data.
|
CSVTableModel(Reader pCSVData,
boolean pFirstRowIsHeader,
String pCSVSeparator)
Create a new table model by parsing the CSV data from the input reader.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
filter(String pFilterExpression)
Filter the data with the handed regular expression.
|
void |
filterReset()
Reset any filtering.
|
int |
getAllRowsCount()
Return the number of all rows, including those that are currently
filtered.
|
int |
getColumnCount() |
String |
getColumnName(int pColumnIndex) |
int |
getRowCount() |
Object |
getValueAt(int pRowIndex,
int pColumnIndex) |
void |
setFirstRowIsHeader(boolean pFirstRowIsHeader)
Sets if the first data row is treated as header information.
|
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAtclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddTableModelListener, getColumnClass, isCellEditable, removeTableModelListener, setValueAtpublic CSVTableModel()
public CSVTableModel(InputStream pCSVData, boolean pFirstRowIsHeader, String pCSVSeparator, String pEncoding) throws IOException
pCSVData - the input we read our data from, may be nullpFirstRowIsHeader - true if the first row contains the headerpCSVSeparator - "comma" separator, may be null (then "," is taken)pEncoding - the encoding pf pCSVData, may be null if pCSVData is nullIOException - if we have IO problemspublic CSVTableModel(Reader pCSVData, boolean pFirstRowIsHeader, String pCSVSeparator) throws IOException
pCSVData - the reader we read the CSV data from, may be nullpFirstRowIsHeader - true if the first row contains the headerpCSVSeparator - "comma" separator, may be nullIOException - if we have IO problemspublic int getRowCount()
getRowCount in interface TableModelpublic int getAllRowsCount()
FilteredTableModelgetAllRowsCount in interface FilteredTableModelpublic int getColumnCount()
getColumnCount in interface TableModelpublic Object getValueAt(int pRowIndex, int pColumnIndex)
getValueAt in interface TableModelpublic String getColumnName(int pColumnIndex)
getColumnName in interface TableModelgetColumnName in class AbstractTableModelpublic boolean filter(String pFilterExpression)
FilteredTableModelfilter in interface FilteredTableModelpFilterExpression - the regular expression we should filter our rows withpublic void filterReset()
FilteredTableModelfilterReset in interface FilteredTableModelpublic void setFirstRowIsHeader(boolean pFirstRowIsHeader)
FilteredTableModelsetFirstRowIsHeader in interface FilteredTableModelpFirstRowIsHeader - true if we should handle the first data row as
table headerCopyright © 2013–2024 Jürgen Zeller (privat). All rights reserved.