Class EMFQueryMetaContext

  • All Implemented Interfaces:
    IQueryMetaContext

    public final class EMFQueryMetaContext
    extends AbstractQueryMetaContext
    The meta context information for EMF scopes.

    The runtime context may specialize answers with a given scope. In a static context, a conservative default version (DEFAULT) can be used instead.

    TODO generics?

    • Field Detail

      • DEFAULT

        public static final EMFQueryMetaContext DEFAULT
        Default static instance that only makes conservative assumptions that are valid for any EMFScope (but not if objects are used).
        Since:
        1.6
      • DEFAULT_SURROGATE

        public static final EMFQueryMetaContext DEFAULT_SURROGATE
        Default static instance that only makes conservative assumptions that are valid for any scope, even with surrogate objects. Unscoped types are used for inference, but not emitted as replacement candidates, as they cannot be checked at runtime.
        Since:
        2.1
    • Constructor Detail

      • EMFQueryMetaContext

        public EMFQueryMetaContext​(EMFScope scope)
        Instantiates a specialized meta information that is aware of scope-specific details.
        Since:
        2.1
    • Method Detail

      • isEnumerable

        public boolean isEnumerable​(IInputKey key)
        Description copied from interface: IQueryMetaContext
        Returns true iff instance tuples of the given key can be enumerated.

        If false, the runtime can only test tuple membership in the extensional relation identified by the key, but not enumerate member tuples in general.

        Equivalent to IInputKey.isEnumerable().

      • canLeadOutOfScope

        public boolean canLeadOutOfScope​(org.eclipse.emf.ecore.EReference reference)
        Tells whether the given reference may lead out of scope.
        Since:
        2.1
      • isStateless

        public boolean isStateless​(IInputKey key)
        Description copied from interface: IQueryMetaContext
        Returns true iff the set of instance tuples of the given key is immutable.

        If false, the runtime provides notifications upon change.

      • getFunctionalDependencies

        public java.util.Map<java.util.Set<java.lang.Integer>,​java.util.Set<java.lang.Integer>> getFunctionalDependencies​(IInputKey key)
        Description copied from interface: IQueryMetaContext
        Returns functional dependencies of the input key expressed in terms of column indices.

        Each entry of the map is a functional dependency rule, where the entry key specifies source columns and the entry value specifies target columns.

      • getImplications

        public java.util.Collection<InputKeyImplication> getImplications​(IInputKey implyingKey)
        Description copied from interface: IQueryMetaContext
        Returns known direct implications, e.g. edge supertypes, edge opposites, node type constraints, etc.

        Note that for the obvious reasons, enumerable keys can only be implied by enumerable keys.

      • getConditionalImplications

        public java.util.Map<InputKeyImplication,​java.util.Set<InputKeyImplication>> getConditionalImplications​(IInputKey implyingKey)
        Description copied from interface: IQueryMetaContext
        Returns known "double dispatch" implications, where the given implying key implies other input keys under certain additional conditions (themselves input keys). For example, a "type x, unscoped" input key may imply the "type x, in scope" input key under the condition of the input key "x is in scope"

        Note that for the obvious reasons, enumerable keys can only be implied by enumerable keys (either as the implying key or as the additional condition).

        Note that symmetry is not required, i.e. the additional conditions do not have to list the same conditional implication.

        Specified by:
        getConditionalImplications in interface IQueryMetaContext
        Overrides:
        getConditionalImplications in class AbstractQueryMetaContext
        Returns:
        multi-map, where the keys are additional conditions and the values are input key implications jointly implied by the condition and the given implying key.
      • ensureValidKey

        public void ensureValidKey​(IInputKey key)
      • illegalInputKey

        public void illegalInputKey​(IInputKey key)
      • isFeatureMultiplicityToOne

        public boolean isFeatureMultiplicityToOne​(org.eclipse.emf.ecore.EStructuralFeature feature)
      • isFeatureMultiplicityOneTo

        public boolean isFeatureMultiplicityOneTo​(org.eclipse.emf.ecore.EStructuralFeature typeObject)
      • isFeatureToOneMultiplicity

        public static boolean isFeatureToOneMultiplicity​(org.eclipse.emf.ecore.EStructuralFeature feature)
        Since:
        2.9
      • isFeatureOneToMultiplicity

        public static boolean isFeatureOneToMultiplicity​(org.eclipse.emf.ecore.EStructuralFeature typeObject)
        Since:
        2.9
      • featureSourceType

        public org.eclipse.emf.ecore.EClass featureSourceType​(org.eclipse.emf.ecore.EStructuralFeature feature)
      • featureTargetType

        public org.eclipse.emf.ecore.EClassifier featureTargetType​(org.eclipse.emf.ecore.EStructuralFeature typeObject)
      • featureOpposite

        public org.eclipse.emf.ecore.EReference featureOpposite​(org.eclipse.emf.ecore.EStructuralFeature typeObject)