Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.hsqldb.util
Class GridSwing  view GridSwing download GridSwing.java

java.lang.Object
  extended byjavax.swing.table.AbstractTableModel
      extended byorg.hsqldb.util.GridSwing
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

class GridSwing
extends javax.swing.table.AbstractTableModel

Simple table model to represent a grid of tuples.

Version:
1.7.0

Field Summary
(package private)  java.lang.String[] headers
           
(package private)  java.util.Vector rows
           
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
GridSwing()
          Default constructor.
 
Method Summary
 void addRow(java.lang.String[] r)
          Append a tuple to the end of the table.
 void clear()
          Remove data from all cells in the table (without affecting the current headings).
 int getColumnCount()
          Get the number of columns.
 java.lang.String getColumnName(int i)
          Get the name for the specified column.
 java.util.Vector getData()
          Get the current table data.
 java.lang.String[] getHead()
          Get the current column headings.
 int getRowCount()
          Get the number of rows currently in the table.
 java.lang.Object getValueAt(int row, int col)
          Get the object at the specified cell location.
 void setHead(java.lang.String[] h)
          Set the name of the column headings.
 
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

headers

java.lang.String[] headers

rows

java.util.Vector rows
Constructor Detail

GridSwing

public GridSwing()
Default constructor.

Method Detail

getColumnName

public java.lang.String getColumnName(int i)
Get the name for the specified column.


getColumnCount

public int getColumnCount()
Get the number of columns.


getRowCount

public int getRowCount()
Get the number of rows currently in the table.


getHead

public java.lang.String[] getHead()
Get the current column headings.


getData

public java.util.Vector getData()
Get the current table data. Each row is represented as a String[] with a single non-null value in the 0-relative column position.

The first row is at offset 0, the nth row at offset n etc.


getValueAt

public java.lang.Object getValueAt(int row,
                                   int col)
Get the object at the specified cell location.


setHead

public void setHead(java.lang.String[] h)
Set the name of the column headings.


addRow

public void addRow(java.lang.String[] r)
Append a tuple to the end of the table.


clear

public void clear()
Remove data from all cells in the table (without affecting the current headings).