org.eclipse.incquery.runtime.matchers.planning.helpers

## Class TypeHelper

- java.lang.Object
- - org.eclipse.incquery.runtime.matchers.planning.helpers.TypeHelper

-     public class TypeHelper
      extends java.lang.Object

  Author:
    Gabor Bergmann

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TypeHelper()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.util.Set<TypeJudgement>` | `getDirectJudgements(java.util.Set<PConstraint> constraints, IQueryMetaContext context)` Gets direct judgements reported by constraints.
    `static java.util.Map<PVariable,java.util.Set<TypeJudgement>>` | `inferUnaryTypes(java.util.Set<PConstraint> constraints, IQueryMetaContext context)` Infers unary type information for variables, based on the given constraints.
    `static java.util.Set<TypeJudgement>` | `subsumeTypes(java.util.Set<TypeJudgement> subsumableTypes, java.util.Set<TypeJudgement> subsumingTypes, IQueryMetaContext context)` Calculates a remainder set of types from a larger set, that are not subsumed by a given set of subsuming types.
    `static java.util.Set<TypeJudgement>` | `typeClosure(java.util.Set<TypeJudgement> typesToClose, IQueryMetaContext context)` Calculates the closure of a set of type judgements, with respect to supertyping.

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

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

- - ### Constructor Detail

    - #### TypeHelper

          public TypeHelper()

  - ### Method Detail

    - #### inferUnaryTypes

          public static java.util.Map<PVariable,java.util.Set<TypeJudgement>> inferUnaryTypes(java.util.Set<PConstraint> constraints,
                                                                                              IQueryMetaContext context)

      Infers unary type information for variables, based on the given constraints. Subsumptions are not taken into account.
      Parameters:
        `constraints` - the set of constraints to extract type info from

    - #### getDirectJudgements

          public static java.util.Set<TypeJudgement> getDirectJudgements(java.util.Set<PConstraint> constraints,
                                                                         IQueryMetaContext context)

      Gets direct judgements reported by constraints. No closure is applied yet.

    - #### typeClosure

          public static java.util.Set<TypeJudgement> typeClosure(java.util.Set<TypeJudgement> typesToClose,
                                                                 IQueryMetaContext context)

      Calculates the closure of a set of type judgements, with respect to supertyping.
      Returns:
        the set of all type judgements in typesToClose and all their direct and indirect supertypes

    - #### subsumeTypes

          public static java.util.Set<TypeJudgement> subsumeTypes(java.util.Set<TypeJudgement> subsumableTypes,
                                                                  java.util.Set<TypeJudgement> subsumingTypes,
                                                                  IQueryMetaContext context)

      Calculates a remainder set of types from a larger set, that are not subsumed by a given set of subsuming types.
      Parameters:
        `subsumableTypes` - a set of types from which some may be implied by the subsuming types
        `subsumingTypes` - a set of types that may imply some of the subsuming types
      Returns:
        the collection of types in subsumableTypes that are NOT identical to or supertypes of any type in subsumingTypes.