All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.as400.util.servlet.RecordListRowData

java.lang.Object
   |
   +----com.ibm.as400.util.servlet.RowData
           |
           +----com.ibm.as400.util.servlet.RecordListRowData

public class RecordListRowData
extends RowData
implements Serializable
The RecordListRowData class represents a list of records.

A Record represents the data described by a RecordFormat. It can represent:

A RecordListRowData object maintains a position in the list that points to its current row of data. The initial position in the list is set before the first row. The next method moves to the next row in the list.

The getObject method is used to retrieve the column value for the current row indexed by the column number. Columns are numbered starting from 0.

The number, types, and properties of the list's columns are provided by the RecordFormatMetaData object returned by the getMetaData method.

RecordListRowData objects generate the following events:

The following example creates a RecordListRowData object and adds the records from a sequential file.

  

// Create an AS400 object. AS400 mySystem = new AS400("mySystem.myCompany.com");

// Create a file object that represents the file. SequentialFile sf = new SequentialFile(mySystem, ifspath);

// Set the record format of the file. sf.setRecordFormat();

// Get the records in the file. Record[] records = sf.readAll();

// Create a RecordListRowData object and add the records. RecordListRowData rowData = new RecordListRowData(); for (int i=0; i < records.length; i++) {

rowData.addRow(records[i]); }


Constructor Index

 o RecordListRowData()
Constructs a default RecordListRowData object.
 o RecordListRowData(RecordFormat)
Constructs a RecordListRowData object with the specified recordFormat.

Method Index

 o addRow(Record)
Adds the specified record to the end of the record list.
 o addRow(Record, int)
Adds the specified record to the record list at the specified rowIndex.
 o addRow(Record, int, Vector[])
Adds the specified record to the record list at the specified rowIndex.
 o addRow(Record, Vector[])
Adds the specified record to the end of the record list.
 o addRowDataListener(RowDataListener)
Adds a RowDataListener.
 o getMetaData()
Returns the metadata.
 o getObject(int)
Returns the current record's field at the specified columnIndex.
 o getRecordFormat()
Returns the record format.
 o getRow()
Returns the Record object for the current row.
 o removeRow(int)
Removes a record from the record list at the specified rowIndex.
 o removeRowDataListener(RowDataListener)
Removes this RowDataListener from the internal list.
 o setRecordFormat(RecordFormat)
Sets the record format for the record list.
 o setRow(Record, int)
Sets the record at the specified rowIndex to be the specified record.
 o setRow(Record, int, Vector[])
Sets the record at the specified rowIndex to be the specified record.

Constructors

 o RecordListRowData
 public RecordListRowData()
Constructs a default RecordListRowData object.

 o RecordListRowData
 public RecordListRowData(RecordFormat recordFormat)
Constructs a RecordListRowData object with the specified recordFormat.

Parameters:
recordFormat - The record format.

Methods

 o addRow
 public void addRow(Record record) throws RowDataException
Adds the specified record to the end of the record list.

Parameters:
record - The record to be added.
Throws: RowDataException
If a row data error occurs.
 o addRow
 public void addRow(Record record,
                    Vector properties[])
Adds the specified record to the end of the record list. Each field in the record is assigned the appropriate properties list specified by properties.

Parameters:
record - The record to be added.
properties - The properties list.
 o addRow
 public void addRow(Record record,
                    int rowIndex) throws RowDataException
Adds the specified record to the record list at the specified rowIndex.

Parameters:
record - The record to be added.
rowIndex - The rowIndex (0-based).
Throws: RowDataException
If a row data error occurs.
 o addRow
 public void addRow(Record record,
                    int rowIndex,
                    Vector properties[])
Adds the specified record to the record list at the specified rowIndex. Each field in the record is assigned the appropriate properties list specified by properties.

Parameters:
record - The record to be added.
rowIndex - The row index (0-based).
properties - The properties list.
 o addRowDataListener
 public void addRowDataListener(RowDataListener listener)
Adds a RowDataListener. The RowDataListener object is added to an internal list of row data listeners; it can be removed with removeRowDataListener.

Parameters:
listener - The RowDataListener.
 o getMetaData
 public RowMetaData getMetaData()
Returns the metadata.

Returns:
The metadata.
Overrides:
getMetaData in class RowData
 o getObject
 public Object getObject(int columnIndex) throws RowDataException
Returns the current record's field at the specified columnIndex.

Parameters:
columnIndex - The column index (0-based).
Returns:
The field object.
Throws: RowDataException
If a row data error occurs.
Overrides:
getObject in class RowData
 o getRecordFormat
 public RecordFormat getRecordFormat()
Returns the record format.

Returns:
The record format.
 o getRow
 public Record getRow()
Returns the Record object for the current row.

Returns:
The row.
 o removeRowDataListener
 public void removeRowDataListener(RowDataListener listener)
Removes this RowDataListener from the internal list. If the RowDataListener is not on the list, nothing is done.

Parameters:
listener - The RowDataListener.
 o removeRow
 public void removeRow(int rowIndex)
Removes a record from the record list at the specified rowIndex.

Parameters:
rowIndex - The row index (0-based).
 o setRow
 public void setRow(Record record,
                    int rowIndex)
Sets the record at the specified rowIndex to be the specified record.

Parameters:
record - The record.
rowIndex - The row index (0-based).
 o setRow
 public void setRow(Record record,
                    int rowIndex,
                    Vector properties[])
Sets the record at the specified rowIndex to be the specified record. Each object in the row is assigned the appropriate properties list specified by properties.

Parameters:
record - The record.
rowIndex - The row index (0-based).
properties - The row properties.
 o setRecordFormat
 public void setRecordFormat(RecordFormat recordFormat) throws PropertyVetoException
Sets the record format for the record list. The metadata is set using the specified recordFormat. If a record format already exists, then setting a new record format will remove all rows from the list.

Parameters:
recordFormat - The record format.
Throws: PropertyVetoException
If a change is vetoed.
See Also:
getRecordFormat, getMetaData

All Packages  Class Hierarchy  This Package  Previous  Next  Index