org.eclipse.viatra.query.runtime.emf

## Class DynamicEMFQueryRuntimeContext

- java.lang.Object
- - org.eclipse.viatra.query.runtime.matchers.context.AbstractQueryRuntimeContext
  - - org.eclipse.viatra.query.runtime.emf.EMFQueryRuntimeContext
    - - org.eclipse.viatra.query.runtime.emf.DynamicEMFQueryRuntimeContext

- All Implemented Interfaces:
    IQueryRuntimeContext

      public class DynamicEMFQueryRuntimeContext
      extends EMFQueryRuntimeContext

  In dynamic EMF mode, we need to make sure that EEnum literal constants and values returned by eval() expressions are canonicalized in the same way as enum literals from the EMF model.

  This canonicalization is a one-way mapping, so `EMFQueryRuntimeContext.unwrapElement(Object)` and `#unwrapTuple(Object)` remain NOPs.

- - ### Field Summary

    - ### Fields inherited from class org.eclipse.viatra.query.runtime.emf.EMFQueryRuntimeContext

      `baseIndex, indexedClasses, indexedDataTypes, indexedFeatures, logger, metaContext`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DynamicEMFQueryRuntimeContext(NavigationHelper baseIndex, org.apache.log4j.Logger logger, EMFScope emfScope)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.Object` | `wrapElement(java.lang.Object externalElement)` Wraps the external element into the internal representation that is to be used by the query backend
    `Tuple` | `wrapTuple(Tuple externalElements)` Unwraps the tuple of elements into the internal representation that is to be used by the query backend

    - ### Methods inherited from class org.eclipse.viatra.query.runtime.emf.EMFQueryRuntimeContext

      `addUpdateListener, coalesceTraversals, containsTuple, countTuples, dispose, ensureEnumerableKey, ensureIndexed, ensureIndexed, ensureIndexed, ensureIndexed, ensureValidKey, ensureWildcardIndexing, enumerateTuples, enumerateValues, estimateAverageBucketSize, estimateCardinality, executeAfterTraversal, getCurrentIndexingServiceFor, getEmfScope, getMetaContext, illegalEnumerateValues, illegalInputKey, isCoalescing, isIndexed, removeUpdateListener, unwrapElement, unwrapTuple`

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

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

- - ### Constructor Detail

    - #### DynamicEMFQueryRuntimeContext

          public DynamicEMFQueryRuntimeContext(NavigationHelper baseIndex,
                                               org.apache.log4j.Logger logger,
                                               EMFScope emfScope)

  - ### Method Detail

    - #### wrapElement

          public java.lang.Object wrapElement(java.lang.Object externalElement)

      Description copied from interface: `IQueryRuntimeContext`
      Wraps the external element into the internal representation that is to be used by the query backend

      model element -> internal object.

      null must be mapped to null.

      Specified by:
        `wrapElement` in interface `IQueryRuntimeContext`
      Overrides:
        `wrapElement` in class `EMFQueryRuntimeContext`

    - #### wrapTuple

          public Tuple wrapTuple(Tuple externalElements)

      Description copied from interface: `IQueryRuntimeContext`
      Unwraps the tuple of elements into the internal representation that is to be used by the query backend

      model elements -> internal objects

      null must be mapped to null.

      Specified by:
        `wrapTuple` in interface `IQueryRuntimeContext`
      Overrides:
        `wrapTuple` in class `EMFQueryRuntimeContext`