Class ExecutionLoggerAdapter

java.lang.Object
tools.refinery.interpreter.localsearch.ExecutionLoggerAdapter
All Implemented Interfaces:
ILocalSearchAdapter

public final class ExecutionLoggerAdapter extends Object implements ILocalSearchAdapter
Since:
2.0
  • Constructor Details

    • ExecutionLoggerAdapter

      public ExecutionLoggerAdapter(Consumer<String> outputConsumer)
  • Method Details

    • patternMatchingStarted

      public void patternMatchingStarted(LocalSearchMatcher lsMatcher)
      Description copied from interface: ILocalSearchAdapter
      Callback method to indicate the start of a matching process
      Specified by:
      patternMatchingStarted in interface ILocalSearchAdapter
      Parameters:
      lsMatcher - the local search matcher that starts the matching
    • noMoreMatchesAvailable

      public void noMoreMatchesAvailable(LocalSearchMatcher lsMatcher)
      Description copied from interface: ILocalSearchAdapter
      Callback method to indicate the end of a matching process

      WARNING: It is not guaranteed that this method will be called; it is possible that a match process will end after a match is found and no other matches are accessed.
      Specified by:
      noMoreMatchesAvailable in interface ILocalSearchAdapter
      Parameters:
      lsMatcher - the local search matcher that finished
    • planChanged

      public void planChanged(Optional<SearchPlan> oldPlan, Optional<SearchPlan> newPlan)
      Description copied from interface: ILocalSearchAdapter
      Callback method to indicate switching to a new plan during the execution of a pattern matching
      Specified by:
      planChanged in interface ILocalSearchAdapter
      Parameters:
      oldPlan - the plan that is finished. Value is null when the first plan is starting.
      newPlan - the plan that will begin execution
    • operationSelected

      public void operationSelected(SearchPlan plan, ISearchOperation operation, MatchingFrame frame, boolean isBacktrack)
      Description copied from interface: ILocalSearchAdapter
      Callback method to indicate the selection of an operation to execute
      Specified by:
      operationSelected in interface ILocalSearchAdapter
      Parameters:
      plan - the current plan executor
      frame - the current matching frame
      isBacktrack - if true, the selected operation was reached via backtracking
    • operationExecuted

      public void operationExecuted(SearchPlan plan, ISearchOperation operation, MatchingFrame frame, boolean isSuccessful)
      Description copied from interface: ILocalSearchAdapter
      Callback method to indicate that an operation is executed
      Specified by:
      operationExecuted in interface ILocalSearchAdapter
      Parameters:
      plan - the current plan
      frame - the current matching frame
      isSuccessful - if true, the operation executed successfully, or false if the execution failed and backtracking will happen
    • matchFound

      public void matchFound(SearchPlan plan, MatchingFrame frame)
      Description copied from interface: ILocalSearchAdapter
      Callback that is used to indicate that a match has been found
      Specified by:
      matchFound in interface ILocalSearchAdapter
      Parameters:
      plan - the search plan executor that found the match
      frame - the frame that holds the substitutions of the variables that match
    • duplicateMatchFound

      public void duplicateMatchFound(MatchingFrame frame)
      Description copied from interface: ILocalSearchAdapter
      Callback that is used to indicate that the previously reported match has been found as a duplicate, thus will be ignored from the match results.
      Specified by:
      duplicateMatchFound in interface ILocalSearchAdapter
      Parameters:
      frame - the frame that holds the substitutions of the variables that match