Package org.eclipse.viatra.query.patternlanguage.emf.specification

## Class GenericSingleConstraintPQuery

- java.lang.Object
- - org.eclipse.viatra.query.runtime.matchers.psystem.queries.BasePQuery
  - - org.eclipse.viatra.query.patternlanguage.emf.specification.GenericSingleConstraintPQuery

- All Implemented Interfaces:
    `PTraceable`, `PQuery`, `PQueryHeader`

      public class GenericSingleConstraintPQuery
      extends BasePQuery

  This is a generic (i.e. not pattern-specific) class for the internal representation of VIATRA queries, for "interpretative" query execution.

  End users should use {link GenericQuerySpecification} instead.

  Since:
    2.0
  No Instantiate:
    This class is not intended to be instantiated by clients

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.eclipse.viatra.query.runtime.matchers.psystem.queries.PQuery

      `PQuery.PQueryStatus`

  - ### Field Summary

    - ### Fields inherited from class org.eclipse.viatra.query.runtime.matchers.psystem.queries.BasePQuery

      `pProblems, status, visibility`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `GenericSingleConstraintPQuery​(Pattern parentPattern, CallableRelation constraint, java.lang.String queryName)` | Initializes a generic query representation for a given pattern.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected java.util.Set<PBody>` | `doGetContainedBodies()` | Creates and returns the bodies of the query.
    `boolean` | `equals​(java.lang.Object obj)` |
    `java.lang.String` | `getFullyQualifiedName()` | Identifies the pattern for which matchers can be instantiated.
    `java.util.List<PParameter>` | `getParameters()` | Returns a list of parameter descriptions
    `Pattern` | `getPattern()` |
    `int` | `hashCode()` |

    - ### Methods inherited from class org.eclipse.viatra.query.runtime.matchers.psystem.queries.BasePQuery

      `addAnnotation, addError, checkMutability, ensureInitialized, getAllAnnotations, getAllReferredQueries, getAnnotationsByName, getDirectReferredQueries, getDisjunctBodies, getEvaluationHints, getFirstAnnotationByName, getParameterNames, getPositionOfParameter, getPProblems, getStatus, getTypeGuarantees, getVisibility, isMutable, publishedAs, setBodies, setEvaluationHints, setStatus, toString`

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

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

    - ### Methods inherited from interface org.eclipse.viatra.query.runtime.matchers.psystem.queries.PQueryHeader

      `getParameter, getSimpleName`

- - ### Constructor Detail

    - #### GenericSingleConstraintPQuery

          public GenericSingleConstraintPQuery​(Pattern parentPattern,
                                               CallableRelation constraint,
                                               java.lang.String queryName)

      Initializes a generic query representation for a given pattern.

      Warning: it is not recommended to directly instantiate GenericPQuery instances as they will not reuse previously built specifications- use `SpecificationBuilder` instead.

      Parameters:
        `pattern` - the pattern for which the matcher is to be constructed.
      Throws:
        `ViatraQueryRuntimeException`

  - ### Method Detail

    - #### getPattern

          public Pattern getPattern()

    - #### equals

          public boolean equals​(java.lang.Object obj)

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

    - #### hashCode

          public int hashCode()

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

    - #### getFullyQualifiedName

          public java.lang.String getFullyQualifiedName()

      Description copied from interface: `PQueryHeader`
      Identifies the pattern for which matchers can be instantiated.

    - #### getParameters

          public java.util.List<PParameter> getParameters()

      Description copied from interface: `PQueryHeader`
      Returns a list of parameter descriptions
      Returns:
        a non-null, but possibly empty list of parameter descriptions

    - #### doGetContainedBodies

          protected java.util.Set<PBody> doGetContainedBodies()

      Description copied from class: `BasePQuery`
      Creates and returns the bodies of the query. If recalled again, a new instance is created.
      Specified by:
        `doGetContainedBodies` in class `BasePQuery`
      Returns: