getAllDataRecords
ArrayList dataSet.getAllDataRecords ( )
Description
Get all DataRecords in the DataSet.
Parameters
This method does not receive any parameters.
Return Values
Returns an ArrayList of DataRecord objects.
Change Log
Version | Description |
---|---|
4.5 | Available for all editions. |
This method is provided as a convenience, the recommended way to iterate over data records in a data set is to use getNumDataRecords and getDataRecord.
Examples
Loop Through DataRecords
// Stores all of the data records in the variable allData.
allData = dataSet.getAllDataRecords();
// Loop through each of the data records.
for( i = 0; i < allData.size(); i++ )
{
// Store the current data record in the variable myDataRecord.
myDataRecord = allData.get( i );
// Output the "PRODUCT_NAME" value from the data record to the log.
session.log( "Product name: " + myDataRecord.get( "PRODUCT_NAME" ) );
}
allData = dataSet.getAllDataRecords();
// Loop through each of the data records.
for( i = 0; i < allData.size(); i++ )
{
// Store the current data record in the variable myDataRecord.
myDataRecord = allData.get( i );
// Output the "PRODUCT_NAME" value from the data record to the log.
session.log( "Product name: " + myDataRecord.get( "PRODUCT_NAME" ) );
}
See Also
- addDataRecord() [dataSet] - Adds a DataRecord to the DataSet
- clearDataRecords() [dataSet] - Removes all DataRecords from the DataSet
- deleteDataRecord() [dataSet] - Deletes a DataRecord from the DataSet
- getDataRecord() [dataSet] - Gets a DataRecord from the DataSet
scraper on 07/16/2010 at 4:56 pm
- Printer-friendly version
- Login or register to post comments