Package org.eclipse.viatra.query.runtime.localsearch

## Class ExecutionLoggerAdapter

- java.lang.Object
- - org.eclipse.viatra.query.runtime.localsearch.ExecutionLoggerAdapter

- All Implemented Interfaces:
    `ILocalSearchAdapter`

      public final class ExecutionLoggerAdapter
      extends java.lang.Object
      implements ILocalSearchAdapter

  Since:
    2.0

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `ExecutionLoggerAdapter​(java.util.function.Consumer<java.lang.String> outputConsumer)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `duplicateMatchFound​(MatchingFrame frame)` | 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.
    `void` | `matchFound​(SearchPlan plan, MatchingFrame frame)` | Callback that is used to indicate that a match has been found
    `void` | `noMoreMatchesAvailable​(LocalSearchMatcher lsMatcher)` | Callback method to indicate the end of a matching process
    `void` | `operationExecuted​(SearchPlan plan, ISearchOperation operation, MatchingFrame frame, boolean isSuccessful)` | Callback method to indicate that an operation is executed
    `void` | `operationSelected​(SearchPlan plan, ISearchOperation operation, MatchingFrame frame, boolean isBacktrack)` | Callback method to indicate the selection of an operation to execute
    `void` | `patternMatchingStarted​(LocalSearchMatcher lsMatcher)` | Callback method to indicate the start of a matching process
    `void` | `planChanged​(java.util.Optional<SearchPlan> oldPlan, java.util.Optional<SearchPlan> newPlan)` | Callback method to indicate switching to a new plan during the execution of a pattern matching

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.eclipse.viatra.query.runtime.localsearch.matcher.ILocalSearchAdapter

      `adapterRegistered, adapterUnregistered, executorInitializing`

- - ### Constructor Detail

    - #### ExecutionLoggerAdapter

          public ExecutionLoggerAdapter​(java.util.function.Consumer<java.lang.String> outputConsumer)

  - ### Method Detail

    - #### 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​(java.util.Optional<SearchPlan> oldPlan,
                                  java.util.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