|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--ModSQL.LiteralTable
A literal table is a list of rows consisting of RowConstructor or Function objects.
| Field Summary | |
private int[] |
column_types
Type of each column in table. |
private int |
current_row
Index of current row (-1 for before first). |
private Object[] |
current_value
Value of current row (null for before first or after last). |
private int |
ncolumns
Number of columns in table. |
private Function[] |
rows
Array of rows after optimize(). |
private ArrayList |
rows_array
Array of rows before optimize() has been called. |
| Constructor Summary | |
LiteralTable()
Constructor. |
|
| Method Summary | |
void |
addRow(Function row)
Add a row to the table. |
void |
beforeFirst()
Reset the table to before the first row. |
int |
getColumnCount()
Returns the number of columns in the table. |
String |
getColumnName(int column)
Get the name of a column. |
int |
getMaxResultSize(int column)
Return the maximum number of characters String values in the specified column will have. |
Object |
getObject(int column)
Get the value of a column in the current row as a Java object. |
Object[] |
getRow()
Get the current row as an array of Objects. |
long |
getRowCount()
Return number of rows. |
int |
getSQLType(int column)
Return the SQL type of the specified column. |
boolean |
isConstant()
Determine if this table is constant. |
boolean |
next()
The table is initially positioned before its first row; the first call to next makes the first row the current row; the second call makes the second row the current row, etc. |
void |
optimize()
Prepare the table for use. |
void |
registerWith(Object o)
This method will pass the object on to all Function objects contained within. |
String |
toString()
String description of table in the form "(row1,row2,...)". |
String |
toString(boolean with_brackets)
Human readable description of table. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
private ArrayList rows_array
private Function[] rows
private int[] column_types
private int ncolumns
private int current_row
private Object[] current_value
| Constructor Detail |
public LiteralTable()
| Method Detail |
public void addRow(Function row)
throws SQLException
Add a row to the table. All rows of the table must have the same number of columns. If row is not of type RowConstructor, it is assumed to have exactly one column.
This method can only be called before optimize().
row - either a Function or RowConstructorSQLException - if an error occurs
public void registerWith(Object o)
throws SQLException
registerWith in interface Tableo - object to register withSQLException - if an error occurs
public void optimize()
throws SQLException
optimize in interface TableSQLException - if an error occurspublic String toString(boolean with_brackets)
toString in interface Tablewith_brackets - indicates whether the expression is bracketedpublic String toString()
toString in class Object
public boolean isConstant()
throws SQLException
Determine if this table is constant.
This method can only be called after optimize().
isConstant in interface TableSQLException - if an error occurspublic int getColumnCount()
Returns the number of columns in the table. This value will be greater than zero.
This method can only be called after optimize().
getColumnCount in interface Tablepublic long getRowCount()
Return number of rows.
This method can only be called after optimize().
getRowCount in interface Tablepublic String getColumnName(int column)
getColumnName in interface Tablecolumn - column number (starting from zero)public int getSQLType(int column)
getSQLType in interface Tablecolumn - column number (starting from zero)
public int getMaxResultSize(int column)
throws SQLException
getMaxResultSize in interface Tablecolumn - column number (starting from zero)SQLException - if an error occurspublic void beforeFirst()
beforeFirst in interface TableModSQL.TableSQLException - if an error occurspublic boolean next()
next in interface Table
public Object[] getRow()
throws SQLException,
EndOfTable
getRow in interface TableSQLException - if an error occursEndOfTable - if thrown when evaluating the row
public Object getObject(int column)
throws SQLException,
EndOfTable
getObject in interface Tablecolumn - column number (starting from zero)SQLException - if an error occursEndOfTable - if thrown when evaluating the row
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||