com.wrq.vhi.script.api
Interface MutableProcedureRecordSet

All Superinterfaces:
ProcedureRecordSet, RecordSet

public interface MutableProcedureRecordSet
extends ProcedureRecordSet

A ProcedureRecordSet whose contents can be modified. Records can be changed, added, removed and sorted.


Method Summary
 MutableProcedureRecord addRecord()
          Adds a new record to the end of the recordset.
 MutableProcedureRecord addRecord(int row)
          Inserts a new record at the specified row.
 MutableProcedureRecord addRecord(int row, Record record)
          Inserts a copy of an existing record at the specified row.
 MutableProcedureRecord addRecord(int row, Record record, java.util.Map mapping)
          Inserts a copy of an existing record at the specified row.
 MutableProcedureRecord addRecord(Record record)
          Adds a copy of an existing record.
 MutableProcedureRecord addRecord(Record record, java.util.Map mapping)
          Adds a copy of an existing record.
 void addRecords(int row, RecordSet recordset)
          Inserts a copy of all records in the specified record set at the specified row.
 void addRecords(int row, RecordSet recordset, java.util.Map mapping)
          Inserts a copy of all records in the specified record set at the specified row.
 void addRecords(RecordSet recordset)
          Adds a copy of all records in the specified record set.
 void addRecords(RecordSet recordset, java.util.Map mapping)
          Adds a copy of all records in the specified record set.
 MutableProcedureRecord getMutableProcedureRecord(int row)
          Gets a record by row number.
 void removeRecord(int row)
          Removes the record at the specified row.
 void removeRecord(ProcedureRecord record)
          Removes the specified record from the record set.
 void sortRecords(java.util.Comparator comparator)
          Sorts the records using a Comparator.
 void sortRecords(int column)
          Sort the records based on a column.
 void sortRecords(int[] columns)
          Sort the records based multiple columns.
 
Methods inherited from interface com.wrq.vhi.script.api.ProcedureRecordSet
getProcedureRecord
 
Methods inherited from interface com.wrq.vhi.script.api.RecordSet
getColumnNames, getCount, getRecord, toXMLString
 

Method Detail

getMutableProcedureRecord

MutableProcedureRecord getMutableProcedureRecord(int row)
Gets a record by row number. This is equivalent to calling RecordSet.getRecord(int) except that no cast is required to obtain the MutableProcedureRecord interface.

Parameters:
row - the zero-based row number
Returns:
the record for the specified row
Throws:
java.lang.IllegalArgumentException - if the row index is invalid

addRecord

MutableProcedureRecord addRecord()
Adds a new record to the end of the recordset.

Returns:
the new record

addRecord

MutableProcedureRecord addRecord(int row)
Inserts a new record at the specified row.

Parameters:
row - the row number at which to insert the new record
Returns:
the new record

addRecord

MutableProcedureRecord addRecord(Record record)
Adds a copy of an existing record. If the columns in this record set do not exactly match the columns in the specified record, mapping is done via column names. The value of any column in this record set that does not have a corresponding column in the specified record is set to null.

Parameters:
record - the existing record
Returns:
the added record

addRecord

MutableProcedureRecord addRecord(int row,
                                 Record record)
Inserts a copy of an existing record at the specified row. If the columns in this record set do not exactly match the columns in the specified record, mapping is done via column names. The value of any column in this record set that does not have a corresponding column in the specified record is set to null.

Parameters:
row - the row number at which to insert the new record
record - the existing record
Returns:
the added record

addRecord

MutableProcedureRecord addRecord(Record record,
                                 java.util.Map mapping)
Adds a copy of an existing record. The specified map is used to map from column names in the specified record to column names in this record set. The value of any column in this record set that does not have a corresponding column in the map is set to null.

Parameters:
record - the existing record
mapping - a map of column names in the specified record to column names in this record set
Returns:
the added record

addRecord

MutableProcedureRecord addRecord(int row,
                                 Record record,
                                 java.util.Map mapping)
Inserts a copy of an existing record at the specified row. The specified map is used to map from column names in the specified record to column names in this record set. The value of any column in this record set that does not have a corresponding column in the map is set to null.

Parameters:
row - the row number at which to insert the new record
record - the existing record
mapping - a map of column names in the specified record to column names in this record set
Returns:
the added record

addRecords

void addRecords(RecordSet recordset)
Adds a copy of all records in the specified record set. See addRecord(com.wrq.vhi.script.api.Record) for details on how each record is processed.

Parameters:
recordset - the recordset from which to copy the records

addRecords

void addRecords(int row,
                RecordSet recordset)
Inserts a copy of all records in the specified record set at the specified row. See addRecord(int, com.wrq.vhi.script.api.Record) for details on how each record is processed.

Parameters:
row - the row number at which to insert the new records
recordset - the recordset from which to copy the records

addRecords

void addRecords(RecordSet recordset,
                java.util.Map mapping)
Adds a copy of all records in the specified record set. See addRecord(com.wrq.vhi.script.api.Record, java.util.Map) for details on how each record is processed.

Parameters:
recordset - the recordset from which to copy the records
mapping - a map of column names in the specified record to column names in this record set

addRecords

void addRecords(int row,
                RecordSet recordset,
                java.util.Map mapping)
Inserts a copy of all records in the specified record set at the specified row. See addRecord(int, com.wrq.vhi.script.api.Record, java.util.Map) for details on how each record is processed.

Parameters:
row - the row number at which to insert the new records
recordset - the recordset from which to copy the records
mapping - a map of column names in the specified record to column names in this record set

removeRecord

void removeRecord(int row)
                  throws java.lang.IllegalArgumentException
Removes the record at the specified row.

Parameters:
row - the row number of the record to remove
Throws:
java.lang.IllegalArgumentException - if the row index is invalid

removeRecord

void removeRecord(ProcedureRecord record)
                  throws java.lang.IllegalArgumentException
Removes the specified record from the record set.

Parameters:
record - the record to remove
Throws:
java.lang.IllegalArgumentException - if the record is not found

sortRecords

void sortRecords(int column)
Sort the records based on a column.

Parameters:
column - the index of the column to sort by

sortRecords

void sortRecords(int[] columns)
Sort the records based multiple columns.

Parameters:
columns - an array of column indices to sort by

sortRecords

void sortRecords(java.util.Comparator comparator)
Sorts the records using a Comparator.

Parameters:
comparator - the comparator to use to compare rows