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

    • logger

      protected static final Logger logger
      a Logger
  • Constructor Details

    • DeleteNode

      public DeleteNode()
  • Method Details

    • 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 template
      node - 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 template
      node - the node to delete
      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 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 delete
      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 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 on
      node - 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 deleted
      node - 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 type type 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 deleted
      node - the node to delete
      type - the type of the node
      updateManager - 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 deleted
      node - 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 deleted
      node - a node 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, ChangeableInstance instance, Node node, ProcessConstants.NodeType type, UpdateManager updateManager)
      Deletes a node of type type 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 deleted
      node - the node to delete
      type - the type of the node
      updateManager - 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 ChangeableInstance
      node - the node to delete
      type - the type of the node
      updateManager - the manager which is responsible for the graphical adaptation of the template (maybe null)