org.eclipse.viatra.query.runtime.localsearch.planner.compiler

## Class AbstractOperationCompiler

- java.lang.Object
- - org.eclipse.viatra.query.runtime.localsearch.planner.compiler.AbstractOperationCompiler

- All Implemented Interfaces:
    IOperationCompiler
  Direct Known Subclasses:
    EMFOperationCompiler, GenericOperationCompiler

      public abstract class AbstractOperationCompiler
      extends java.lang.Object
      implements IOperationCompiler

  Since:
    1.7

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.util.Set<CallWithAdornment>` | `dependencies`
    `protected java.util.List<ISearchOperation>` | `operations`
    `protected IQueryRuntimeContext` | `runtimeContext`
    `protected static java.lang.String` | `UNSUPPORTED_TYPE_MESSAGE`
    `protected java.util.Map<PConstraint,java.util.Set<java.lang.Integer>>` | `variableBindings`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractOperationCompiler(IQueryRuntimeContext runtimeContext)`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.util.List<ISearchOperation>` | `compile(SubPlan plan, java.util.Set<PParameter> boundParameters)` Compiles a plan of `POperation`s to a list of type `List<ISearchOperation>`
    `protected void` | `createCheck(AggregatorConstraint aggregator, java.util.Map<PVariable,java.lang.Integer> variableMapping)`
    `protected void` | `createCheck(BinaryReflexiveTransitiveClosure binaryTransitiveClosure, java.util.Map<PVariable,java.lang.Integer> variableMapping)`
    `protected void` | `createCheck(BinaryTransitiveClosure binaryTransitiveClosure, java.util.Map<PVariable,java.lang.Integer> variableMapping)`
    `protected void` | `createCheck(ConstantValue constant, java.util.Map<PVariable,java.lang.Integer> variableMapping)`
    `protected void` | `createCheck(ExpressionEvaluation expressionEvaluation, java.util.Map<PVariable,java.lang.Integer> variableMapping)`
    `protected void` | `createCheck(Inequality inequality, java.util.Map<PVariable,java.lang.Integer> variableMapping)`
    `protected void` | `createCheck(NegativePatternCall negativePatternCall, java.util.Map<PVariable,java.lang.Integer> variableMapping)`
    `protected void` | `createCheck(PatternMatchCounter counter, java.util.Map<PVariable,java.lang.Integer> variableMapping)`
    `protected void` | `createCheck(PositivePatternCall pCall, java.util.Map<PVariable,java.lang.Integer> variableMapping)`
    `protected abstract void` | `createCheck(TypeConstraint typeConstraint, java.util.Map<PVariable,java.lang.Integer> variableMapping)`
    `protected abstract void` | `createCheck(TypeFilterConstraint typeConstraint, java.util.Map<PVariable,java.lang.Integer> variableMapping)`
    `protected void` | `createExtend(AggregatorConstraint aggregator, java.util.Map<PVariable,java.lang.Integer> variableMapping)`
    `protected void` | `createExtend(BinaryReflexiveTransitiveClosure binaryTransitiveClosure, java.util.Map<PVariable,java.lang.Integer> variableMapping)`
    `protected void` | `createExtend(BinaryTransitiveClosure binaryTransitiveClosure, java.util.Map<PVariable,java.lang.Integer> variableMapping)`
    `protected void` | `createExtend(ConstantValue constant, java.util.Map<PVariable,java.lang.Integer> variableMapping)`
    `protected void` | `createExtend(ExpressionEvaluation expressionEvaluation, java.util.Map<PVariable,java.lang.Integer> variableMapping)`
    `protected void` | `createExtend(PatternMatchCounter patternMatchCounter, java.util.Map<PVariable,java.lang.Integer> variableMapping)`
    `protected void` | `createExtend(PositivePatternCall pCall, java.util.Map<PVariable,java.lang.Integer> variableMapping)`
    `protected abstract void` | `createExtend(TypeConstraint typeConstraint, java.util.Map<PVariable,java.lang.Integer> variableMapping)`
    `protected void` | `createExtendDispatcher(PConstraint pConstraint, java.util.Map<PVariable,java.lang.Integer> variableMapping)`
    `protected abstract void` | `createUnaryTypeCheck(IInputKey type, int position)`
    `java.util.Set<CallWithAdornment>` | `getDependencies()` Replaces previous method returning `MatcherReference`
    `java.util.Map<PVariable,java.lang.Integer>` | `getVariableMappings()`

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

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

- - ### Field Detail

    - #### UNSUPPORTED_TYPE_MESSAGE

          protected static final java.lang.String UNSUPPORTED_TYPE_MESSAGE

      See Also:
        Constant Field Values

    - #### operations

          protected java.util.List<ISearchOperation> operations

    - #### dependencies

          protected java.util.Set<CallWithAdornment> dependencies

    - #### variableBindings

          protected java.util.Map<PConstraint,java.util.Set<java.lang.Integer>> variableBindings

    - #### runtimeContext

          protected final IQueryRuntimeContext runtimeContext

  - ### Constructor Detail

    - #### AbstractOperationCompiler

          public AbstractOperationCompiler(IQueryRuntimeContext runtimeContext)

  - ### Method Detail

    - #### createExtend

          protected abstract void createExtend(TypeConstraint typeConstraint,
                                               java.util.Map<PVariable,java.lang.Integer> variableMapping)

    - #### createCheck

          protected abstract void createCheck(TypeConstraint typeConstraint,
                                              java.util.Map<PVariable,java.lang.Integer> variableMapping)

      Throws:
        `ViatraQueryRuntimeException`

    - #### createCheck

          protected abstract void createCheck(TypeFilterConstraint typeConstraint,
                                              java.util.Map<PVariable,java.lang.Integer> variableMapping)

      Throws:
        `ViatraQueryRuntimeException`

    - #### createUnaryTypeCheck

          protected abstract void createUnaryTypeCheck(IInputKey type,
                                                       int position)

      Throws:
        `ViatraQueryRuntimeException`
      Since:
        2.0

    - #### compile

          public java.util.List<ISearchOperation> compile(SubPlan plan,
                                                          java.util.Set<PParameter> boundParameters)

      Compiles a plan of `POperation`s to a list of type `List<ISearchOperation>`
      Specified by:
        `compile` in interface `IOperationCompiler`
      Parameters:
        `plan` -
        `boundParameters` -
      Returns:
        an ordered list of POperations that make up the compiled search plan
      Throws:
        `ViatraQueryRuntimeException`

    - #### createExtendDispatcher

          protected void createExtendDispatcher(PConstraint pConstraint,
                                                java.util.Map<PVariable,java.lang.Integer> variableMapping)

    - #### getDependencies

          public java.util.Set<CallWithAdornment> getDependencies()

      Description copied from interface: `IOperationCompiler`
      Replaces previous method returning `MatcherReference`
      Specified by:
        `getDependencies` in interface `IOperationCompiler`

    - #### getVariableMappings

          public java.util.Map<PVariable,java.lang.Integer> getVariableMappings()

      Specified by:
        `getVariableMappings` in interface `IOperationCompiler`
      Returns:
        the cached variable bindings for the previously created plan

    - #### createCheck

          protected void createCheck(PatternMatchCounter counter,
                                     java.util.Map<PVariable,java.lang.Integer> variableMapping)

    - #### createCheck

          protected void createCheck(PositivePatternCall pCall,
                                     java.util.Map<PVariable,java.lang.Integer> variableMapping)

    - #### createCheck

          protected void createCheck(ConstantValue constant,
                                     java.util.Map<PVariable,java.lang.Integer> variableMapping)

    - #### createCheck

          protected void createCheck(BinaryTransitiveClosure binaryTransitiveClosure,
                                     java.util.Map<PVariable,java.lang.Integer> variableMapping)

    - #### createCheck

          protected void createCheck(BinaryReflexiveTransitiveClosure binaryTransitiveClosure,
                                     java.util.Map<PVariable,java.lang.Integer> variableMapping)

      Since:
        2.0

    - #### createCheck

          protected void createCheck(ExpressionEvaluation expressionEvaluation,
                                     java.util.Map<PVariable,java.lang.Integer> variableMapping)

    - #### createCheck

          protected void createCheck(AggregatorConstraint aggregator,
                                     java.util.Map<PVariable,java.lang.Integer> variableMapping)

    - #### createCheck

          protected void createCheck(NegativePatternCall negativePatternCall,
                                     java.util.Map<PVariable,java.lang.Integer> variableMapping)

    - #### createCheck

          protected void createCheck(Inequality inequality,
                                     java.util.Map<PVariable,java.lang.Integer> variableMapping)

    - #### createExtend

          protected void createExtend(PositivePatternCall pCall,
                                      java.util.Map<PVariable,java.lang.Integer> variableMapping)

    - #### createExtend

          protected void createExtend(BinaryTransitiveClosure binaryTransitiveClosure,
                                      java.util.Map<PVariable,java.lang.Integer> variableMapping)

    - #### createExtend

          protected void createExtend(BinaryReflexiveTransitiveClosure binaryTransitiveClosure,
                                      java.util.Map<PVariable,java.lang.Integer> variableMapping)

      Since:
        2.0

    - #### createExtend

          protected void createExtend(ConstantValue constant,
                                      java.util.Map<PVariable,java.lang.Integer> variableMapping)

    - #### createExtend

          protected void createExtend(ExpressionEvaluation expressionEvaluation,
                                      java.util.Map<PVariable,java.lang.Integer> variableMapping)

    - #### createExtend

          protected void createExtend(AggregatorConstraint aggregator,
                                      java.util.Map<PVariable,java.lang.Integer> variableMapping)

    - #### createExtend

          protected void createExtend(PatternMatchCounter patternMatchCounter,
                                      java.util.Map<PVariable,java.lang.Integer> variableMapping)