Class DeleteNode
java.lang.Object
de.aristaflow.adept2.core.changeoperations.DeleteNode
Change operation for the deletion of a single node. In public methods, the
node can only be deleted, iff it is of type NT_NORMAL. For internal use (e.g.
deletion of blocks) all kinds of nodes can be deleted.
TODO Refactor; use a common interface for change operations.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisPossible(ChangeableInstance instance, Node node) Checks if it is valid to delete the node (concerning structural and state-based aspects) from the given instance.static booleanisPossible(ChangeableInstance instance, Node node, CheckReport checkReport) Checks if it is valid to delete the node (concerning structural and state-based aspects) from the given instance.static booleanisPossible(Template template, Node node) Checks if it is valid to delete the node (concerning structural aspects) from the given templatestatic booleanisPossible(Template template, Node node, CheckReport checkReport) Checks if it is valid to delete the node (concerning structural aspects) from the given template.static voidperformOperation(SessionToken session, ChangeableInstance instance, Node node) Deletes a node of type NT_NORMAL from the given instance.static voidperformOperation(SessionToken session, ChangeableInstance instance, Node node, UpdateManager updateManager) Deletes a node of type NT_NORMAL from the given instance (with updateManager).protected static voidperformOperation(SessionToken session, ChangeableInstance instance, Node node, ProcessConstants.NodeType type, UpdateManager updateManager) Deletes a node of typetypefrom the instance.static voidperformOperation(SessionToken session, ChangeableTemplate template, Node node) Deletes a node of type NT_NORMAL from the given template.static voidperformOperation(SessionToken session, ChangeableTemplate template, Node node, UpdateManager updateManager) Deletes a node of type NT_NORMAL from the given template (with updateManager).protected static voidperformOperation(SessionToken session, ChangeableTemplate template, Node node, ProcessConstants.NodeType type, UpdateManager updateManager) Deletes a node of typetypefrom the template.protected static voidperformOperation(SessionToken session, ChangePrimitives processGraph, Node node, ProcessConstants.NodeType type, UpdateManager updateManager) Worker method to do the structural changes for both changeable templates and changeable instances.
-
Field Details
-
logger
a Logger
-
-
Constructor Details
-
DeleteNode
public DeleteNode()
-
-
Method Details
-
isPossible
Checks if it is valid to delete the node (concerning structural aspects) from the given template- Parameters:
template- the related templatenode- the node to delete- Returns:
- True, if it is valid to delete the node
-
isPossible
Checks if it is valid to delete the node (concerning structural aspects) from the given template. If it is not possible the reasons are stored in the checkReport.- Parameters:
template- the related templatenode- the node to deletecheckReport- 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 it is valid to delete the node
-
isPossible
Checks if it is valid to delete the node (concerning structural and state-based aspects) from the given instance.- Parameters:
instance- The changeable instance where the node should be deleted.node- the node to delete- Returns:
- True, if it is valid to delete the node
-
isPossible
Checks if it is valid to delete the node (concerning structural and state-based aspects) from the given instance. If it is not possible the reasons are stored in the checkReport.- Parameters:
instance- The changeable instance where the node should be deleted.node- the node to deletecheckReport- 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 it is valid to delete the node
-
performOperation
Deletes a node of type NT_NORMAL from the given template.- Parameters:
session- The session which is used to check for access rights on this method.template- the changeable template where the method is performed onnode- the node to delete (must be of type NT_NORMAL)
-
performOperation
public static void performOperation(SessionToken session, ChangeableTemplate template, Node node, UpdateManager updateManager) Deletes a node of type NT_NORMAL from the given template (with updateManager).- Parameters:
session- The session which is used to check for access rights on this method.template- The template where the node is to be deletednode- the node to delete (must be of type NT_NORMAL)updateManager- the manager which is responsible for the graphical adaptation of the template (maybe null)
-
performOperation
protected static void performOperation(SessionToken session, ChangeableTemplate template, Node node, ProcessConstants.NodeType type, UpdateManager updateManager) Deletes a node of typetypefrom the template. This method is for internal use only. It offers the possibility to delete nodes which have only one in- and outgoing control edge and a type other than NT_NORMAL.- Parameters:
session- The session which is used to check for access rights on this method.template- The template where the node is to be deletednode- the node to deletetype- the type of the nodeupdateManager- the manager which is responsible for the graphical adaptation of the template (maybe null)
-
performOperation
Deletes a node of type NT_NORMAL from the given instance.- Parameters:
session- The session which is used to check for access rights on this method.instance- The changeable instance where the node is to be deletednode- a node of type NT_NORMAL
-
performOperation
public static void performOperation(SessionToken session, ChangeableInstance instance, Node node, UpdateManager updateManager) Deletes a node of type NT_NORMAL from the given instance (with updateManager).- Parameters:
session- The session which is used to check for access rights on this method.instance- The changeable instance where the node is to be deletednode- a node of type NT_NORMALupdateManager- the manager which is responsible for the graphical adaptation of the template (maybe null)
-
performOperation
protected static void performOperation(SessionToken session, ChangeableInstance instance, Node node, ProcessConstants.NodeType type, UpdateManager updateManager) Deletes a node of typetypefrom the instance. This method is for internal use only. It offers the possibility to delete nodes which have only one in- and outgoing control edge and a type other than NT_NORMAL.- Parameters:
session- The session which is used to check for access rights on this method.instance- The changeable instance where the node is to be deletednode- the node to deletetype- the type of the nodeupdateManager- the manager which is responsible for the graphical adaptation of the template (maybe null)
-
performOperation
protected static void performOperation(SessionToken session, ChangePrimitives processGraph, Node node, ProcessConstants.NodeType type, UpdateManager updateManager) Worker method to do the structural changes for both changeable templates and changeable instances.- Parameters:
session- The session which is used to check for access rights on this method.processGraph- an instance of type ChangeableTemplate or ChangeableInstancenode- the node to deletetype- the type of the nodeupdateManager- the manager which is responsible for the graphical adaptation of the template (maybe null)
-