public class RecordListRowData extends RowData implements java.io.Serializable
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 object to represent the system. 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]); }
rowProperties_, rows_
Constructor and Description |
---|
RecordListRowData()
Constructs a default RecordListRowData object.
|
RecordListRowData(RecordFormat recordFormat)
Constructs a RecordListRowData object with the specified recordFormat.
|
Modifier and Type | Method and Description |
---|---|
void |
addRow(Record record)
Adds the specified record to the end of the record list.
|
void |
addRow(Record record,
int rowIndex)
Adds the specified record to the record list at the specified rowIndex.
|
void |
addRow(Record record,
int rowIndex,
java.util.Vector[] properties)
Adds the specified record to the record list at the specified rowIndex.
|
void |
addRow(Record record,
java.util.Vector[] properties)
Adds the specified record to the end of the record list.
|
void |
addRowDataListener(RowDataListener listener)
Adds a RowDataListener.
|
RowMetaData |
getMetaData()
Returns the metadata.
|
java.lang.Object |
getObject(int columnIndex)
Returns the current record's field at the specified columnIndex.
|
RecordFormat |
getRecordFormat()
Returns the record format.
|
Record |
getRow()
Returns the Record object for the current row.
|
void |
removeRow(int rowIndex)
Removes a record from the record list at the specified rowIndex.
|
void |
removeRowDataListener(RowDataListener listener)
Removes this RowDataListener from the internal list.
|
void |
setRecordFormat(RecordFormat recordFormat)
Sets the record format for the record list.
|
void |
setRow(Record record,
int rowIndex)
Sets the record at the specified rowIndex to be the specified record.
|
void |
setRow(Record record,
int rowIndex,
java.util.Vector[] properties)
Sets the record at the specified rowIndex to be the specified record.
|
absolute, addPropertyChangeListener, addVetoableChangeListener, afterLast, beforeFirst, first, getCurrentPosition, getObjectProperties, getRowProperties, isAfterLast, isBeforeFirst, isFirst, isLast, last, length, next, previous, relative, removePropertyChangeListener, removeVetoableChangeListener, setObjectProperties
public RecordListRowData()
public RecordListRowData(RecordFormat recordFormat)
recordFormat
- The record format.public void addRow(Record record) throws RowDataException
record
- The record to be added.RowDataException
- If a row data error occurs.public void addRow(Record record, java.util.Vector[] properties)
record
- The record to be added.properties
- The properties list.public void addRow(Record record, int rowIndex) throws RowDataException
record
- The record to be added.rowIndex
- The rowIndex (0-based).RowDataException
- If a row data error occurs.public void addRow(Record record, int rowIndex, java.util.Vector[] properties)
record
- The record to be added.rowIndex
- The row index (0-based).properties
- The properties list.public void addRowDataListener(RowDataListener listener)
listener
- The RowDataListener.public RowMetaData getMetaData()
getMetaData
in class RowData
public java.lang.Object getObject(int columnIndex) throws RowDataException
getObject
in class RowData
columnIndex
- The column index (0-based).RowDataException
- If a row data error occurs.public RecordFormat getRecordFormat()
public Record getRow()
public void removeRowDataListener(RowDataListener listener)
listener
- The RowDataListener.public void removeRow(int rowIndex)
rowIndex
- The row index (0-based).public void setRow(Record record, int rowIndex)
record
- The record.rowIndex
- The row index (0-based).public void setRow(Record record, int rowIndex, java.util.Vector[] properties)
record
- The record.rowIndex
- The row index (0-based).properties
- The row properties.public void setRecordFormat(RecordFormat recordFormat) throws java.beans.PropertyVetoException
recordFormat
- The record format.java.beans.PropertyVetoException
- If a change is vetoed.getRecordFormat()
,
getMetaData()