Home » openjdk-7 » net.sourceforge » jbird » table » [javadoc | source]
net.sourceforge.jbird.table
public class: ClassyTableModel [javadoc | source]
java.lang.Object
   javax.swing.table.AbstractTableModel
      net.sourceforge.jbird.table.ClassyTableModel

All Implemented Interfaces:
    Nullify, TableModel, Serializable

A table model class that provides basic support for Object[][] data but also reports classes of columns to be what they are rather than simply Object as reported by DataModel.

The model is not editable by default, but editing can be toggled using the setModelEditable method.

Field Summary
protected  Class[] classes     
protected  String[] col_names     
protected  Object[][] data     
protected  boolean editable     
 int nrows     
 int ncols     
Fields inherited from javax.swing.table.AbstractTableModel:
listenerList
Constructor:
 public ClassyTableModel(Object[][] data,
    String[] col_names) 
Method from net.sourceforge.jbird.table.ClassyTableModel Summary:
gatherColumnClasses,   getClassCategory,   getColumnClass,   getColumnCount,   getColumnName,   getRowCount,   getValueAt,   isCellEditable,   isModelEditable,   nullify,   replaceNulls,   replaceNulls,   searchForClass,   setModelEditable,   setValueAt
Methods from javax.swing.table.AbstractTableModel:
addTableModelListener,   findColumn,   fireTableCellUpdated,   fireTableChanged,   fireTableDataChanged,   fireTableRowsDeleted,   fireTableRowsInserted,   fireTableRowsUpdated,   fireTableStructureChanged,   getColumnClass,   getColumnName,   getListeners,   getTableModelListeners,   isCellEditable,   removeTableModelListener,   setValueAt
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from net.sourceforge.jbird.table.ClassyTableModel Detail:
 protected final  void gatherColumnClasses(Object[] arow) 
 protected final Class getClassCategory(Object o) 
    Return Number.class for any numeric class and the self-reported class for all others.
 public Class getColumnClass(int columnindex) 
 public int getColumnCount() 
 public String getColumnName(int columnindex) 
 public int getRowCount() 
 public Object getValueAt(int rowindex,
    int colindex) 
 public boolean isCellEditable(int rowindex,
    int colindex) 
 public final boolean isModelEditable() 
 public  void nullify() 
 public final  void replaceNulls() 
    Replaces null values for Strings, Numbers, and Boolean.
    • Boolean -> new Boolean(false)
    • String -> ""
    • Number -> new Integer(0)
    Other classes will not be replaced.
 public final  void replaceNulls(int colidx,
    Object to) 
    Replace null values in a column with the object provided (not cloned).
 protected final Class searchForClass(int colidx) 
    Search a column for the first non-null entry and return its Class type. Returns null if no non-null entry is found.
 public final  void setModelEditable(boolean to) 
 public  void setValueAt(Object value,
    int rowindex,
    int colindex) 
    Requests are silently ignored if either the table is not editable or if the class of the value is incompatible with that of the requested column.