org.eclipse.incquery.runtime.api.impl

## Class BasePatternGroup

- java.lang.Object
- - org.eclipse.incquery.runtime.api.impl.BasePatternGroup

- All Implemented Interfaces:
    IQueryGroup
  Direct Known Subclasses:
    BaseGeneratedPatternGroup, GenericPatternGroup, PackageBasedPatternGroup

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

  Base implementation of `IQueryGroup`.
  Author:
    Mark Czotter

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BasePatternGroup()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `prepare(IncQueryEngine engine)` Initializes matchers for the group of patterns within an `IncQueryEngine`.
    `void` | `prepare(org.eclipse.emf.common.notify.Notifier emfRoot)` Initializes the contained patterns over a given EMF model root (recommended: Resource or ResourceSet).

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

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

    - ### Methods inherited from interface org.eclipse.incquery.runtime.api.IQueryGroup

      `getSpecifications`

- - ### Constructor Detail

    - #### BasePatternGroup

          public BasePatternGroup()

  - ### Method Detail

    - #### prepare

          public void prepare(org.eclipse.emf.common.notify.Notifier emfRoot)
                       throws IncQueryException

      Description copied from interface: `IQueryGroup`
      Initializes the contained patterns over a given EMF model root (recommended: Resource or ResourceSet). If a pattern matcher engine with the same root already exists, it will be reused.

      The scope of pattern matching will be the given EMF model root and below (see FAQ for more precise definition). The match set will be incrementally refreshed upon updates from this scope.

      Specified by:
        `prepare` in interface `IQueryGroup`
      Parameters:
        `emfRoot` - the root of the EMF tree where the pattern matchers will operate. Recommended: Resource or ResourceSet.
      Throws:
        `IncQueryException` - if an error occurs during pattern matcher creation

    - #### prepare

          public void prepare(IncQueryEngine engine)
                       throws IncQueryException

      Description copied from interface: `IQueryGroup`
      Initializes matchers for the group of patterns within an `IncQueryEngine`. 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 IncQuery engine in which the matchers will be created.
      Throws:
        `IncQueryException` - if there was an error in preparing the engine