org.eclipse.viatra.query.runtime.api

## Class GenericPatternMatcher

- java.lang.Object
- - org.eclipse.viatra.query.runtime.internal.apiimpl.QueryResultWrapper
  - - org.eclipse.viatra.query.runtime.api.impl.BaseMatcher<GenericPatternMatch>
    - - org.eclipse.viatra.query.runtime.api.GenericPatternMatcher

- All Implemented Interfaces:
    ViatraQueryMatcher<GenericPatternMatch>

      public class GenericPatternMatcher
      extends BaseMatcher<GenericPatternMatch>

  This is a generic pattern matcher for any VIATRA pattern, with "interpretative" query execution. To use the pattern matcher on a given model, obtain a `GenericQuerySpecification` first, then invoke e.g. `BaseQuerySpecification.getMatcher(ViatraQueryEngine)`. in conjunction with `ViatraQueryEngine.on(org.eclipse.viatra.query.runtime.api.scope.QueryScope)`.

  Whenever available, consider using the pattern-specific generated matcher API instead.

  Matches of the pattern will be represented as `GenericPatternMatch`.

  Since:
    0.9
  See Also:
    `GenericPatternMatch`, `GenericMatchProcessor`, `GenericQuerySpecification`

- - ### Field Summary

    - ### Fields inherited from class org.eclipse.viatra.query.runtime.api.impl.BaseMatcher

      `engine, querySpecification`

    - ### Fields inherited from class org.eclipse.viatra.query.runtime.internal.apiimpl.QueryResultWrapper

      `backend`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `GenericPatternMatcher(GenericQuerySpecification<? extends GenericPatternMatcher> specification)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `GenericPatternMatch` | `arrayToMatch(java.lang.Object[] parameters)` Converts the array representation of a pattern match to an immutable Match object.
    `GenericPatternMatch` | `arrayToMatchMutable(java.lang.Object[] parameters)` Converts the array representation of a pattern match to a mutable Match object.
    `GenericQuerySpecification<? extends GenericPatternMatcher>` | `getSpecification()` The pattern that will be matched.
    `protected GenericPatternMatch` | `tupleToMatch(Tuple t)`

    - ### Methods inherited from class org.eclipse.viatra.query.runtime.api.impl.BaseMatcher

      `countMatches, countMatches, emptyArray, forEachMatch, forEachMatch, forOneArbitraryMatch, forOneArbitraryMatch, getAllMatches, getAllMatches, getAllValues, getAllValues, getCapabilities, getEngine, getOneArbitraryMatch, getOneArbitraryMatch, getParameterNames, getPatternName, getPositionOfParameter, hasMatch, hasMatch, matchToArray, newEmptyMatch, newMatch, rawAccumulateAllValues, rawCountMatches, rawForEachMatch, rawForOneArbitraryMatch, rawGetOneArbitraryMatch, rawHasMatch, rawStreamAllMatches, rawStreamAllValues, setBackend, streamAllMatches, streamAllMatches`

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

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

- - ### Constructor Detail

    - #### GenericPatternMatcher

          public GenericPatternMatcher(GenericQuerySpecification<? extends GenericPatternMatcher> specification)

      Since:
        1.4

  - ### Method Detail

    - #### arrayToMatch

          public GenericPatternMatch arrayToMatch(java.lang.Object[] parameters)

      Description copied from class: `BaseMatcher`
      Converts the array representation of a pattern match to an immutable Match object.
      Specified by:
        `arrayToMatch` in class `BaseMatcher<GenericPatternMatch>`

    - #### arrayToMatchMutable

          public GenericPatternMatch arrayToMatchMutable(java.lang.Object[] parameters)

      Description copied from class: `BaseMatcher`
      Converts the array representation of a pattern match to a mutable Match object.
      Specified by:
        `arrayToMatchMutable` in class `BaseMatcher<GenericPatternMatch>`

    - #### tupleToMatch

          protected GenericPatternMatch tupleToMatch(Tuple t)

      Specified by:
        `tupleToMatch` in class `BaseMatcher<GenericPatternMatch>`

    - #### getSpecification

          public GenericQuerySpecification<? extends GenericPatternMatcher> getSpecification()

      Description copied from interface: `ViatraQueryMatcher`
      The pattern that will be matched.
      Specified by:
        `getSpecification` in interface `ViatraQueryMatcher<GenericPatternMatch>`
      Overrides:
        `getSpecification` in class `BaseMatcher<GenericPatternMatch>`