Hyades Datapool Specification

org.eclipse.hyades.edit.datapool
Interface IDatapoolEquivalenceClass

All Superinterfaces:
IDatapoolEquivalenceClass, INamedElement, INamedElement

public interface IDatapoolEquivalenceClass
extends IDatapoolEquivalenceClass, INamedElement

An equivalence class is a logical grouping of records within a datapool. All records in an equivalence class have the same uniform length as records in all other equivalence classes associated with a single datapool. Note that each equivalence class is a named element with an associated name and ID.

See Also:
IDatapool, IDatapoolRecord

Method Summary
 void appendRecord(IDatapoolRecord record)
          Append the specified record to the end of the datapool.
 IDatapoolRecord constructRecord(java.lang.Object[] elements)
          Construct a new record with an appropriate number of elements for the active datapool.
 void insertRecord(IDatapoolRecord data, int beforeRecord)
          Insert the specified record before the zero based record index.
 IDatapoolRecord removeRecord(int recordIndex)
          Remove the specified record.
 void reorder(int[] recordOrder)
          Inform the equivalence class of a new order for records.
 void replaceRecord(IDatapoolRecord data, int recordIndex)
          Update the specified record with the supplied data.
 
Methods inherited from interface org.eclipse.hyades.execution.runtime.datapool.IDatapoolEquivalenceClass
getRecord, getRecordCount
 
Methods inherited from interface org.eclipse.hyades.execution.runtime.datapool.INamedElement
getDescription, getId, getName
 
Methods inherited from interface org.eclipse.hyades.edit.datapool.INamedElement
setDescription, setId, setName
 

Method Detail

constructRecord

public IDatapoolRecord constructRecord(java.lang.Object[] elements)
Construct a new record with an appropriate number of elements for the active datapool. The number of elements equals the number of variables in the datapool. The supplied values will be padded or truncated to match the number of variables available. The supplied values may be null in which case all elements in the returned record will be null.

Parameters:
elements - The initial values defined for the record or null if no initial values are desired.
See Also:
IDatapool.getVariableCount(), insertRecord(IDatapoolRecord,int), appendRecord(IDatapoolRecord), replaceRecord(IDatapoolRecord,int)

insertRecord

public void insertRecord(IDatapoolRecord data,
                         int beforeRecord)
Insert the specified record before the zero based record index. Any attempt to insert the same record into a datapool multiple times will result in an appropriate exception.

Parameters:
data - The new record.
beforeRecord - The zero based record index to insert the new record before.
See Also:
appendRecord(IDatapoolRecord), replaceRecord(IDatapoolRecord,int), removeRecord(int)

appendRecord

public void appendRecord(IDatapoolRecord record)
Append the specified record to the end of the datapool. Any attempt to insert the same Record into a datapool multiple times will result in an appropriate exception.

Parameters:
record - The new record.
See Also:
insertRecord(IDatapoolRecord,int), replaceRecord(IDatapoolRecord,int), removeRecord(int)

replaceRecord

public void replaceRecord(IDatapoolRecord data,
                          int recordIndex)
Update the specified record with the supplied data. This method simulates removeRecord followed by insertRecord without the need to perform both calls. The specified record index is zero based. Any attempt to replace a record in the datapool with a record already in the datapool will result in an appropriate exception.

Parameters:
data - The new record data.
recordIndex - The zero based record index to update the new record data into.
See Also:
insertRecord(IDatapoolRecord,int), appendRecord(IDatapoolRecord), removeRecord(int)

removeRecord

public IDatapoolRecord removeRecord(int recordIndex)
Remove the specified record.

Parameters:
recordIndex - The zero based record index of the record to remove.
See Also:
insertRecord(IDatapoolRecord,int), appendRecord(IDatapoolRecord), replaceRecord(IDatapoolRecord,int)

reorder

public void reorder(int[] recordOrder)
Inform the equivalence class of a new order for records. The current record index is specified in the array, with the index into the array expressing the desired order. So if {3, 4, 2, 1, 0} is passed in, the third record if moved to the first position, the fourth to the second and so on.

If the specified set of records is the wrong length or contains redundant record references an appropriate exception is thrown.

Parameters:
recordOrder - The desired order for the records in the equivalence class.


Hyades DPL