edu.wpi.cs.DSRG.xmldb.Utils
Class Table

java.lang.Object
  |
  +--edu.wpi.cs.DSRG.xmldb.Utils.Table

public class Table
extends java.lang.Object

Implement a Table that can be created from a ResultSet.


Field Summary
(package private)  java.util.Hashtable columns
          It is used to remember the columns.
(package private)  int size
          The size of the table.
 
Constructor Summary
Table(java.sql.ResultSet rs)
          Create the table from a resultset.
 
Method Summary
 int findRowNum(java.lang.String column_name, java.lang.String value)
          Sequential Searching for a specific value on a specific column.
 java.lang.String getString(int row_no, java.lang.String column_name)
          Get a specific cell.
 int size()
          return the size of the table.
 java.lang.String toString()
          Dump the table out.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

columns

java.util.Hashtable columns
It is used to remember the columns. It's a hashtable. Everyelement will be a vector of values of that type of column

size

int size
The size of the table.
Constructor Detail

Table

public Table(java.sql.ResultSet rs)
Create the table from a resultset.
Method Detail

getString

public java.lang.String getString(int row_no,
                                  java.lang.String column_name)
Get a specific cell.

size

public int size()
return the size of the table.

toString

public java.lang.String toString()
Dump the table out.
Overrides:
toString in class java.lang.Object

findRowNum

public int findRowNum(java.lang.String column_name,
                      java.lang.String value)
Sequential Searching for a specific value on a specific column.
Returns:
-1 means error or not found.