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:
- An entry in a data queue.
- The parameter data provided to or returned by a program call.
- A record to be written to or read from an AS/400 file.
- Any data returned from the AS/400 that needs to be converted between AS/400
format and Java format.
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:
- RowDataEvent - The events fired are:
- rowAdded()
- rowChanged()
- rowRemoved()
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]);
}
-
RecordListRowData()
- Constructs a default RecordListRowData object.
-
RecordListRowData(RecordFormat)
-
Constructs a RecordListRowData object with the specified recordFormat.
-
addRow(Record)
- Adds the specified record to the end of the record list.
-
addRow(Record, int)
- Adds the specified record to the record list at the specified rowIndex.
-
addRow(Record, int, Vector[])
- Adds the specified record to the record list at the specified rowIndex.
-
addRow(Record, Vector[])
- Adds the specified record to the end of the record list.
-
addRowDataListener(RowDataListener)
- Adds a RowDataListener.
-
getMetaData()
- Returns the metadata.
-
getObject(int)
- Returns the current record's field at the specified columnIndex.
-
getRecordFormat()
- Returns the record format.
-
getRow()
- Returns the Record object for the current row.
-
removeRow(int)
- Removes a record from the record list at the specified rowIndex.
-
removeRowDataListener(RowDataListener)
- Removes this RowDataListener from the internal list.
-
setRecordFormat(RecordFormat)
- Sets the record format for the record list.
-
setRow(Record, int)
- Sets the record at the specified rowIndex to be the specified record.
-
setRow(Record, int, Vector[])
- Sets the record at the specified rowIndex to be the specified record.
RecordListRowData
public RecordListRowData()
- Constructs a default RecordListRowData object.
RecordListRowData
public RecordListRowData(RecordFormat recordFormat)
- Constructs a RecordListRowData object with the specified recordFormat.
- Parameters:
- recordFormat - The record format.
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.
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.
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.
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.
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.
getMetaData
public RowMetaData getMetaData()
- Returns the metadata.
- Returns:
- The metadata.
- Overrides:
- getMetaData in class RowData
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
getRecordFormat
public RecordFormat getRecordFormat()
- Returns the record format.
- Returns:
- The record format.
getRow
public Record getRow()
- Returns the Record object for the current row.
- Returns:
- The row.
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.
removeRow
public void removeRow(int rowIndex)
- Removes a record from the record list at the specified rowIndex.
- Parameters:
- rowIndex - The row index (0-based).
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).
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.
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