Hyades Datapool Specification

org.eclipse.hyades.execution.datapool
Interface IDatapool

All Superinterfaces:
INamedElement

public interface IDatapool
extends INamedElement

This class defines the primary interface to datapools. A datapool is an ordered collection of data. The structure of data is in the form of uniformly sized records that are collected into logical groups.

datapool --> (0..n) EquivalenceClasses --> (0..n) Records

Each record contains a uniform set of variables (logically columns) with appropriate name and id properties associated with each.

See Also:
IDatapoolEquivalenceClass, IDatapoolRecord, IDatapoolVariable, IDatapoolListener, DatapoolException

Method Summary
 void addDatapoolListener(IDatapoolListener listener)
          Register a listener for actions against the datapool that modify the data or structure of the data model.
 void appendEquivalenceClass(IDatapoolEquivalenceClass equivalenceClass)
          Append the supplied equivalence class to the end of the set of available equivalence classes.
 void appendVariable(IDatapoolVariable variable)
          Append a variable to the end of the datapool ordered variable collection.
 int getDefaultEquivalenceClassIndex()
          Accessor for the default equivalence class in the datapool.
 int getEquivalenceClassCount()
          Returns the number of equivalence classes associated with a datapool.
 int getEquivalenceClassIndex(java.lang.String equivalenceClassName)
          Locate an equivalence class by name within an instance of a datapool.
 int getEquivalenceClassIndexById(java.lang.String equivalenceClassId)
          Locate an equivalence class by ID within an instance of a datapool.
 IDatapoolVariable getVariable(int variableIndex)
          The variable at a specified zero based column index.
 int getVariableCount()
          The number of variables available in each record.
 int getVariableIndex(java.lang.String variableName)
          Locates the appropriate index associated with a specific variable name.
 int getVariableIndexById(java.lang.String variableId)
          Locates the appropriate index associated with a specific variable ID.
 void insertEquivalenceClass(IDatapoolEquivalenceClass equivalenceClass, int beforeEquivalenceClassIndex)
          Insert the equivalence class at a supplied index.
 void insertVariable(IDatapoolVariable variable, int beforeVariableIndex)
          Insert a variable before the variable at the specified zero based variable index.
 void moveEquivalenceClass(int equivalenceClassIndex, int beforeEquivalenceClass)
          Move the equivalence class at a supplied index to a new position within the set of available equivalence classes.
 void moveVariable(int variableIndex, int beforeVariable)
          Move a variable to immediately before another variable.
 void removeDatapoolListener(IDatapoolListener listener)
          Removes a listener from the datapool instance.
 void removeEquivalenceClass(int equivalenceClassIndex)
          Remove the equivalence class at a supplied index.
 void removeVariable(int variableIndex)
          Remove the specified variable from the datapool.
 void setDefaultEquivalenceClassIndex(int equivalenceClassIndex)
          Define the default equivalence class in a datapool.
 void updateEquivalenceClass(IDatapoolEquivalenceClass equivalenceClass, int equivalenceClassIndex)
          Replace the equivalence class at a supplied index with a new value.
 void updateVariable(IDatapoolVariable variable, int variableIndex)
          Update the variable at a specified zero based variable index.
 
Methods inherited from interface org.eclipse.hyades.execution.datapool.INamedElement
getDescription, getId, getName, setDescription, setId, setName
 

Method Detail

getVariableCount

public int getVariableCount()
The number of variables available in each record.

Returns:
The number of data variables available in each record.

getVariable

public IDatapoolVariable getVariable(int variableIndex)
The variable at a specified zero based column index. A DatapoolException is thrown if the specified index is not valid.

Parameters:
variableIndex - A zero based variable index.
Returns:
The variable for the specified zero based index.
See Also:
getVariableIndex(String)

getVariableIndex

public int getVariableIndex(java.lang.String variableName)
Locates the appropriate index associated with a specific variable name. Users will depend on this method to determine the appropriate cell to access within a record given a current record and a variable name. The current record is typically made available from an iterator that is performing an ordered traversal of the records in a datapool.

Parameters:
variableName - The name of the variable associated with the desired cell.
Returns:
The variable index associated with the specified variableName.
See Also:
getVariableIndexById(String)

getVariableIndexById

public int getVariableIndexById(java.lang.String variableId)
Locates the appropriate index associated with a specific variable ID. Users may use this method to determine the appropriate cell to access within a record given a current record and a variable ID.

Parameters:
variableId - The ID of the variable associated with the desired cell.
Returns:
The variable index associated with the specified variableId.
See Also:
getVariableIndex(String)

updateVariable

public void updateVariable(IDatapoolVariable variable,
                           int variableIndex)
Update the variable at a specified zero based variable index.

Parameters:
variable - The variable for the cells at variableIndex.
variableIndex - A zero based variable index.
See Also:
getVariableIndex(String), getVariableIndexById(String), getVariable(int)

insertVariable

public void insertVariable(IDatapoolVariable variable,
                           int beforeVariableIndex)
Insert a variable before the variable at the specified zero based variable index. This action will cause an empty cell to be automatically inserted in each row of the datapool.

Parameters:
variable - The new variable for the cells at beforeVariableIndex.
beforeVariableIndex - A zero based variable index.
See Also:
appendVariable(IDatapoolVariable), moveVariable(int,int), removeVariable(int)

appendVariable

public void appendVariable(IDatapoolVariable variable)
Append a variable to the end of the datapool ordered variable collection. This action will cause an empty cell to be automatically appended to each record of the datapool.

Parameters:
variable - The variable instance to append.
See Also:
insertVariable(IDatapoolVariable,int), moveVariable(int,int), removeVariable(int)

moveVariable

public void moveVariable(int variableIndex,
                         int beforeVariable)
Move a variable to immediately before another variable. The variables are denoted by a zero based variable index. This action will cause the associated cells in each row of the datapool to also be moved.

Parameters:
variableIndex - A zero based variable index for the variable to be moved.
beforeVariable - The variable index marking the target location for the move action.
See Also:
insertVariable(IDatapoolVariable,int), appendVariable(IDatapoolVariable), removeVariable(int)

removeVariable

public void removeVariable(int variableIndex)
Remove the specified variable from the datapool. The specified variable index is zero based. Each record in the datapool is automatically updated to remove the cell that coincides with the variable.

Parameters:
variableIndex - A zero based variable index for the variable to be removed.
See Also:
insertVariable(IDatapoolVariable,int), appendVariable(IDatapoolVariable), moveVariable(int,int)

getEquivalenceClassCount

public int getEquivalenceClassCount()
Returns the number of equivalence classes associated with a datapool.

Returns:
The number of equivalence classes associated with a datapool.

getDefaultEquivalenceClassIndex

public int getDefaultEquivalenceClassIndex()
Accessor for the default equivalence class in the datapool. If the default equivalence class has not been defined then a value of -1 is returned.

Returns:
The zero-based index for the default equivalence class.
See Also:
setDefaultEquivalenceClassIndex(int)

setDefaultEquivalenceClassIndex

public void setDefaultEquivalenceClassIndex(int equivalenceClassIndex)
Define the default equivalence class in a datapool.

Parameters:
equivalenceClassIndex - The zero-based index for the default equivalence class.
See Also:
getDefaultEquivalenceClassIndex()

getEquivalenceClassIndex

public int getEquivalenceClassIndex(java.lang.String equivalenceClassName)
Locate an equivalence class by name within an instance of a datapool.

Returns:
The zero-based index of the equivalence class with the supplied equivalenceClassName.
See Also:
getEquivalenceClassIndexById(String)

getEquivalenceClassIndexById

public int getEquivalenceClassIndexById(java.lang.String equivalenceClassId)
Locate an equivalence class by ID within an instance of a datapool.

Returns:
The zero-based index of the equivalence class with the supplied equivalenceClassId.
See Also:
getEquivalenceClassIndex(String)

updateEquivalenceClass

public void updateEquivalenceClass(IDatapoolEquivalenceClass equivalenceClass,
                                   int equivalenceClassIndex)
Replace the equivalence class at a supplied index with a new value. This method is essentially a shortcut for a call to removeEquivalenceClass followed by a call to insertEquivalenceClass.

Parameters:
equivalenceClass - The equivalence class to insert.
equivalenceClassIndex - The equivalence class indsex to remove and insert at.
See Also:
insertEquivalenceClass(IDatapoolEquivalenceClass,int), appendEquivalenceClass(IDatapoolEquivalenceClass), moveEquivalenceClass(int,int), removeEquivalenceClass(int)

insertEquivalenceClass

public void insertEquivalenceClass(IDatapoolEquivalenceClass equivalenceClass,
                                   int beforeEquivalenceClassIndex)
Insert the equivalence class at a supplied index. The records in the equivalence class must match the layout of all other records in the datapool.

Parameters:
equivalenceClass - The equivalence class to insert.
beforeEquivalenceClassIndex - The equivalence class index to insert before.
See Also:
updateEquivalenceClass(IDatapoolEquivalenceClass,int), appendEquivalenceClass(IDatapoolEquivalenceClass), moveEquivalenceClass(int,int), removeEquivalenceClass(int)

appendEquivalenceClass

public void appendEquivalenceClass(IDatapoolEquivalenceClass equivalenceClass)
Append the supplied equivalence class to the end of the set of available equivalence classes. The records in the equivalence class must match the layout of all other records in the datapool.

Parameters:
equivalenceClass - The equivalence class to append.
See Also:
updateEquivalenceClass(IDatapoolEquivalenceClass,int), insertEquivalenceClass(IDatapoolEquivalenceClass,int), moveEquivalenceClass(int,int), removeEquivalenceClass(int)

moveEquivalenceClass

public void moveEquivalenceClass(int equivalenceClassIndex,
                                 int beforeEquivalenceClass)
Move the equivalence class at a supplied index to a new position within the set of available equivalence classes.

Parameters:
equivalenceClassIndex - The equivalence class index to move.
beforeEquivalenceClass - The equivalence class destination index.
See Also:
updateEquivalenceClass(IDatapoolEquivalenceClass,int), insertEquivalenceClass(IDatapoolEquivalenceClass,int), appendEquivalenceClass(IDatapoolEquivalenceClass), removeEquivalenceClass(int)

removeEquivalenceClass

public void removeEquivalenceClass(int equivalenceClassIndex)
Remove the equivalence class at a supplied index.

Parameters:
equivalenceClassIndex - The equivalence class indsex to remove.
See Also:
updateEquivalenceClass(IDatapoolEquivalenceClass,int), insertEquivalenceClass(IDatapoolEquivalenceClass,int), appendEquivalenceClass(IDatapoolEquivalenceClass), moveEquivalenceClass(int,int)

addDatapoolListener

public void addDatapoolListener(IDatapoolListener listener)
Register a listener for actions against the datapool that modify the data or structure of the data model. The listener is informed when variables and records are added or deleted, and when the contents of a cell are changed.

See Also:
IDatapoolListener

removeDatapoolListener

public void removeDatapoolListener(IDatapoolListener listener)
Removes a listener from the datapool instance.

See Also:
IDatapoolListener


Hyades DPL