Class InsertNode
- java.lang.Object
-
- de.aristaflow.adept2.core.changeoperations.InsertNode
-
public class InsertNode extends Object
Change operation for inserting a new node. The node can only be inserted between two nodes which are connected by a control flow edge. TODO Refactor; use a common interface for change operations.
-
-
Constructor Summary
Constructors Constructor Description InsertNode()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
isPossible(Instance instance, Node pred, Node succ)
Check if it is possible (concerning structural and state based correctness) to insert a node between the two given nodes in the given instance.static boolean
isPossible(Instance instance, Node pred, Node succ, CheckReport checkReport)
Check if it is possible (concerning structural and state based correctness) to insert a node between the two given nodes in the given instance.static boolean
isPossible(Template template, Node pred, Node succ)
Check if it is possible (concerning structural correctness) to insert a node between the two given nodes in the given template.static boolean
isPossible(Template template, Node pred, Node succ, CheckReport checkReport)
Check if it is possible (concerning structural correctness) to insert a node between the two given nodes in the given template.static Node
performOperation(SessionToken session, ChangeableInstance instance, Node pred, Node succ)
Insert a new node between two nodes in the given instance.static Node
performOperation(SessionToken session, ChangeableInstance instance, Node pred, Node succ, UpdateManager updateManager)
Insert a new node of type NT_NORMAL between two nodes in the given instance.static Node
performOperation(SessionToken session, ChangeableInstance instance, Node tempNode, Node pred, Node succ)
Insert a new node between two nodes in the given instance.static Node
performOperation(SessionToken session, ChangeableInstance instance, Node tempNode, Node pred, Node succ, UpdateManager updateManager)
Insert a new node of type NT_NORMAL between two nodes in the given instance.protected static Node
performOperation(SessionToken session, ChangeableInstance instance, Node tempNode, Node pred, Node succ, ProcessConstants.NodeType type, UpdateManager updateManager)
Insert a new node of typetype
between two nodes in the given instance.static Node
performOperation(SessionToken session, ChangeableTemplate template, Node pred, Node succ)
Insert a new node between two nodes in the given template.static Node
performOperation(SessionToken session, ChangeableTemplate template, Node pred, Node succ, UpdateManager updateManager)
Insert a new node of type NT_NORMAL between two nodes in the given template.static Node
performOperation(SessionToken session, ChangeableTemplate template, Node tempNode, Node pred, Node succ)
Insert a new node between two nodes in the given template.static Node
performOperation(SessionToken session, ChangeableTemplate template, Node tempNode, Node pred, Node succ, UpdateManager updateManager)
Insert a new node of type NT_NORMAL between two nodes in the given template.protected static Node
performOperation(SessionToken session, ChangeableTemplate template, Node tempNode, Node pred, Node succ, ProcessConstants.NodeType type, UpdateManager updateManager)
Insert a new node of typetype
between two nodes in the given template.protected static Node
performOperation(SessionToken session, ChangePrimitives processGraph, Node pred, Node succ, ProcessConstants.NodeType type, UpdateManager updateManager)
Worker method to do the structural changes for both changeable templates and changeable instances.protected static Node
performOperation(SessionToken session, ChangePrimitives processGraph, Node tempNode, Node pred, Node succ, 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 pred, Node succ)
Check if it is possible (concerning structural correctness) to insert a node between the two given nodes in the given template.- Parameters:
template
- The template where the node should be inserted.pred
- The predecessor of the new node.succ
- The successor of the new node.- Returns:
- True, if the insertion is possible.
-
isPossible
public static boolean isPossible(Template template, Node pred, Node succ, CheckReport checkReport)
Check if it is possible (concerning structural correctness) to insert a node between the two given nodes in the given template.- Parameters:
template
- The template where the node should be inserted.pred
- The predecessor of the new node.succ
- The successor of the new node.checkReport
- 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 the insertion is possible.
-
isPossible
public static boolean isPossible(Instance instance, Node pred, Node succ)
Check if it is possible (concerning structural and state based correctness) to insert a node between the two given nodes in the given instance.- Parameters:
instance
- The changeable instance where the node should be inserted.pred
- The predecessor of the new node.succ
- The successor of the new node.- Returns:
- True, if the insertion is possible.
-
isPossible
public static boolean isPossible(Instance instance, Node pred, Node succ, CheckReport checkReport)
Check if it is possible (concerning structural and state based correctness) to insert a node between the two given nodes in the given instance.- Parameters:
instance
- The changeable instance where the node should be inserted.pred
- The predecessor of the new node.succ
- The successor of the new node.checkReport
- 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 the insertion is possible.
-
performOperation
public static Node performOperation(SessionToken session, ChangeableTemplate template, Node pred, Node succ)
Insert a new node between two nodes in the given template.- Parameters:
session
- The session which is used to check for access rights on this method.template
- The changeable template where the node will be inserted.pred
- The predecessor of the new node.succ
- The successor of the new node.- Returns:
- The newly inserted node.
-
performOperation
public static Node performOperation(SessionToken session, ChangeableTemplate template, Node tempNode, Node pred, Node succ)
Insert a new node between two nodes in the given template.- Parameters:
session
- The session which is used to check for access rights on this method.template
- The changeable template where the node will be inserted.tempNode
- a dummy node object which is used to set the properties of the new nodepred
- The predecessor of the new node.succ
- The successor of the new node.- Returns:
- The newly inserted node.
-
performOperation
public static Node performOperation(SessionToken session, ChangeableTemplate template, Node pred, Node succ, UpdateManager updateManager)
Insert a new node of type NT_NORMAL between two nodes in the given template.- Parameters:
session
- The session which is used to check for access rights on this method.template
- The changeable template where the node will be inserted.pred
- The predecessor of the new node.succ
- The successor of the new node.updateManager
- The UpdateManager where modifications are logged, may be null- Returns:
- The newly inserted node.
-
performOperation
public static Node performOperation(SessionToken session, ChangeableTemplate template, Node tempNode, Node pred, Node succ, UpdateManager updateManager)
Insert a new node of type NT_NORMAL between two nodes in the given template.- Parameters:
session
- The session which is used to check for access rights on this method.template
- The changeable template where the node will be inserted.tempNode
- a dummy node object which is used to set the properties of the new nodepred
- The predecessor of the new node.succ
- The successor of the new node.updateManager
- The UpdateManager where modifications are logged, may be null- Returns:
- The newly inserted node.
-
performOperation
protected static Node performOperation(SessionToken session, ChangeableTemplate template, Node tempNode, Node pred, Node succ, ProcessConstants.NodeType type, UpdateManager updateManager)
Insert a new node of typetype
between two nodes in the given template. This method is for internal use only. It offers the possibility to create nodes with a type other than NT_NORMAL.- Parameters:
session
- The session which is used to check for access rights on this method.template
- The changeable template where the node will be inserted.tempNode
- a dummy node object which is used to set the properties of the new nodepred
- The predecessor of the new node.succ
- The successor of the new node.type
- the type of the new nodeupdateManager
- The UpdateManager where modifications are logged, may be null- Returns:
- The newly inserted node.
-
performOperation
public static Node performOperation(SessionToken session, ChangeableInstance instance, Node pred, Node succ)
Insert a new node between two nodes in 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 will be inserted.pred
- The predecessor of the new node.succ
- The successor of the new node.- Returns:
- The newly inserted node.
-
performOperation
public static Node performOperation(SessionToken session, ChangeableInstance instance, Node tempNode, Node pred, Node succ)
Insert a new node between two nodes in 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 will be inserted.tempNode
- a dummy node object which is used to set the properties of the new nodepred
- The predecessor of the new node.succ
- The successor of the new node.- Returns:
- The newly inserted node.
-
performOperation
public static Node performOperation(SessionToken session, ChangeableInstance instance, Node pred, Node succ, UpdateManager updateManager)
Insert a new node of type NT_NORMAL between two nodes in 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 will be inserted.pred
- The predecessor of the new node.succ
- The successor of the new node.updateManager
- the manager which is responsible for the graphical adaptation of the template (maybe null)- Returns:
- The newly inserted node.
-
performOperation
public static Node performOperation(SessionToken session, ChangeableInstance instance, Node tempNode, Node pred, Node succ, UpdateManager updateManager)
Insert a new node of type NT_NORMAL between two nodes in 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 will be inserted.tempNode
- a dummy node object which is used to set the properties of the new nodepred
- The predecessor of the new node.succ
- The successor of the new node.updateManager
- the manager which is responsible for the graphical adaptation of the template (maybe null)- Returns:
- The newly inserted node.
-
performOperation
protected static Node performOperation(SessionToken session, ChangeableInstance instance, Node tempNode, Node pred, Node succ, ProcessConstants.NodeType type, UpdateManager updateManager)
Insert a new node of typetype
between two nodes in the given instance. This method is for internal use only. It offers the possibility to create nodes with 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 will be inserted.tempNode
- a dummy node object which is used to set the properties of the new nodepred
- The predecessor of the new node.succ
- The successor of the new node.type
- the type of the new nodeupdateManager
- the manager which is responsible for the graphical adaptation of the template (maybe null)- Returns:
- The newly inserted node.
-
performOperation
protected static Node performOperation(SessionToken session, ChangePrimitives processGraph, Node pred, Node succ, 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 ChangeableInstancepred
- The predecessor of the new node.succ
- The successor of the new node.type
- the type of the new nodeupdateManager
- the manager which is responsible for the graphical adaptation of the template (maybe null)- Returns:
- The newly inserted node.
-
performOperation
protected static Node performOperation(SessionToken session, ChangePrimitives processGraph, Node tempNode, Node pred, Node succ, 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 ChangeableInstancetempNode
- a dummy node object which is used to set the properties of the new nodepred
- The predecessor of the new node.succ
- The successor of the new node.type
- the type of the new nodeupdateManager
- the manager which is responsible for the graphical adaptation of the template (maybe null)- Returns:
- The newly inserted node.
-
-