|
SilverStream Application Server 3.5 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Abstraction of a data row for insert/update/delete purposes. Within a data source triggered business object, will
normally hold the row's data, plus some identifying information.
This is part of the low-level API for accessing row-based data sources;
see AgiDataSource
for details.
A user-written data source will not need to implement its own AgiDataRow object. Instead, the data source is supplied with an AgiDataRowFactory during its initialization, and it must use the supplied AgiDataRowFactory to construct any data rows that it returns.
Method Summary | |
AgiBandDescriptor |
getBandDescriptor()
Get a "band description" for this row, describing the contents of the row and its columns. |
Object |
getData(int colid)
Get the contents of the specified column as an Object. |
int |
getPresentColumnCount()
Return the number of columns present (i.e. |
String |
getRowKey()
Get the row key for the specified row. |
boolean |
isColumnPresent(int colid)
Returns true if the specified column has data. |
boolean |
rowKeyMatch(String rowKey)
Return true if the row key matches the specified key. |
void |
setData(int colid,
Object data)
Set the contents of the specified column. |
Method Detail |
public AgiBandDescriptor getBandDescriptor()
To print the column names of all the columns of a given AgiDataRow:
AgiDataRow row; AgiBandDescriptor desc = row.getBandDescriptor(); for (int col = 0; col < desc.getColumnCount(); col++) { System.out.println("Column " + col + " name is " + desc.getColumnName(col)); }
public int getPresentColumnCount()
Get the number of columns having data in the row.
AgiDataRow row; int presentColCount = row.getPresentColumnCount();
public boolean isColumnPresent(int colid)
colid
- Column number within the row (0-based).This is used to determine whether the user supplied data for a row.
Print an indication of whether each column in the row is present
AgiDataRow row; int colCount = row.getBandDescriptor().getColumnCount(); for (int i = 0; i < colCount; i++) { if (row.isColumnPresent(i)) System.out.println("Column " + i + " has data"); else System.out.println("Column " + i + " does not have data"); }
AgoDataUpdateRow.m_updateRow
public Object getData(int colid)
colid
- Column number within the row (0-based).AgiDataRow row; for (int i = 0; i < row.getBandDescriptor().getColumnCount(); i++) { Object value = row.getData(i); System.out.println("The value of column " + i + " is " + value); }
public void setData(int colid, Object data)
colid
- column number within the row (0-based)data
- the data to setAgiDataRow row; row.setData(0, new Integer(10)); row.setData(1, "A fine kettle of fish");
public String getRowKey()
AgiDataRow row; String rowKey = row.getRowKey();
public boolean rowKeyMatch(String rowKey)
rowKey
- The row key to be matchedAgiDataRow[] rows; String matchKey; for (int i = 0; i < rows.length; i++) { AgiDataRow row = rows[i]; if (rows[i].rowKeyMatch(matchKey)) return rows[i]; } System.out.println("No rows match row key " + matchKey);
|
SilverStream Application Server 3.5 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |