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

## Class BasePatternMatch

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

- All Implemented Interfaces:
    java.lang.Cloneable, IPatternMatch
  Direct Known Subclasses:
    ActionContextMatch, ActionInputMatch, ActionOutputMatch, ActivityEdgeInGroupMatch, ActivityGroupContainedEdgeMatch, ActivityGroupContainedNodeMatch, ActivityGroupInActivityMatch, ActivityGroupMatch, ActivityGroupSubgroupMatch, ActivityGroupSuperGroupMatch, ActivityNodeActivityMatch, ActivityNodeInGroupMatch, ActivityNodeMatch, AndPatternMatch, AssociationEndTypeMatch, AtomicEventPatternMatch, BehaviorContextMatch, ChildrenMatch, ClassExtensionMatch, ClassifierAttributeMatch, ClassifierFeatureMatch, ClassifierGeneralMatch, ClassSuperClassMatch, ComplexAndTransitionMatch, ComplexFollowsTransitionMatch, ComplexNotTransitionMatch, ComplexOrTransitionMatch, ConnectableElementEndMatch, ConnectorKindMatch, DeploymentTargetDeployedElementMatch, DirectedRelationshipSourceMatch, DirectedRelationshipTargetMatch, ElementOwnedElementMatch, ElementOwnerMatch, EmptyTraceMatch, EnabledNegativeTransitionMatch, EnabledTransitionMatch, EncapsulatedClassifierOwnedPortMatch, EpsilonTransitionMatch, EquivalentStatesMatch, EquivalentTransitionsMatch, EventProcessedByEventTokenMatch, EventTokensInModelMatch, ExtensionMetaclassMatch, FeatureFeaturingClassifierMatch, FinalStatesMatch, FinishedAutomatonMatch, FollowsPatternMatch, GenericPatternMatch, InitialStateMatch, InitStateMatch, LatestEventMatch, MessageMessageKindMatch, NamedElementClientDependencyMatch, NamedElementNamespaceMatch, NamedElementQualifiedNameMatch, NamespaceImportedMemberMatch, NamespaceMemberMatch, NamespaceOwnedMemberMatch, NegativeTransitionMatch, NegativeTransitionMatch, NonUnfoldedNotTransitionMatch, NotPatternMatch, OpaqueExpressionResultMatch, OrPatternMatch, PackageNestedPackageMatch, PackageNestingPackageMatch, PackageOwnedStereotypeMatch, PackageOwnedTypeMatch, Param2containmentMatch, Param2edgeMatch, Param2itemMatch, Param2targetMatch, PartiallyMatchedEventPatternMatch, PropertyIsCompositeMatch, ProtocolTransitionReferredMatch, RedefinableElementRedefinedElementMatch, RedefinableElementRedefinitionContextMatch, RedefinableTemplateSignatureInheritedParameterMatch, RelationshipRelatedElementMatch, ResettableEventTokenMatch, StateIsCompositeMatch, StateIsOrthogonalMatch, StructuredClassifierPartMatch, StructuredClassifierRoleMatch, TokenEntersTimedZoneMatch, TokenInFinalStateMatch, TokenInInitStateMatch, TokenInTimedZoneMatch, TokenInTrapStateMatch, TokenLeavesTimedZoneMatch, Trace2objectMatch, Trace2paramMatch, Trace2targetMatch, TraceMatch, TransitionWithEventTypeMatch, TranslatedEventPatternMatch, TrapStateMatch, TypePackageMatch, VertexIncomingMatch, VertexOutgoingMatch

      public abstract class BasePatternMatch
      extends java.lang.Object
      implements IPatternMatch

  Base implementation of IPatternMatch.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BasePatternMatch()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.Object` | `get(int position)` Returns the value of the parameter at the given position, or null if position is invalid.
    `boolean` | `isCompatibleWith(IPatternMatch other)` Checks that this match is compatible with the given other match.
    `protected static <T> java.util.List<T>` | `makeImmutableList(T... elements)`
    `java.util.List<java.lang.String>` | `parameterNames()` Returns the list of symbolic parameter names.
    `java.lang.String` | `patternName()` Identifies the name of the pattern for which this is a match.
    `static java.lang.String` | `prettyPrintFeature(java.lang.Object o, java.lang.String featureName)`
    `static java.lang.String` | `prettyPrintValue(java.lang.Object o)`
    `boolean` | `set(int position, java.lang.Object newValue)` Sets the parameter at the given position to the given value.
    `java.lang.String` | `toString()`

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

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

    - ### Methods inherited from interface org.eclipse.viatra.query.runtime.api.IPatternMatch

      `get, isMutable, prettyPrint, set, specification, toArray, toImmutable`

- - ### Constructor Detail

    - #### BasePatternMatch

          public BasePatternMatch()

  - ### Method Detail

    - #### makeImmutableList

          @SafeVarargs
          protected static <T> java.util.List<T> makeImmutableList(T... elements)

    - #### prettyPrintValue

          public static java.lang.String prettyPrintValue(java.lang.Object o)

    - #### prettyPrintFeature

          public static java.lang.String prettyPrintFeature(java.lang.Object o,
                                                            java.lang.String featureName)

    - #### get

          public java.lang.Object get(int position)

      Description copied from interface: `IPatternMatch`
      Returns the value of the parameter at the given position, or null if position is invalid.
      Specified by:
        `get` in interface `IPatternMatch`

    - #### set

          public boolean set(int position,
                             java.lang.Object newValue)

      Description copied from interface: `IPatternMatch`
      Sets the parameter at the given position to the given value.

      Works only if match is mutable. See `IPatternMatch.isMutable()`.

      Specified by:
        `set` in interface `IPatternMatch`

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### isCompatibleWith

          public boolean isCompatibleWith(IPatternMatch other)

      Description copied from interface: `IPatternMatch`
      Checks that this match is compatible with the given other match. This is used for filtering the match set of a matcher.

      Two non-null matches are compatible if and only if:
      - They share the same pattern.
      - For each parameter, where they are set (non-null) in both matches, their values are equal.

    Furthermore, all matches are considered compatible with null matches (e.g. empty filter).

Specified by:
  `isCompatibleWith` in interface `IPatternMatch`
Returns:
  true, if this is compatible with other, or other is null

- #### patternName

      public java.lang.String patternName()

  Description copied from interface: `IPatternMatch`
  Identifies the name of the pattern for which this is a match.
  Specified by:
    `patternName` in interface `IPatternMatch`

- #### parameterNames

      public java.util.List<java.lang.String> parameterNames()

  Description copied from interface: `IPatternMatch`
  Returns the list of symbolic parameter names.
  Specified by:
    `parameterNames` in interface `IPatternMatch`