Class DeleteNode
- java.lang.Object
-
- de.aristaflow.adept2.core.changeoperations.DeleteNode
-
public class DeleteNode extends Object
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.
-
-
Constructor Summary
Constructors Constructor Description DeleteNode()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
isPossible(ChangeableInstance instance, Node node)
Checks if it is valid to delete the node (concerning structural and state-based aspects) from the given instance.static boolean
isPossible(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 boolean
isPossible(Template template, Node node)
Checks if it is valid to delete the node (concerning structural aspects) from the given templatestatic boolean
isPossible(Template template, Node node, CheckReport checkReport)
Checks if it is valid to delete the node (concerning structural aspects) from the given template.static void
performOperation(SessionToken session, ChangeableInstance instance, Node node)
Deletes a node of type NT_NORMAL from the given instance.static void
performOperation(SessionToken session, ChangeableInstance instance, Node node, UpdateManager updateManager)
Deletes a node of type NT_NORMAL from the given instance (with updateManager).protected static void
performOperation(SessionToken session, ChangeableInstance instance, Node node, ProcessConstants.NodeType type, UpdateManager updateManager)
Deletes a node of typetype
from the instance.static void
performOperation(SessionToken session, ChangeableTemplate template, Node node)
Deletes a node of type NT_NORMAL from the given template.static void
performOperation(SessionToken session, ChangeableTemplate template, Node node, UpdateManager updateManager)
Deletes a node of type NT_NORMAL from the given template (with updateManager).protected static void
performOperation(SessionToken session, ChangeableTemplate template, Node node, ProcessConstants.NodeType type, UpdateManager updateManager)
Deletes a node of typetype
from the template.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.
-
-
-
Field Detail
-
logger
protected static final Logger logger
a Logger
-
-
Method Detail
-
isPossible
public static boolean isPossible(Template template, Node node)
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
public static boolean isPossible(Template template, Node node, CheckReport checkReport)
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
public static boolean isPossible(ChangeableInstance instance, Node node)
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
public static boolean isPossible(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. 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
public static void performOperation(SessionToken session, ChangeableTemplate template, Node node)
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 typetype
from 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
public static void performOperation(SessionToken session, ChangeableInstance instance, Node node)
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 typetype
from 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)
-
-