SilverStream
Application Server 3.5

com.sssw.rt.util
Interface AgiDataRowFactory


public interface AgiDataRowFactory

Abstraction of a data row factory. The factory is used by the low-level data source implementation for constructing data rows. This allows the client of the data source to hold its own per-row information in the data row. See AgiDataSource for details.


Method Summary
 AgiDataRow createDataRow(String rowKey)
          Create an empty data row.
 AgiDataRow createDataRow(String rowKey, Object[] values)
          Create a data row, given an array of row values of the appropriate type.
 

Method Detail

createDataRow

public AgiDataRow createDataRow(String rowKey)
Create an empty data row. The factory is assumed to know the band description for the row.
Parameters:
rowKey - An object used by the caller to identify the row
Returns:
An empty data row
Example:

Every object that implements AgiDataSource is initialized by its creator with a data row factory belonging to the creator, which is to be used by the AgiDataSource to create the rows it returns:

 AgiDataRowFactory m_rowFactory;
 
 ResultSet rs = statement.executeQuery();
 if (rs.next()) {
     AgiDataRow nextRow = m_rowFactory.createDataRow(null);
     for (int i = 0; i < columnCount; i++) {
         nextRow.setData(i, rs.getObject(i+1));
     }
 }
 

createDataRow

public AgiDataRow createDataRow(String rowKey,
                                Object[] values)
Create a data row, given an array of row values of the appropriate type. The factory is assumed to know the band description for the row.
Parameters:
rowKey - a string used by the caller to identify the row
values - initial values for each column of the row
Returns:
a data row initialized to the specified initial values
Example:

Every object that implements AgiDataSource is initialized by its creator with a data row factory belonging to the creator, which is to be used by the AgiDataSource to create the rows it returns:

 AgiDataRowFactory m_rowFactory;
 
 ResultSet rs = statement.executeQuery();
 if (rs.next()) {
 	Object[] values = new Object[columnCount];
     for (int i = 0; i < columnCount; i++) {
         values[i] = rs.getObject(i+1));
     }
     AgiDataRow nextRow = m_rowFactory.createDataRow(null, values);
 }
 

SilverStream
Application Server 3.5