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.
  • Field Details

    • logger

      protected static final Logger logger
      a Logger
  • Constructor Details

    • InsertNode

      public InsertNode()
  • Method Details

    • 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 node
      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 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 node
      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

      protected static Node performOperation(SessionToken session, ChangeableTemplate template, Node tempNode, Node pred, Node succ, ProcessConstants.NodeType type, UpdateManager updateManager)
      Insert a new node of type type 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 node
      pred - The predecessor of the new node.
      succ - The successor of the new node.
      type - the type 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, 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 node
      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 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 node
      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

      protected static Node performOperation(SessionToken session, ChangeableInstance instance, Node tempNode, Node pred, Node succ, ProcessConstants.NodeType type, UpdateManager updateManager)
      Insert a new node of type type 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 node
      pred - The predecessor of the new node.
      succ - The successor of the new node.
      type - the type 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, 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 ChangeableInstance
      pred - The predecessor of the new node.
      succ - The successor of the new node.
      type - the type 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, 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 ChangeableInstance
      tempNode - a dummy node object which is used to set the properties of the new node
      pred - The predecessor of the new node.
      succ - The successor of the new node.
      type - the type of the new node
      updateManager - the manager which is responsible for the graphical adaptation of the template (maybe null)
      Returns:
      The newly inserted node.