org.eclipse.viatra.query.runtime.api.impl

## Class BaseQueryGroup

- java.lang.Object
- - org.eclipse.viatra.query.runtime.api.impl.BaseQueryGroup

- All Implemented Interfaces:
    IQueryGroup
  Direct Known Subclasses:
    BaseGeneratedPatternGroup, GenericQueryGroup, LazyLoadingQueryGroup, PackageBasedQueryGroup

      public abstract class BaseQueryGroup
      extends java.lang.Object
      implements IQueryGroup

  Base implementation of `IQueryGroup`.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BaseQueryGroup()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `prepare(AdvancedViatraQueryEngine engine)`
    `void` | `prepare(ViatraQueryEngine engine)` Initializes matchers for the group of patterns within an `ViatraQueryEngine`.

    - ### 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.api.IQueryGroup

      `getSpecifications`

- - ### Constructor Detail

    - #### BaseQueryGroup

          public BaseQueryGroup()

  - ### Method Detail

    - #### prepare

          public void prepare(ViatraQueryEngine engine)
                       throws ViatraQueryException

      Description copied from interface: `IQueryGroup`
      Initializes matchers for the group of patterns within an `ViatraQueryEngine`. If some of the pattern matchers are already constructed in the engine, no task is performed for them.

      This preparation step has the advantage that it prepares pattern matchers for an arbitrary number of patterns in a single-pass traversal of the model. This is typically more efficient than traversing the model each time an individual pattern matcher is initialized on demand. The performance benefit only manifests itself if the engine is not in wildcard mode.

      Specified by:
        `prepare` in interface `IQueryGroup`
      Parameters:
        `engine` - the existing VIATRA Query engine in which the matchers will be created.
      Throws:
        `ViatraQueryException` - if there was an error in preparing the engine

    - #### prepare

          protected void prepare(AdvancedViatraQueryEngine engine)
                          throws ViatraQueryException

      Throws:
        `ViatraQueryException`