Class DeleteEmptyBranch
java.lang.Object
de.aristaflow.adept2.core.changeoperations.DeleteEmptyBranch
Deletes an empty branch between a split and its corresponding join node. Call
isPossible first to check if the deletion is valid, than call perform
operation to execute the change.
TODO Refactor; use a common interface for change operations.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisPossible(ChangeableInstance instance, Node split, Node join) Checks if it is valid (concerning structural and state-based correctness) to delete the given branch from the given instance.static booleanisPossible(ChangeableInstance instance, Node split, Node join, CheckReport checkReport) Checks if it is valid (concerning structural and state-based correctness) to delete the given branch from the instance.static booleanisPossible(Template template, Node split, Node join) Checks if it is valid (concerning structural correctness) to delete the given branch from the template.static booleanisPossible(Template template, Node split, Node join, CheckReport checkReport) Checks if it is valid (concerning structural correctness) to delete the given branch from the template.static voidperformOperation(ChangeableInstance instance, Node split, Node join) Deletes an empty branch between split and join in the given instance.static voidperformOperation(ChangeableInstance instance, Node split, Node join, UpdateManager updateManager) Deletes an empty branch between split and join in the given instance (with updateManager).static voidperformOperation(ChangeableTemplate template, Node split, Node join) Deletes an empty branch between split and join in the given template.static voidperformOperation(ChangeableTemplate template, Node split, Node join, UpdateManager updateManager) Deletes an empty branch between split and join in the given template (with updateManager).protected static voidperformOperation(ChangePrimitives processGraph, Node split, Node join, UpdateManager updateManager) Worker method to do the structural changes for both changeable templates and changeable instances.
-
Field Details
-
logger
a Logger
-
-
Constructor Details
-
DeleteEmptyBranch
public DeleteEmptyBranch()
-
-
Method Details
-
isPossible
Checks if it is valid (concerning structural correctness) to delete the given branch from the template.- Parameters:
template- the template where the branch should be deletedsplit- the splitting nodejoin- the joining node- Returns:
- True, if deletion is possible
-
isPossible
Checks if it is valid (concerning structural correctness) to delete the given branch from the template. If it is not possible the reasons are stored in the checkReport.- Parameters:
template- the template where the branch should be deletedsplit- the splitting nodejoin- the joining nodecheckReport- a checkReport object which can be filled with the reason why the isPossible failed (i.e. in the case the method returns false), may be null- Returns:
- True, if deletion is possible
-
isPossible
Checks if it is valid (concerning structural and state-based correctness) to delete the given branch from the given instance.- Parameters:
instance- the changeable instance where the branch should be deletedsplit- the splitting nodejoin- the joining node- Returns:
- True, if deletion is possible
-
isPossible
public static boolean isPossible(ChangeableInstance instance, Node split, Node join, CheckReport checkReport) Checks if it is valid (concerning structural and state-based correctness) to delete the given branch from the instance. If it is not possible the reasons are stored in the checkReport.- Parameters:
instance- the changeable instance where the branch should be deletedsplit- the splitting nodejoin- the joining nodecheckReport- a checkReport object which can be filled with the reason why the isPossible failed (i.e. in the case the method returns false), may be null- Returns:
- True, if deletion is possible
-
performOperation
Deletes an empty branch between split and join in the given template.- Parameters:
template- the template where the branch is to be deletedsplit- the splitting nodejoin- the joining node
-
performOperation
public static void performOperation(ChangeableTemplate template, Node split, Node join, UpdateManager updateManager) Deletes an empty branch between split and join in the given template (with updateManager).- Parameters:
template- the template where the branch is to be deletedsplit- the splitting nodejoin- the joining nodeupdateManager- the manager who controls the update of the visual graph components.
-
performOperation
Deletes an empty branch between split and join in the given instance.- Parameters:
instance- the changeable instance where the branch is to be deletedsplit- the splitting nodejoin- the joining node
-
performOperation
public static void performOperation(ChangeableInstance instance, Node split, Node join, UpdateManager updateManager) Deletes an empty branch between split and join in the given instance (with updateManager).- Parameters:
instance- the changeable instance where the branch is to be deletedsplit- the splitting nodejoin- the joining nodeupdateManager- the manager who controls the update of the visual graph components.
-
performOperation
protected static void performOperation(ChangePrimitives processGraph, Node split, Node join, UpdateManager updateManager) Worker method to do the structural changes for both changeable templates and changeable instances.- Parameters:
processGraph- an instance of type ChangeableTemplate or ChangeableInstancesplit- the splitting nodejoin- the joining nodeupdateManager- the manager who controls the update of the visual graph components.
-