org.eclipse.incquery.runtime.rete.construction.plancompiler

## Class CompilerHelper

- java.lang.Object
- - org.eclipse.incquery.runtime.rete.construction.plancompiler.CompilerHelper

-     public class CompilerHelper
      extends java.lang.Object

  Author:
    Bergmann Gabor

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `CompilerHelper.JoinHelper` Calculated index mappings for a join, based on the common variables of the two parent subplans.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CompilerHelper()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static PlanningTrace` | `checkAndTrimEqualVariables(SubPlan plan, PlanningTrace coreTrace)` Makes sure that all variables in the tuple are different so that it can be used as `CompiledSubPlan`.
    `static java.util.List<PVariable>` | `convertVariablesTuple(EnumerablePConstraint constraint)` Extracts the variable list representation of the variables tuple.
    `static java.util.List<PVariable>` | `convertVariablesTuple(Tuple variablesTuple)` Extracts the variable list representation of the variables tuple.
    `static RecipeTraceInfo` | `makeIndexerTrace(SubPlan planToCompile, PlanningTrace parentTrace, TupleMask mask)` Returns a compiled indexer trace according to a mask
    `static Mask` | `makeProjectionMask(PlanningTrace compiledParent, java.lang.Iterable<PVariable> projectedVariables)`
    `static CompiledQuery` | `makeQueryTrace(PQuery query, java.util.Collection<RecipeTraceInfo> bodyFinalTraces, java.util.Collection<ReteNodeRecipe> bodyFinalRecipes)` Creates a recipe for a production node and the corresponding trace.

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

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

- - ### Constructor Detail

    - #### CompilerHelper

          public CompilerHelper()

  - ### Method Detail

    - #### checkAndTrimEqualVariables

          public static PlanningTrace checkAndTrimEqualVariables(SubPlan plan,
                                                                 PlanningTrace coreTrace)

      Makes sure that all variables in the tuple are different so that it can be used as `CompiledSubPlan`. If a variable occurs multiple times, equality checks are applied and then the results are trimmed so that duplicates are hidden. If no manipulation is necessary, the original trace is returned.

      to be used whenever a constraint introduces new variables.

    - #### convertVariablesTuple

          public static java.util.List<PVariable> convertVariablesTuple(EnumerablePConstraint constraint)

      Extracts the variable list representation of the variables tuple.

    - #### convertVariablesTuple

          public static java.util.List<PVariable> convertVariablesTuple(Tuple variablesTuple)

      Extracts the variable list representation of the variables tuple.

    - #### makeIndexerTrace

          public static RecipeTraceInfo makeIndexerTrace(SubPlan planToCompile,
                                                         PlanningTrace parentTrace,
                                                         TupleMask mask)

      Returns a compiled indexer trace according to a mask

    - #### makeProjectionMask

          public static Mask makeProjectionMask(PlanningTrace compiledParent,
                                                java.lang.Iterable<PVariable> projectedVariables)

    - #### makeQueryTrace

          public static CompiledQuery makeQueryTrace(PQuery query,
                                                     java.util.Collection<RecipeTraceInfo> bodyFinalTraces,
                                                     java.util.Collection<ReteNodeRecipe> bodyFinalRecipes)

      Creates a recipe for a production node and the corresponding trace.