cds.gui
Class CSVTableModel

java.lang.Object
  extended byjavax.swing.table.AbstractTableModel
      extended bycds.gui.CSVTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

public class CSVTableModel
extends javax.swing.table.AbstractTableModel

JTable table model based on a CSV (Character Separated Value) file

Version:
1.0 Dec 2003
Author:
Alexander Schatten (T.U. Wien), Marc Wenger/CDS
See Also:
Serialized Form

Field Summary
private  int cCols
           
private  java.lang.String[] colNames
           
private  int[] colSizes
           
private  int cRows
           
private  java.lang.String[][] data
           
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
CSVTableModel(java.lang.String filename, java.lang.String sep)
          Constructor.
 
Method Summary
 int getColumnCount()
           
 java.lang.String getColumnName(int i)
           
 int getColumnSize(int i)
           
 int getRowCount()
           
 java.lang.Object getValueAt(int row, int col)
           
private  void readData(java.lang.String filename, java.lang.String sep)
           
private  void setEmpty()
           
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cRows

private int cRows

cCols

private int cCols

colNames

private java.lang.String[] colNames

colSizes

private int[] colSizes

data

private java.lang.String[][] data
Constructor Detail

CSVTableModel

public CSVTableModel(java.lang.String filename,
                     java.lang.String sep)
Constructor.

Parameters:
filename - of a CSV file
sep - separator char
Method Detail

setEmpty

private void setEmpty()

readData

private void readData(java.lang.String filename,
                      java.lang.String sep)

getValueAt

public java.lang.Object getValueAt(int row,
                                   int col)

getColumnName

public java.lang.String getColumnName(int i)

getColumnSize

public int getColumnSize(int i)

getColumnCount

public int getColumnCount()

getRowCount

public int getRowCount()