public abstract interface Query |
Interface to a query used or created by a custom tag. A query contains tabular data organized by named columns and rows.
Returns |
Method |
Description |
|---|---|---|
int |
addRow()(in CCFXQuery class) |
Adds a row to the query |
int |
getColumnIndex(String name) |
Gets the index of a column given its name |
String[] |
Gets a list of the column names in a query |
|
String |
getData(int iRow, int iCol) |
Gets a data element from a row and column of a query |
String |
getName() |
Gets the name of a query |
int |
Gets the number of rows in a query |
|
void |
setData(int iRow, int iCol, String data) |
Sets a data element in a row and column of a query |
Adds a row to a query. Call this method to append a row to a query. Returns the index of the row that was appended to the query.
public int addRow() |
The following example demonstrates the addition of two rows to a query that has three columns, City, State, and Zip:
// Define column indexes |
Returns the index of the column, or 0 if no such column exists.
public int getColumnIndex(String name) |
Parameter |
Description |
|---|---|
name |
Name of column to get index of (lookup is case-insensitive) |
The following example retrieves the index of the EMAIL column and uses it to output a list of the addresses contained in the column:
// Get the index of the EMAIL column |
Returns an array of strings containing the names of the columns in the query.
public String[] getColumns() |
The following example retrieves the array of columns, then iterates over the list, writing each column name back to the user:
// Get the list of columns from the query |
Retrieves a data element from a row and column of a query. Row and column indexes begin with 1. You can find the number of rows in a query by calling getRowCount. You can find the number of columns in a query by calling getColumns. Returns the value of the requested data element.
public String getData(int iRow, int iCol) |
IndexOutOfBoundsException if an invalid index is passed to the method.
setData, addRow
Parameter |
Description |
|---|---|
iRow |
Row to retrieve data from (1-based) |
iCol |
Column to retrieve data from (1-based) |
The following example iterates over the rows of a query and writes the data back to the user in a simple, space-delimited format:
int iRow, iCol ; |
Returns the name of a query.
public String getName() |
The following example retrieves the name of a query and writes it back to the user:
Query query = request.getQuery() ; |
Retrieves the number of rows in a query. Returns the number of rows contained in a query.
public int getRowCount()
The following example retrieves the number of rows in a query and writes it back to the user:
Query query = request.getQuery() ; |
Sets a data element in a row and column of a query. Row and column indexes begin with 1. Before calling setData for a given row, call addRow and use the return value as the row index for your call to setData.
public void setData(int iRow, int iCol, String data) |
IndexOutOfBoundsException if an invalid index is passed to the method.
getData, addRow
Parameter |
Description |
|---|---|
iRow |
Row of data element to set (1-based) |
iCol |
Column of data element to set (1-based) |
data |
New value for data element |
The following example demonstrates the addition of two rows to a query that has three columns, City, State, and Zip:
// Define column indexes |
Sign in to your account