org.eclipse.viatra.query.runtime.localsearch.operations.extend

## Class ExtendOperation<T>

- java.lang.Object
- - org.eclipse.viatra.query.runtime.localsearch.operations.extend.ExtendOperation<T>

- All Implemented Interfaces:
    ISearchOperation
  Direct Known Subclasses:
    AggregatorExtend, CountOperation, ExpressionEval, ExtendConstant, ExtendToEStructuralFeatureSource, ExtendToEStructuralFeatureTarget, IterateOverChildren, IterateOverContainers, IterateOverEClassInstances, IterateOverEDatatypeInstances

      public abstract class ExtendOperation<T>
      extends java.lang.Object
      implements ISearchOperation

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.util.Iterator<T>` | `it`
    `protected int` | `position`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ExtendOperation(int position)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `execute(MatchingFrame frame, ISearchContext context)`
    `void` | `onBacktrack(MatchingFrame frame, ISearchContext context)` After the execution of the operation failed and `ISearchOperation.execute(MatchingFrame, ISearchContext)` returns false, the onBacktrack callback is evaluated.

    - ### 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.operations.ISearchOperation

      `getVariablePositions, onInitialize`

- - ### Field Detail

    - #### position

          protected int position

    - #### it

          protected java.util.Iterator<T> it

  - ### Constructor Detail

    - #### ExtendOperation

          public ExtendOperation(int position)

      Parameters:
        `position` -

  - ### Method Detail

    - #### onBacktrack

          public void onBacktrack(MatchingFrame frame,
                                  ISearchContext context)

      Description copied from interface: `ISearchOperation`
      After the execution of the operation failed and `ISearchOperation.execute(MatchingFrame, ISearchContext)` returns false, the onBacktrack callback is evaluated. Operations may use this method to clean up any temporary structures, and make the operation ready for a new execution.
      Specified by:
        `onBacktrack` in interface `ISearchOperation`

    - #### execute

          public boolean execute(MatchingFrame frame,
                                 ISearchContext context)

      Specified by:
        `execute` in interface `ISearchOperation`
      Returns:
        true if successful, or false if backtracking needed