Make your own free website on Tripod.com

suncertify.swingClient.swingTable
Class ReserTableModel

java.lang.Object
  |
  +--javax.swing.table.AbstractTableModel
        |
        +--suncertify.swingClient.swingTable.ReserTableModel

public class ReserTableModel
extends javax.swing.table.AbstractTableModel

The ReserTableModel is the Table Model For Flights Reservation Details. The Table Model has the following features:

Version:
1.0 07/28/99
See Also:
Serialized Form

Field Summary
static int NUM_COLUMNS
          The number of columns in tables with this model.
static int START_NUM_ROWS
          The starting number of rows in tables of this model.
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
ReserTableModel()
          The class constructor instantiates a dynamic vector object to represent rows of the table.
 
Method Summary
 void clear()
          The method to clear all the contents of the table.
 void displayQueryResult(java.lang.String[][] rows)
          The function clears the current rows of the table and inserts new rows that are fetched by the query.
 void displayRow(int index)
          Display to the StandardOutputStream the values of the columns in the specified row.
 java.lang.Class getColumnClass(int c)
          Allows column renderers to display values based on the classType of the Column Values.
 int getColumnCount()
          The method to get the number of columns.
 java.lang.String getColumnName(int column)
          The method to return the name of a column of the table model.
 java.lang.String[] getRow(int index)
          The method to get the values of a row.
 int getRowCount()
          The method to get the current number of rows in the table.
 java.lang.Object getValueAt(int rownum, int column)
          Get the value of a cell in the table.
 boolean isCellEditable(int row, int column)
          The method to determine whether a cell is editable or not.
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, removeTableModelListener, setValueAt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NUM_COLUMNS

public static int NUM_COLUMNS
The number of columns in tables with this model.

START_NUM_ROWS

public static int START_NUM_ROWS
The starting number of rows in tables of this model.
Constructor Detail

ReserTableModel

public ReserTableModel()
The class constructor instantiates a dynamic vector object to represent rows of the table.
Method Detail

getColumnName

public java.lang.String getColumnName(int column)
The method to return the name of a column of the table model.
Overrides:
getColumnName in class javax.swing.table.AbstractTableModel
Parameters:
column: - The column number for which the name is to be calculated
Returns:
String : The name of the column

getColumnCount

public int getColumnCount()
The method to get the number of columns.
Overrides:
getColumnCount in class javax.swing.table.AbstractTableModel
Returns:
int : The number of columns for tables of this model type.

getRowCount

public int getRowCount()
The method to get the current number of rows in the table.
Overrides:
getRowCount in class javax.swing.table.AbstractTableModel
Returns:
int : The number of rows in the table

getValueAt

public java.lang.Object getValueAt(int rownum,
                                   int column)
Get the value of a cell in the table.
Overrides:
getValueAt in class javax.swing.table.AbstractTableModel
Parameters:
rowNum: - The row number of the cell
column - : The column of the cell
Returns:
Object : The Object that represent the cell value

displayQueryResult

public void displayQueryResult(java.lang.String[][] rows)
                        throws TableException
The function clears the current rows of the table and inserts new rows that are fetched by the query. This rows represents the details of flights that meet the clients requirements.
Parameters:
qryResult - -- This is a array of ReserTableRow and represents flights details.

clear

public void clear()
The method to clear all the contents of the table.

isCellEditable

public boolean isCellEditable(int row,
                              int column)
The method to determine whether a cell is editable or not.
Overrides:
isCellEditable in class javax.swing.table.AbstractTableModel
Parameters:
row - : The row number of the cell.
column - : The Column of the cell.
Returns:
boolen : true (editable), false (non-editable)

getColumnClass

public java.lang.Class getColumnClass(int c)
Allows column renderers to display values based on the classType of the Column Values.
Overrides:
getColumnClass in class javax.swing.table.AbstractTableModel
Parameters:
c: - The column number
Returns:
Class : The name of the class type of the column

displayRow

public void displayRow(int index)
                throws TableException
Display to the StandardOutputStream the values of the columns in the specified row.
Parameters:
index - - the row index.
Throws:
TableException - - If the Specified Index does not correspond to a row in the table.

getRow

public java.lang.String[] getRow(int index)
                          throws TableException
The method to get the values of a row.
Parameters:
index - : The row index
Returns:
String[] : The values of the cells of the row
Throws:
TableException - : If the index is out of bounds