org.eclipse.emf.henshin.interpreter
Interface UnitApplication

All Known Subinterfaces:
RuleApplication
All Known Implementing Classes:
AbstractApplicationImpl, RuleApplicationImpl, UnitApplicationImpl

public interface UnitApplication

Interface for Unit applications. If you want to execute a rule, you can also use RuleApplication instead.


Method Summary
 boolean execute(ApplicationMonitor monitor)
          Execute this unit application.
 Assignment getAssignment()
          Get the parameter assignment to be used.
 EGraph getEGraph()
          Get the EGraph to be transformed.
 Assignment getResultAssignment()
          Get the parameter assignment for the result.
 Object getResultParameterValue(String paramName)
          Get the value assigned to a parameter.
 Unit getUnit()
          Get the unit to be applied.
 boolean redo(ApplicationMonitor monitor)
          Redo this unit application.
 void setAssignment(Assignment assignment)
          Set the parameter assignment to be used.
 void setEGraph(EGraph graph)
          Set the EGraph to be transformed.
 void setParameterValue(String paramName, Object value)
          Set the assigned value for a parameter.
 void setUnit(Unit unit)
          Set the unit to be applied.
 boolean undo(ApplicationMonitor monitor)
          Undo this unit application.
 

Method Detail

getUnit

Unit getUnit()
Get the unit to be applied.

Returns:
The unit.

setUnit

void setUnit(Unit unit)
Set the unit to be applied.

Parameters:
unit - The transformation unit.

getEGraph

EGraph getEGraph()
Get the EGraph to be transformed.

Returns:
The object graph.

setEGraph

void setEGraph(EGraph graph)
Set the EGraph to be transformed.

Parameters:
graph - The object graph.

getAssignment

Assignment getAssignment()
Get the parameter assignment to be used.

Returns:
The parameter assignment.

setAssignment

void setAssignment(Assignment assignment)
Set the parameter assignment to be used.

Parameters:
assignment - The parameter assignment.

setParameterValue

void setParameterValue(String paramName,
                       Object value)
Set the assigned value for a parameter. This is a convenience method to directly access the assignment of this unit. This is possible only if the unit is set.

Parameters:
paramName - The name of the parameter.
value - The value to be assigned with the parameter.

getResultAssignment

Assignment getResultAssignment()
Get the parameter assignment for the result.

Returns:
The result parameter assignment.

getResultParameterValue

Object getResultParameterValue(String paramName)
Get the value assigned to a parameter. This is a convenience method to directly access the result assignment of this unit. This is possible only if the unit is set and the unit is applied.

Parameters:
paramName - The name of the parameter.
Returns:
The assigned result value or null.

execute

boolean execute(ApplicationMonitor monitor)
Execute this unit application.

Parameters:
monitor - The application monitor or null.
Returns:
true if the unit was successfully applied.

undo

boolean undo(ApplicationMonitor monitor)
Undo this unit application. This restores the original model as it was before calling #execute().

Parameters:
monitor - The application monitor or null.
Returns:
true if the unit was successfully undone.

redo

boolean redo(ApplicationMonitor monitor)
Redo this unit application. This method can be invoked after #undo() has been invoked. The effect is that the unit is executed again.

Parameters:
monitor - The application monitor or null.
Returns:
true if the unit was successfully redone.