edu.cmu.sei.osate.ui.actions
Interface IAnalysis

All Known Implementing Classes:
AbstractAnalysis

public interface IAnalysis

IAnalysis is the interface for all analyses that can be run through the Auto-Analysis view. There should be one analysis instance per analysis run. Here is the life cycle of an IAnalysis object: 1. Create a new instance. 2. Call setParameter(AObject parameter). 3. Call readyToRun(). 4a. If readyToRun() returned true, call run(). 4b. If readyToRun() returned false, call getNotReadyToRunReason(). If a method is called out of order, an IllegalStateException is thrown. After step 4 is executed, the object is dead and should no longer be used. Do not try to reset the parameter or run the analysis again. Instead, a new IAnalysis object should be created.

Author:
jseibel

Method Summary
 java.lang.String getNotReadyToRunReason()
          If for some reason the run() method could not be called, the reason is given as a human readable String that can be displayed to the user.
 boolean readyToRun()
          For all analyses, this method ensures that the parameter still exists.
 boolean run()
          Execute the analysis based on the parameter.
 void setConfiguratorKeysAndValues(java.util.HashMap<java.lang.String,java.lang.String> keysAndValues)
           
 void setParameter(org.eclipse.emf.common.util.URI parameterPath, java.lang.String readablePath)
          Depending on the analysis, the parameter is the model, ComponentImpl, SystemImpl, or other AObject that the analysis runs on.
 

Method Detail

setParameter

void setParameter(org.eclipse.emf.common.util.URI parameterPath,
                  java.lang.String readablePath)
Depending on the analysis, the parameter is the model, ComponentImpl, SystemImpl, or other AObject that the analysis runs on. The appropriate parameter is dependent on the specific edu.cmu.sei.osate.ui.analysis extension. setParameter does not validate the parameter. It is the responsibility of this method's caller to ensure that the parameter is appropriate according to the analysis' plugin.xml file.

Parameters:
parameterPath - The URI path of the parameter which can be found by calling EcoreUtil.getURI(EObject).
readablePath - A textual representation of the parameter including its location that can be displayed to the user.

setConfiguratorKeysAndValues

void setConfiguratorKeysAndValues(java.util.HashMap<java.lang.String,java.lang.String> keysAndValues)

run

boolean run()
Execute the analysis based on the parameter. If the analysis passed, then true is returned. If the analysis failed, then false is returned. For most analyses, failure is reported through problem markers on the model, however this behavior is not guaranteed for all analyses. See each analysis for failure details.

Returns:
true if the analysis passed; false if it failed.

readyToRun

boolean readyToRun()
For all analyses, this method ensures that the parameter still exists. Depending on the specific analysis, this method might check if certain property definitions are available. If for some reason the analysis is not in a runnable state, the reason is reported as a String and can be retrieved through getNotReadyToRunReason().

Returns:
true if the run() method can be called; false if it cannot.

getNotReadyToRunReason

java.lang.String getNotReadyToRunReason()
If for some reason the run() method could not be called, the reason is given as a human readable String that can be displayed to the user.

Returns:
The reason that run() could not be called.