org.eclipse.incquery.runtime.api

## Interface IncQueryMatcher<Match extends IPatternMatch>

- Type Parameters:
    `Match` - the IPatternMatch type representing a single match of this pattern.
  All Known Implementing Classes:
    ActionContextMatcher, ActionInputMatcher, ActionOutputMatcher, ActivityEdgeInGroupMatcher, ActivityGroupContainedEdgeMatcher, ActivityGroupContainedNodeMatcher, ActivityGroupInActivityMatcher, ActivityGroupMatcher, ActivityGroupSubgroupMatcher, ActivityGroupSuperGroupMatcher, ActivityNodeActivityMatcher, ActivityNodeInGroupMatcher, ActivityNodeMatcher, AssociationEndTypeMatcher, BaseMatcher, BehaviorContextMatcher, ChildrenMatcher, ClassExtensionMatcher, ClassifierAllParentsMatcher, ClassifierAttributeMatcher, ClassifierFeatureMatcher, ClassifierGeneralMatcher, ClassifierParentsMatcher, ClassSuperClassMatcher, ConnectableElementEndMatcher, ConnectorKindMatcher, DeploymentTargetDeployedElementMatcher, DirectedRelationshipSourceMatcher, DirectedRelationshipTargetMatcher, ElementOwnedElementMatcher, ElementOwnerMatcher, EmptyTraceMatcher, EncapsulatedClassifierOwnedPortMatcher, ExtensionMetaclassEndMatcher, ExtensionMetaclassMatcher, FeatureFeaturingClassifierMatcher, GenericPatternMatcher, GenericPatternMatcher, MessageMessageKindMatcher, NamedElementClientDependencyMatcher, NamedElementNamespaceMatcher, NamedElementQualifiedNameMatcher, NamespaceImportedMemberMatcher, NamespaceMemberMatcher, NamespaceOwnedMemberMatcher, OpaqueExpressionResultMatcher, OperationReturnResultMatcher, PackageNestedPackageMatcher, PackageNestingPackageMatcher, PackageOwnedStereotypeMatcher, PackageOwnedTypeMatcher, PackageVisibleMemberMatcher, Param2containmentMatcher, Param2edgeMatcher, Param2itemMatcher, Param2targetMatcher, PropertyIsCompositeMatcher, ProtocolTransitionReferredMatcher, RedefinableElementRedefinedElementMatcher, RedefinableElementRedefinitionContextMatcher, RedefinableTemplateSignatureInheritedParameterMatcher, RelationshipRelatedElementMatcher, StateIsCompositeMatcher, StateIsOrthogonalMatcher, StructuredClassifierPartMatcher, StructuredClassifierRoleMatcher, Trace2objectMatcher, Trace2paramMatcher, Trace2targetMatcher, TraceMatcher, TypePackageMatcher, VertexIncomingMatcher, VertexOutgoingMatcher

      public interface IncQueryMatcher<Match extends IPatternMatch>

  Interface for an IncQuery matcher associated with a graph pattern.
  Author:
    Bergmann Gábor

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `countMatches()` Returns the number of all pattern matches.
    `int` | `countMatches(Match partialMatch)` Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
    `void` | `forEachMatch(IMatchProcessor<? super Match> processor)` Executes the given processor on each match of the pattern.
    `void` | `forEachMatch(Match partialMatch, IMatchProcessor<? super Match> processor)` Executes the given processor on each match of the pattern that conforms to the given fixed values of some parameters.
    `boolean` | `forOneArbitraryMatch(IMatchProcessor<? super Match> processor)` Executes the given processor on an arbitrarily chosen match of the pattern.
    `boolean` | `forOneArbitraryMatch(Match partialMatch, IMatchProcessor<? super Match> processor)` Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
    `java.util.Collection<Match>` | `getAllMatches()` Returns the set of all pattern matches.
    `java.util.Collection<Match>` | `getAllMatches(Match partialMatch)` Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
    `java.util.Set<java.lang.Object>` | `getAllValues(java.lang.String parameterName)` Retrieve the set of values that occur in matches for the given parameterName.
    `java.util.Set<java.lang.Object>` | `getAllValues(java.lang.String parameterName, Match partialMatch)` Retrieve the set of values that occur in matches for the given parameterName, that conforms to the given fixed values of some parameters.
    `IncQueryEngine` | `getEngine()` Returns the engine that the matcher uses.
    `Match` | `getOneArbitraryMatch()` Returns an arbitrarily chosen pattern match.
    `Match` | `getOneArbitraryMatch(Match partialMatch)` Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
    `java.util.List<java.lang.String>` | `getParameterNames()` Returns the array of symbolic parameter names.
    `java.lang.String` | `getPatternName()` Fully qualified name of the pattern.
    `java.lang.Integer` | `getPositionOfParameter(java.lang.String parameterName)` Returns the index of the symbolic parameter with the given name.
    `IQuerySpecification<? extends IncQueryMatcher<Match>>` | `getSpecification()` The pattern that will be matched.
    `boolean` | `hasMatch(Match partialMatch)` Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, under any possible substitution of the unspecified parameters (if any).
    `Match` | `newEmptyMatch()` Returns an empty, mutable Match for the matcher.
    `Match` | `newMatch(java.lang.Object... parameters)` Returns a new (partial) Match object for the matcher.

- - ### Method Detail

    - #### getSpecification

          IQuerySpecification<? extends IncQueryMatcher<Match>> getSpecification()

      The pattern that will be matched.

    - #### getPatternName

          java.lang.String getPatternName()

      Fully qualified name of the pattern.

    - #### getPositionOfParameter

          java.lang.Integer getPositionOfParameter(java.lang.String parameterName)

      Returns the index of the symbolic parameter with the given name.

    - #### getParameterNames

          java.util.List<java.lang.String> getParameterNames()

      Returns the array of symbolic parameter names.

    - #### getAllMatches

          java.util.Collection<Match> getAllMatches()

      Returns the set of all pattern matches.
      Returns:
        matches represented as a Match object.

    - #### getAllMatches

          java.util.Collection<Match> getAllMatches(Match partialMatch)

      Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
      Parameters:
        `partialMatch` - a partial match of the pattern where each non-null field binds the corresponding pattern parameter to a fixed value.
      Returns:
        matches represented as a Match object.

    - #### getOneArbitraryMatch

          Match getOneArbitraryMatch()

      Returns an arbitrarily chosen pattern match. Neither determinism nor randomness of selection is guaranteed.
      Returns:
        a match represented as a Match object, or null if no match is found.

    - #### getOneArbitraryMatch

          Match getOneArbitraryMatch(Match partialMatch)

      Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. Neither determinism nor randomness of selection is guaranteed.
      Parameters:
        `partialMatch` - a partial match of the pattern where each non-null field binds the corresponding pattern parameter to a fixed value.
      Returns:
        a match represented as a Match object, or null if no match is found.

    - #### hasMatch

          boolean hasMatch(Match partialMatch)

      Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, under any possible substitution of the unspecified parameters (if any).
      Parameters:
        `partialMatch` - a (partial) match of the pattern where each non-null field binds the corresponding pattern parameter to a fixed value.
      Returns:
        true if the input is a valid (partial) match of the pattern.

    - #### countMatches

          int countMatches()

      Returns the number of all pattern matches.
      Returns:
        the number of pattern matches found.

    - #### countMatches

          int countMatches(Match partialMatch)

      Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
      Parameters:
        `partialMatch` - a partial match of the pattern where each non-null field binds the corresponding pattern parameter to a fixed value.
      Returns:
        the number of pattern matches found.

    - #### forEachMatch

          void forEachMatch(IMatchProcessor<? super Match> processor)

      Executes the given processor on each match of the pattern.
      Parameters:
        `processor` - the action that will process each pattern match.

    - #### forEachMatch

          void forEachMatch(Match partialMatch,
                            IMatchProcessor<? super Match> processor)

      Executes the given processor on each match of the pattern that conforms to the given fixed values of some parameters.
      Parameters:
        `partialMatch` - array where each non-null element binds the corresponding pattern parameter to a fixed value.
        `processor` - the action that will process each pattern match.

    - #### forOneArbitraryMatch

          boolean forOneArbitraryMatch(IMatchProcessor<? super Match> processor)

      Executes the given processor on an arbitrarily chosen match of the pattern. Neither determinism nor randomness of selection is guaranteed.
      Parameters:
        `processor` - the action that will process the selected match.
      Returns:
        true if the pattern has at least one match, false if the processor was not invoked

    - #### forOneArbitraryMatch

          boolean forOneArbitraryMatch(Match partialMatch,
                                       IMatchProcessor<? super Match> processor)

      Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. Neither determinism nor randomness of selection is guaranteed.
      Parameters:
        `partialMatch` - array where each non-null element binds the corresponding pattern parameter to a fixed value.
        `processor` - the action that will process the selected match.
      Returns:
        true if the pattern has at least one match with the given parameter values, false if the processor was not invoked

    - #### newEmptyMatch

          Match newEmptyMatch()

      Returns an empty, mutable Match for the matcher. Fields of the mutable match can be filled to create a partial match, usable as matcher input. This can be used to call the matcher with a partial match even if the specific class of the matcher or the match is unknown.
      Returns:
        the empty match

    - #### newMatch

          Match newMatch(java.lang.Object... parameters)

      Returns a new (partial) Match object for the matcher. This can be used e.g. to call the matcher with a partial match.

      The returned match will be immutable. Use `newEmptyMatch()` to obtain a mutable match object.

      Parameters:
        `parameters` - the fixed value of pattern parameters, or null if not bound.
      Returns:
        the (partial) match object.

    - #### getAllValues

          java.util.Set<java.lang.Object> getAllValues(java.lang.String parameterName)

      Retrieve the set of values that occur in matches for the given parameterName.
      Parameters:
        `parameterName` - name of the parameter for which values are returned
      Returns:
        the Set of all values for the given parameter, null if the parameter with the given name does not exists, empty set if there are no matches

    - #### getAllValues

          java.util.Set<java.lang.Object> getAllValues(java.lang.String parameterName,
                                                       Match partialMatch)

      Retrieve the set of values that occur in matches for the given parameterName, that conforms to the given fixed values of some parameters.
      Parameters:
        `parameterName` - name of the parameter for which values are returned
        `partialMatch` - a partial match of the pattern where each non-null field binds the corresponding pattern parameter to a fixed value.
      Returns:
        the Set of all values for the given parameter, null if the parameter with the given name does not exists or if the parameter with the given name is set in partialMatch, empty set if there are no matches

    - #### getEngine

          IncQueryEngine getEngine()

      Returns the engine that the matcher uses.
      Returns:
        the engine