Class InsertEmptyBranch

java.lang.Object
de.aristaflow.adept2.core.changeoperations.InsertEmptyBranch

public class InsertEmptyBranch extends Object
Insert a branch between a split and its corresponding join node. Call isPossible first to check if the insertion is valid, than call perform operation to execute the change. TODO Refactor; use a common interface for change operations.
  • Field Details

    • logger

      protected static final Logger logger
      a Logger
  • Constructor Details

    • InsertEmptyBranch

      public InsertEmptyBranch()
  • Method Details

    • isPossible

      public static boolean isPossible(Template template, Node split, Node join)
      Checks if it is possible (concerning structural correctness) to insert an empty branch between split and join in the template.
      Parameters:
      template - the template the change is performed on
      split - the splitting node
      join - the joining node
      Returns:
      True, if it is possible
    • isPossible

      public static boolean isPossible(Template template, Node split, Node join, CheckReport checkReport)
      Checks if it is possible (concerning structural correctness) to insert an empty branch between split and join in the template. If it is not possible the reasons are stored in the checkReport.
      Parameters:
      template - the template the change is performed on
      split - the splitting node
      join - the joining 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 it is possible
    • isPossible

      public static boolean isPossible(ChangeableInstance instance, Node split, Node join)
      Checks if it is possible (concerning structural correctness) to insert an empty branch between split and join in the given instance.
      Parameters:
      instance - the instance the change is performed on
      split - the splitting node
      join - the joining node
      Returns:
      True, if it is possible
    • isPossible

      public static boolean isPossible(ChangeableInstance instance, Node split, Node join, CheckReport checkReport)
      Checks if it is possible (concerning structural and state-based correctness) to insert an empty branch between split and join in the given instance. If it is not possible the reasons are stored in the checkReport.
      Parameters:
      instance - the instance the change is performed on
      split - the splitting node
      join - the joining 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 it is possible
    • performOperation

      public static void performOperation(SessionToken session, ChangeableTemplate template, Node split, Node join)
      Inserts an empty branch between split and join in the given template.
      Parameters:
      session - The session which is used to check for access rights on this method.
      template - the related template
      split - the splitting node
      join - the joining node
    • performOperation

      public static void performOperation(SessionToken session, ChangeableTemplate template, Node split, Node join, UpdateManager updateManager)
      Inserts an empty branch between split and join in the given template (with updateManager).
      Parameters:
      session - The session which is used to check for access rights on this method.
      template - the related template
      split - the splitting node
      join - the joining node
      updateManager - the manager who controls the update of the visual graph components.
    • performOperation

      public static void performOperation(SessionToken session, ChangeableInstance instance, Node split, Node join)
      Inserts an empty branch between split and join in the given instance.
      Parameters:
      session - The session which is used to check for access rights on this method.
      instance - the changeable instance the change is performed on
      split - the splitting node
      join - the joining node
    • performOperation

      public static void performOperation(SessionToken session, ChangeableInstance instance, Node split, Node join, UpdateManager updateManager)
      Inserts an empty branch between split and join in the given instance (with updateManager).
      Parameters:
      session - The session which is used to check for access rights on this method.
      instance - the changeable instance the change is performed on
      split - the splitting node
      join - the joining node
      updateManager - the manager who controls the update of the visual graph components.
    • performOperation

      protected static void performOperation(SessionToken session, ChangePrimitives processGraph, Node split, Node join, 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
      split - the splitting node
      join - the joining node
      updateManager - the manager who controls the update of the visual graph components.