Package org.eclipse.m2m.atl.emftvm.impl

# Class ExecEnvImpl

java.lang.Object
org.eclipse.emf.common.notify.impl.BasicNotifierImpl
org.eclipse.emf.ecore.impl.BasicEObjectImpl
org.eclipse.emf.ecore.impl.EObjectImpl
org.eclipse.m2m.atl.emftvm.impl.ExecEnvImpl

All Implemented Interfaces:
  `org.eclipse.emf.common.notify.Notifier`, `org.eclipse.emf.ecore.EObject`, `org.eclipse.emf.ecore.InternalEObject`, `ExecEnv`

public class ExecEnvImpl extends org.eclipse.emf.ecore.impl.EObjectImpl implements ExecEnv
An implementation of the model object 'Exec Env'.

## Nested Class Summary

## Nested classes/interfaces inherited from class org.eclipse.emf.ecore.impl.BasicEObjectImpl

`org.eclipse.emf.ecore.impl.BasicEObjectImpl.EPropertiesHolder, org.eclipse.emf.ecore.impl.BasicEObjectImpl.EPropertiesHolderBaseImpl, org.eclipse.emf.ecore.impl.BasicEObjectImpl.EPropertiesHolderImpl`

## Nested classes/interfaces inherited from class org.eclipse.emf.common.notify.impl.BasicNotifierImpl

`org.eclipse.emf.common.notify.impl.BasicNotifierImpl.EAdapterList<E extends Object & org.eclipse.emf.common.notify.Adapter>, org.eclipse.emf.common.notify.impl.BasicNotifierImpl.EObservableAdapterList, org.eclipse.emf.common.notify.impl.BasicNotifierImpl.EScannableAdapterList`

## Nested classes/interfaces inherited from interface org.eclipse.emf.ecore.InternalEObject

`org.eclipse.emf.ecore.InternalEObject.EStore`

## Field Summary

Fields
Modifier and Type
Field
Description
`protected final Validator<CodeBlock>`
`cbStackValidator`
Code block stack level validator.
`protected static final RuleMode`
`CURRENT_PHASE_EDEFAULT`
The default value of the '`Current Phase`' attribute.
`protected RuleMode`
`currentPhase`
The cached value of the '`Current Phase`' attribute.
`protected final Map<org.eclipse.emf.ecore.EObject,org.eclipse.m2m.atl.emftvm.impl.ExecEnvImpl.DeletionEntry>`
`deletionQueue`
Queue of elements to be deleted, along with the `StackFrame` context in which the deletion takes place.
`protected final FieldContainer`
`fieldContainer`
Field storage and lookup.
`protected final org.eclipse.emf.common.util.EList<Operation>`
`initChain`
The chain of '`init()`' operations to be executed before the automatic rules.
`protected final Map<org.eclipse.emf.ecore.resource.Resource,Model>`
`inoutModelOf`
Lookup table of (resource -> model).
`protected Map<String,Model>`
`inoutModels`
The cached value of the '`Inout Models`' attribute.
`protected final Map<org.eclipse.emf.ecore.resource.Resource,Model>`
`inputModelOf`
Lookup table of (resource -> model).
`protected Map<String,Model>`
`inputModels`
The cached value of the '`Input Models`' attribute.
`protected final Validator<Instruction>`
`instrStackValidator`
Instruction stack level validator.
`protected final Map<String,Model>`
`internalInoutModels`
The internal value of the '`Inout Models`' attribute.
`protected final Map<String,Model>`
`internalInputModels`
The internal value of the '`Input Models`' attribute.
`protected final Map<String,Metamodel>`
`internalMetaModels`
The internal value of the '`Meta Models`' attribute.
`protected final Map<String,Module>`
`internalModules`
The internal value of the '`Modules`' attribute.
`protected final Map<String,Model>`
`internalOutputModels`
The internal value of the '`Output Models`' attribute.
`protected static final boolean`
`JIT_DISABLED_EDEFAULT`
The default value of the '`Jit Disabled`' attribute.
`protected boolean`
`jitDisabled`
The cached value of the '`Jit Disabled`' attribute.
`protected final Set<String>`
`loadedModules`
Set of modules that have effectively been loaded.
`protected final org.eclipse.emf.common.util.EList<Operation>`
`mainChain`
The chain of '`main()`' operations to be executed after the automatic rules.
`protected TraceLinkSet`
`matches`
The cached value of the '`Matches`' reference.
`protected final Map<Metamodel,String>`
`metaModelId`
Lookup table of (metamodel -> ID).
`protected final Map<org.eclipse.emf.ecore.resource.Resource,Metamodel>`
`metaModelOf`
Lookup table of (resource -> metamodel).
`protected Map<String,Metamodel>`
`metaModels`
The cached value of the '`Meta Models`' attribute.
`protected boolean`
`modelCacheInit`
Model cache initialised?
`protected final Map<Model,String>`
`modelId`
Lookup table of (model -> ID).
`protected final Map<org.eclipse.emf.ecore.resource.Resource,Model>`
`modelOf`
Lookup table of (resource -> model).
`protected Map<String,Module>`
`modules`
The cached value of the '`Modules`' attribute.
`protected VMMonitor`
`monitor`
The `VMMonitor` for the currently running VM instance.
`protected final Map<String,Map<Integer,TypeMap<Object,Object>>>`
`operations`
Lookup table for operations: (name -> (argcount -> (context -> ?))) Depending on the number of arguments (argcount), several nested `TypeMap`s are contained, eventually pointing to an `Operation`.
`protected final Map<org.eclipse.emf.ecore.resource.Resource,Model>`
`outputModelOf`
Lookup table of (resource -> model).
`protected Map<String,Model>`
`outputModels`
The cached value of the '`Output Models`' attribute.
`protected final Map<org.eclipse.emf.ecore.EObject,org.eclipse.m2m.atl.emftvm.impl.ExecEnvImpl.RemapEntry>`
`remapQueue`
Queue of source/target values to be remapped, along with the `StackFrame` context in which the remapping takes place.
`protected final Map<String,Rule>`
`rules`
Lookup table for rules: (name -> rule).
`protected final Queue<org.eclipse.m2m.atl.emftvm.impl.ExecEnvImpl.QueueEntry>`
`setQueue`
`Queue` of features/fields to be set, along with the `StackFrame` context in which the set takes place.
`protected final Map<String,Map<Integer,TypeMap<Object,Object>>>`
`staticOperations`
Lookup table for static operations: (name -> (argcount -> (context -> ?))) Depending on the number of arguments (argcount), several nested `TypeMap`s are contained, eventually pointing to an `Operation`.
`protected TraceLinkSet`
`traces`
The cached value of the '`Traces`' reference.
`protected Map<TraceLink,Object>`
`uniqueResults`
The cached value of the '`Unique Results`' attribute.

### Fields inherited from class org.eclipse.emf.ecore.impl.EObjectImpl

`eAdapters, eContainer, eContainerFeatureID, EDELIVER, EDYNAMIC_CLASS, eFlags, ELAST_EOBJECT_FLAG, ELAST_NOTIFIER_FLAG, eProperties, EPROXY`

### Fields inherited from class org.eclipse.emf.ecore.impl.BasicEObjectImpl

`EVIRTUAL_GET, EVIRTUAL_IS_SET, EVIRTUAL_NO_VALUE, EVIRTUAL_SET, EVIRTUAL_UNSET`

### Fields inherited from interface org.eclipse.emf.ecore.InternalEObject

`EOPPOSITE_FEATURE_BASE`

## Constructor Summary

Constructors
Modifier
Constructor
Description
`protected`
`ExecEnvImpl()`
Creates a new `ExecEnvImpl`.

## Method Summary

Modifier and Type
Method
Description
`TraceLinkSet`
`basicGetMatches()`
Returns the value of the 'Matches' reference.
`TraceLinkSet`
`basicGetTraces()`
Returns the value of the 'Traces' reference.
`protected void`
`cacheModels()`
Caches run-time models in various lookup tables.
`protected void`
`clearModelCaches()`
Clears the model caches.
`void`
`clearModels()`
Removes all registered input, in/out, and output models from this `ExecEnv`.
`protected void`
`clearRuleModels(Rule r)`
Clears model references for a `Rule`.
`void`
`deleteQueue()`
Deletes all elements in the deletion queue.
`Object`
`eGet(int featureID, boolean resolve, boolean coreType)`
`boolean`
`eIsSet(int featureID)`
`void`
`eSet(int featureID, Object newValue)`
`protected org.eclipse.emf.ecore.EClass`
`eStaticClass()`
Returns the `EClass` that correspond to this metaclass.
`void`
`eUnset(int featureID)`
`Field`
`findField(Object context, String name)`
Finds a `Field` registered within this `ExecEnv`.
`Operation`
`findOperation(Object context, String name)`
Finds an `Operation` registered within this `ExecEnv`.
`Operation`
`findOperation(Object context, String name, Object parameterType)`
Finds an `Operation` registered within this `ExecEnv`.
`Operation`
`findOperation(Object context, String name, Object[] parameterTypes)`
Finds an `Operation` registered within this `ExecEnv`.
`Rule`
`findRule(String name)`
Finds a `Rule` registered within this `ExecEnv`.
`Field`
`findStaticField(Object context, String name)`
Finds a static `Field` registered within this `ExecEnv`.
`Operation`
`findStaticOperation(Object context, String name)`
Finds a static `Operation` registered within this `ExecEnv`.
`Operation`
`findStaticOperation(Object context, String name, Object parameterType)`
Finds a static `Operation` registered within this `ExecEnv`.
`Operation`
`findStaticOperation(Object context, String name, Object[] parameterTypes)`
Finds a static `Operation` registered within this `ExecEnv`.
`Object`
`findType(String modelName, String typeName)`
Finds the type for the given (meta-)`modelName` and `typeName`.
`RuleMode`
`getCurrentPhase()`
`Model`
`getInoutModelOf(org.eclipse.emf.ecore.EObject object)`
Returns the in/out `Model` that is registered in this `ExecEnv`, and that contains `object`.
`Map<String,Model>`
`getInoutModels()`
Returns the value of the 'Inout Models' attribute.
`Model`
`getInputModelOf(org.eclipse.emf.ecore.EObject object)`
Returns the input `Model` that is registered in this `ExecEnv`, and that contains `object`.
`Map<String,Model>`
`getInputModels()`
Returns the value of the 'Input Models' attribute.
`CodeBlockJIT`
`getJITCompiler()`
Returns the JIT compiler instance for this execution environment.
`TraceLinkSet`
`getMatches()`
Returns the value of the 'Matches' reference.
`Metamodel`
`getMetaModel(org.eclipse.emf.ecore.resource.Resource resource)`
Returns the `Metamodel` for the given `resource`, or `null`.
`String`
`getMetaModelID(Metamodel metamodel)`
Returns the ID under which `metamodel` is registered within this `ExecEnv`.
`Map<String,Metamodel>`
`getMetaModels()`
Returns the value of the 'Meta Models' attribute.
`String`
`getModelID(Model model)`
Returns the ID under which `model` is registered within this `ExecEnv`.
`Model`
`getModelOf(org.eclipse.emf.ecore.EObject object)`
Returns the `Model` that is registered in this `ExecEnv`, and that contains `object`.
`Map<String,Module>`
`getModules()`
Returns the value of the 'Modules' attribute.
`VMMonitor`
`getMonitor()`
`Model`
`getOutputModelOf(org.eclipse.emf.ecore.EObject object)`
Returns the output `Model` that is registered in this `ExecEnv`, and that contains `object`.
`Map<String,Model>`
`getOutputModels()`
Returns the value of the 'Output Models' attribute.
`LazyList<Rule>`
`getRules()`
Returns all rules registered in this `ExecEnv`.
`TraceLinkSet`
`getTraces()`
Returns the value of the 'Traces' reference.
`Map<TraceLink,Object>`
`getUniqueResults()`
Returns the value of the 'Unique Results' attribute.
`boolean`
`hasField(String name)`
Returns `true` iff this execution environment has any registered fields with the given `name`.
`boolean`
`hasOperation(String name, int argcount)`
Returns `true` iff this execution environment has any registered operations with the given `name` and `argcount`.
`boolean`
`hasStaticField(String name)`
Returns `true` iff this execution environment has any registered static fields with the given `name`.
`boolean`
`hasStaticOperation(String name, int argcount)`
Returns `true` iff this execution environment has any registered static operations with the given `name` and `argcount`.
`boolean`
`isJitDisabled()`
`protected boolean`
`isRuleStateCompiled()`
Returns whether the internal state of the rules has been compiled.
`Module`
`loadModule(ModuleResolver resolver, String name)`
Loads the module with the given `name` and its imports closure into this `ExecEnv` using the `resolver`, and registers its contents for execution.
`Module`
`loadModule(ModuleResolver resolver, String name, boolean validate)`
Loads the module with the given `name` and its imports closure into this `ExecEnv` using the `resolver`, and registers its contents for execution.
`void`
`queueForAdd(org.eclipse.emf.ecore.EStructuralFeature feature, org.eclipse.emf.ecore.EObject object, Object value, int index, StackFrame frame)`
Queues the given object and value for adding a value to the given feature.
`void`
`queueForAdd(Field field, Object object, Object value, int index, StackFrame frame)`
Queues the given object and value for adding a value to the given feature.
`void`
`queueForDelete(org.eclipse.emf.ecore.EObject element, StackFrame frame)`
Queues `element` for deletion.
`void`
`queueForRemap(org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EObject target, StackFrame frame)`
Queues the given source and target value for remapping.
`void`
`queueForRemove(org.eclipse.emf.ecore.EStructuralFeature feature, org.eclipse.emf.ecore.EObject object, Object value, StackFrame frame)`
Queues the given object and value for removing a value from the given feature.
`void`
`queueForRemove(Field field, Object object, Object value, StackFrame frame)`
Queues the given object and value for removing a value from the given feature.
`void`
`queueForSet(org.eclipse.emf.ecore.EStructuralFeature feature, org.eclipse.emf.ecore.EObject object, Object value, StackFrame frame)`
Queues the given object and value for setting the given feature.
`void`
`queueForSet(Field field, Object object, Object value, StackFrame frame)`
Queues the given object and value for setting the given field.
`void`
`queueXmiIDForAdd(org.eclipse.emf.ecore.EObject object, Object value, int index, StackFrame frame)`
Queues the given object and value for adding to the XMI ID.
`void`
`queueXmiIDForRemove(org.eclipse.emf.ecore.EObject object, Object value, StackFrame frame)`
Queues the given object and value for removing from the XMI ID.
`void`
`queueXmiIDForSet(org.eclipse.emf.ecore.EObject object, Object value, StackFrame frame)`
Queues the given object and value for setting the XMI ID.
`protected void`
`registerFeature(Feature feature)`
Registers a `Feature` into this `ExecEnv`.
`void`
`registerInOutModel(String name, Model model)`
Registers `model` as an in/out model under `name`.
`void`
`registerInputModel(String name, Model model)`
Registers `model` as an input model under `name`.
`void`
`registerMetaModel(String name, Metamodel metamodel)`
Registers `metamodel` under `name`.
`void`
`registerOutputModel(String name, Model model)`
Registers `model` as an output model under `name`.
`protected void`
`registerRule(Rule r)`
Registers a `Rule` into this `ExecEnv`.
`void`
`remapQueue()`
Processes all element in the "remap" queue.
`protected void`
`resetJITCompiler()`
Sets the JIT compiler instance for this execution environment to `null`.
`protected void`
`resolveRuleModels(Rule r)`
Resolves model references for a `Rule`.
`Object`
`run(TimingData timingData)`
Executes the loaded modules and returns the execution result.
`void`
`setJitDisabled(boolean newJitDisabled)`
`void`
`setMonitor(VMMonitor monitor)`
`void`
`setQueue()`
Processes all elements in the "set" queue.
`protected void`
`setRuleStateCompiled(boolean ruleStateCompiled)`
Sets whether the internal state of the rules has been compiled.
`String`
`toString()`

### Methods inherited from class org.eclipse.emf.ecore.impl.EObjectImpl

`eAdapters, eBasicAdapters, eBasicProperties, eBasicSetContainer, eClass, eContainerFeatureID, eDeliver, eInternalContainer, eInvoke, eIsProxy, eProperties, eSetClass, eSetDeliver, eSetProxyURI`

### Methods inherited from class org.eclipse.emf.ecore.impl.BasicEObjectImpl

`eAddVirtualValue, eAllContents, eBaseStructuralFeatureID, eBasicRemoveFromContainer, eBasicRemoveFromContainerFeature, eBasicSetContainer, eComputeVirtualValuesCapacity, eContainer, eContainerAdapterArray, eContainingFeature, eContainmentFeature, eContainmentFeature, eContains, eContents, eCrossReferences, eDerivedOperationID, eDerivedOperationID, eDerivedStructuralFeatureID, eDerivedStructuralFeatureID, eDirectResource, eDynamicBasicRemoveFromContainer, eDynamicClass, eDynamicFeature, eDynamicFeatureID, eDynamicGet, eDynamicGet, eDynamicGet, eDynamicInverseAdd, eDynamicInverseAdd, eDynamicInverseRemove, eDynamicInverseRemove, eDynamicInvoke, eDynamicInvoke, eDynamicIsSet, eDynamicIsSet, eDynamicIsSet, eDynamicSet, eDynamicSet, eDynamicSet, eDynamicUnset, eDynamicUnset, eDynamicUnset, eGet, eGet, eGet, eHasSettings, eInternalResource, eInverseAdd, eInverseAdd, eInverseRemove, eInverseRemove, eInvocationDelegate, eInvoke, eIsSet, eObjectForURIFragmentSegment, eOpenGet, eOpenIsSet, eOpenSet, eOpenUnset, eProxyURI, eRemoveVirtualValue, eResolveProxy, eResource, eSet, eSetDirectResource, eSetResource, eSetStore, eSetting, eSettingDelegate, eSettings, eSetVirtualIndexBits, eSetVirtualValue, eSetVirtualValues, eStaticFeatureCount, eStaticOperationCount, eStore, eUnset, eURIFragmentSegment, eVirtualBitCount, eVirtualGet, eVirtualGet, eVirtualIndex, eVirtualIndexBits, eVirtualIsSet, eVirtualSet, eVirtualUnset, eVirtualValue, eVirtualValues`

### Methods inherited from class org.eclipse.emf.common.notify.impl.BasicNotifierImpl

`eBasicAdapterArray, eBasicHasAdapters, eNotificationRequired, eNotify`

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

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

### Methods inherited from interface org.eclipse.emf.ecore.EObject

`eAllContents, eClass, eContainer, eContainingFeature, eContainmentFeature, eContents, eCrossReferences, eGet, eGet, eInvoke, eIsProxy, eIsSet, eResource, eSet, eUnset`

### Methods inherited from interface org.eclipse.emf.ecore.InternalEObject

`eNotificationRequired`

### Methods inherited from interface org.eclipse.emf.common.notify.Notifier

`eAdapters, eDeliver, eNotify, eSetDeliver`

## Field Details

### metaModels

protected Map<String,Metamodel> metaModels
The cached value of the '`Meta Models`' attribute.

See Also:
  - `getMetaModels()`

### inputModels

protected Map<String,Model> inputModels
The cached value of the '`Input Models`' attribute.

See Also:
  - `getInputModels()`

### inoutModels

protected Map<String,Model> inoutModels
The cached value of the '`Inout Models`' attribute.

See Also:
  - `getInoutModels()`

### outputModels

protected Map<String,Model> outputModels
The cached value of the '`Output Models`' attribute.

See Also:
  - `getOutputModels()`

### modules

protected Map<String,Module> modules
The cached value of the '`Modules`' attribute.

See Also:
  - `getModules()`

### matches

protected TraceLinkSet matches
The cached value of the '`Matches`' reference.

See Also:
  - `getMatches()`

### traces

protected TraceLinkSet traces
The cached value of the '`Traces`' reference.

See Also:
  - `getTraces()`

### uniqueResults

protected Map<TraceLink,Object> uniqueResults
The cached value of the '`Unique Results`' attribute.

See Also:
  - `getUniqueResults()`

### JIT_DISABLED_EDEFAULT

protected static final boolean JIT_DISABLED_EDEFAULT
The default value of the '`Jit Disabled`' attribute.

See Also:
  - `isJitDisabled()`
  - Constant Field Values

### jitDisabled

protected boolean jitDisabled
The cached value of the '`Jit Disabled`' attribute.

See Also:
  - `isJitDisabled()`

### CURRENT_PHASE_EDEFAULT

protected static final RuleMode CURRENT_PHASE_EDEFAULT
The default value of the '`Current Phase`' attribute.

See Also:
  - `getCurrentPhase()`

### currentPhase

protected RuleMode currentPhase
The cached value of the '`Current Phase`' attribute.

See Also:
  - `getCurrentPhase()`

### internalMetaModels

protected final Map<String,Metamodel> internalMetaModels
The internal value of the '`Meta Models`' attribute.

### internalInputModels

protected final Map<String,Model> internalInputModels
The internal value of the '`Input Models`' attribute.

### internalInoutModels

protected final Map<String,Model> internalInoutModels
The internal value of the '`Inout Models`' attribute.

### internalOutputModels

protected final Map<String,Model> internalOutputModels
The internal value of the '`Output Models`' attribute.

### internalModules

protected final Map<String,Module> internalModules
The internal value of the '`Modules`' attribute.

### loadedModules

protected final Set<String> loadedModules
Set of modules that have effectively been loaded. Intended for keeping track of cyclic imports.

### mainChain

protected final org.eclipse.emf.common.util.EList<Operation> mainChain
The chain of '`main()`' operations to be executed after the automatic rules.

### initChain

protected final org.eclipse.emf.common.util.EList<Operation> initChain
The chain of '`init()`' operations to be executed before the automatic rules.

### fieldContainer

protected final FieldContainer fieldContainer
Field storage and lookup.

### operations

protected final Map<String,Map<Integer,TypeMap<Object,Object>>> operations
Lookup table for operations: (name -> (argcount -> (context -> ?))) Depending on the number of arguments (argcount), several nested `TypeMap`s are contained, eventually pointing to an `Operation`. Example: for argcount = 2: (name -> (2 -> (context -> (arg1 -> (arg2 -> op)))))

### staticOperations

protected final Map<String,Map<Integer,TypeMap<Object,Object>>> staticOperations
Lookup table for static operations: (name -> (argcount -> (context -> ?))) Depending on the number of arguments (argcount), several nested `TypeMap`s are contained, eventually pointing to an `Operation`. Example: for argcount = 2: (name -> (2 -> (context -> (arg1 -> (arg2 -> op)))))

### rules

protected final Map<String,Rule> rules
Lookup table for rules: (name -> rule).

### modelOf

protected final Map<org.eclipse.emf.ecore.resource.Resource,Model> modelOf
Lookup table of (resource -> model).

### inputModelOf

protected final Map<org.eclipse.emf.ecore.resource.Resource,Model> inputModelOf
Lookup table of (resource -> model).

### inoutModelOf

protected final Map<org.eclipse.emf.ecore.resource.Resource,Model> inoutModelOf
Lookup table of (resource -> model).

### outputModelOf

protected final Map<org.eclipse.emf.ecore.resource.Resource,Model> outputModelOf
Lookup table of (resource -> model).

### metaModelOf

protected final Map<org.eclipse.emf.ecore.resource.Resource,Metamodel> metaModelOf
Lookup table of (resource -> metamodel).

### modelId

protected final Map<Model,String> modelId
Lookup table of (model -> ID).

### metaModelId

protected final Map<Metamodel,String> metaModelId
Lookup table of (metamodel -> ID).

### modelCacheInit

protected boolean modelCacheInit
Model cache initialised?

### monitor

protected VMMonitor monitor
The `VMMonitor` for the currently running VM instance.

### deletionQueue

protected final Map<org.eclipse.emf.ecore.EObject,org.eclipse.m2m.atl.emftvm.impl.ExecEnvImpl.DeletionEntry> deletionQueue
Queue of elements to be deleted, along with the `StackFrame` context in which the deletion takes place.

### setQueue

protected final Queue<org.eclipse.m2m.atl.emftvm.impl.ExecEnvImpl.QueueEntry> setQueue
`Queue` of features/fields to be set, along with the `StackFrame` context in which the set takes place.

### remapQueue

protected final Map<org.eclipse.emf.ecore.EObject,org.eclipse.m2m.atl.emftvm.impl.ExecEnvImpl.RemapEntry> remapQueue
Queue of source/target values to be remapped, along with the `StackFrame` context in which the remapping takes place. Only one queue entry per source value to remap is supported.

### cbStackValidator

protected final Validator<CodeBlock> cbStackValidator
Code block stack level validator.

### instrStackValidator

protected final Validator<Instruction> instrStackValidator
Instruction stack level validator.

## Constructor Details

### ExecEnvImpl

protected ExecEnvImpl()
Creates a new `ExecEnvImpl`.

## Method Details

### eStaticClass

protected org.eclipse.emf.ecore.EClass eStaticClass()
Returns the `EClass` that correspond to this metaclass.

Overrides:
  `eStaticClass` in class `org.eclipse.emf.ecore.impl.EObjectImpl`
Returns:
  the `EClass` that correspond to this metaclass.

### getModules

public Map<String,Module> getModules()
Returns the value of the 'Modules' attribute.

If the meaning of the 'Modules' reference list isn't clear, there really should be more of a description here...

Specified by:
  `getModules` in interface `ExecEnv`
Returns:
  the value of the 'Modules' attribute.
See Also:
  - `EmftvmPackage.getExecEnv_Modules()`

### getMatches

public TraceLinkSet getMatches()
Returns the value of the 'Matches' reference.

If the meaning of the 'Matches' reference isn't clear, there really should be more of a description here...

Specified by:
  `getMatches` in interface `ExecEnv`
Returns:
  the value of the 'Matches' reference.
See Also:
  - `EmftvmPackage.getExecEnv_Matches()`

### basicGetMatches

public TraceLinkSet basicGetMatches()
Returns the value of the 'Matches' reference.

Returns:
  the value of the 'Matches' reference.

### getTraces

public TraceLinkSet getTraces()
Returns the value of the 'Traces' reference.

If the meaning of the 'Traces' reference isn't clear, there really should be more of a description here...

Specified by:
  `getTraces` in interface `ExecEnv`
Returns:
  the value of the 'Traces' reference.
See Also:
  - `EmftvmPackage.getExecEnv_Traces()`

### basicGetTraces

public TraceLinkSet basicGetTraces()
Returns the value of the 'Traces' reference.

Returns:
  the value of the 'Traces' reference.

### getUniqueResults

public Map<TraceLink,Object> getUniqueResults()
Returns the value of the 'Unique Results' attribute.

If the meaning of the 'Unique Results' attribute isn't clear, there really should be more of a description here...

Specified by:
  `getUniqueResults` in interface `ExecEnv`
Returns:
  the value of the 'Unique Results' attribute.
See Also:
  - `EmftvmPackage.getExecEnv_UniqueResults()`

### isJitDisabled

public boolean isJitDisabled()

Specified by:
  `isJitDisabled` in interface `ExecEnv`
Returns:
  the value of the 'Jit Disabled' attribute.
See Also:
  - `ExecEnv.setJitDisabled(boolean)`
  - `EmftvmPackage.getExecEnv_JitDisabled()`

### setJitDisabled

public void setJitDisabled(boolean newJitDisabled)

Specified by:
  `setJitDisabled` in interface `ExecEnv`
Parameters:
  `newJitDisabled` - the new value of the 'Jit Disabled' attribute.
See Also:
  - `ExecEnv.isJitDisabled()`

### getCurrentPhase

public RuleMode getCurrentPhase()

Specified by:
  `getCurrentPhase` in interface `ExecEnv`
Returns:
  the value of the 'Current Phase' attribute.
See Also:
  - `RuleMode`
  - `EmftvmPackage.getExecEnv_CurrentPhase()`

### getMonitor

public VMMonitor getMonitor()

Returns the `VMMonitor` for the currently running VM instance.

Specified by:
  `getMonitor` in interface `ExecEnv`
Returns:
  the `VMMonitor` for the currently running VM instance.
See Also:
  - invalid reference

### setMonitor

public void setMonitor(VMMonitor monitor)

Specified by:
  `setMonitor` in interface `ExecEnv`

### registerMetaModel

public void registerMetaModel(String name, Metamodel metamodel)
Registers `metamodel` under `name`.

Specified by:
  `registerMetaModel` in interface `ExecEnv`
Parameters:
  `name` - the name under which to register
  `metamodel` - the metamodel to register

### registerInputModel

public void registerInputModel(String name, Model model)
Registers `model` as an input model under `name`.

Specified by:
  `registerInputModel` in interface `ExecEnv`
Parameters:
  `name` - the name under which to register
  `model` - the model to register

### registerInOutModel

public void registerInOutModel(String name, Model model)
Registers `model` as an in/out model under `name`.

Specified by:
  `registerInOutModel` in interface `ExecEnv`
Parameters:
  `name` - the name under which to register
  `model` - the model to register

### registerOutputModel

public void registerOutputModel(String name, Model model)
Registers `model` as an output model under `name`.

Specified by:
  `registerOutputModel` in interface `ExecEnv`
Parameters:
  `name` - the name under which to register
  `model` - the model to register

### clearModels

public void clearModels()
Removes all registered input, in/out, and output models from this `ExecEnv`.

Specified by:
  `clearModels` in interface `ExecEnv`

### getMetaModel

public Metamodel getMetaModel(org.eclipse.emf.ecore.resource.Resource resource)
Returns the `Metamodel` for the given `resource`, or `null`.

Specified by:
  `getMetaModel` in interface `ExecEnv`
Parameters:
  `resource` - the EMF `Resource` of the `Metamodel`
Returns:
  the `Metamodel`

### queueForSet

public void queueForSet(org.eclipse.emf.ecore.EStructuralFeature feature, org.eclipse.emf.ecore.EObject object, Object value, StackFrame frame)
Queues the given object and value for setting the given feature.

Specified by:
  `queueForSet` in interface `ExecEnv`
Parameters:
  `feature` - the feature to set
  `object` - the object for which to set the feature
  `value` - the feature value to set
  `frame` - the stack frame context in which to set the feature value

### queueForSet

public void queueForSet(Field field, Object object, Object value, StackFrame frame)
Queues the given object and value for setting the given field.

Specified by:
  `queueForSet` in interface `ExecEnv`
Parameters:
  `field` - the field to set
  `object` - the object for which to set the field
  `value` - the field value to set
  `frame` - the stack frame context in which to set the field value

### queueXmiIDForSet

public void queueXmiIDForSet(org.eclipse.emf.ecore.EObject object, Object value, StackFrame frame)
Queues the given object and value for setting the XMI ID.

Specified by:
  `queueXmiIDForSet` in interface `ExecEnv`
Parameters:
  `object` - the object for which to set the field
  `value` - the field value to set
  `frame` - the stack frame context in which to set the field value

### queueForAdd

public void queueForAdd(org.eclipse.emf.ecore.EStructuralFeature feature, org.eclipse.emf.ecore.EObject object, Object value, int index, StackFrame frame)
Queues the given object and value for adding a value to the given feature.

Specified by:
  `queueForAdd` in interface `ExecEnv`
Parameters:
  `feature` - the feature to add to
  `object` - the object for which to add to the feature
  `value` - the feature value to add
  `index` - the index at which to add, or `-1`
  `frame` - the stack frame context in which to add to the feature value

### queueForAdd

public void queueForAdd(Field field, Object object, Object value, int index, StackFrame frame)
Queues the given object and value for adding a value to the given feature.

Specified by:
  `queueForAdd` in interface `ExecEnv`
Parameters:
  `field` - the field to add to
  `object` - the object for which to add to the field
  `value` - the field value to add
  `index` - the index at which to add, or `-1`
  `frame` - the stack frame context in which to add to the field value

### queueXmiIDForAdd

public void queueXmiIDForAdd(org.eclipse.emf.ecore.EObject object, Object value, int index, StackFrame frame)
Queues the given object and value for adding to the XMI ID.

Specified by:
  `queueXmiIDForAdd` in interface `ExecEnv`
Parameters:
  `object` - the object for which to add to the field
  `value` - the field value to add
  `index` - the index at which to add, or `-1`
  `frame` - the stack frame context in which to add to the field value

### queueForRemove

public void queueForRemove(org.eclipse.emf.ecore.EStructuralFeature feature, org.eclipse.emf.ecore.EObject object, Object value, StackFrame frame)
Queues the given object and value for removing a value from the given feature.

Specified by:
  `queueForRemove` in interface `ExecEnv`
Parameters:
  `feature` - the feature to remove from
  `object` - the object for which to remove from the feature
  `value` - the feature value to remove
  `frame` - the stack frame context in which to remove from the feature value

### queueForRemove

public void queueForRemove(Field field, Object object, Object value, StackFrame frame)
Queues the given object and value for removing a value from the given feature.

Specified by:
  `queueForRemove` in interface `ExecEnv`
Parameters:
  `field` - the field to remove from
  `object` - the object for which to remove from the field
  `value` - the field value to remove
  `frame` - the stack frame context in which to remove from the field value

### queueXmiIDForRemove

public void queueXmiIDForRemove(org.eclipse.emf.ecore.EObject object, Object value, StackFrame frame)
Queues the given object and value for removing from the XMI ID.

Specified by:
  `queueXmiIDForRemove` in interface `ExecEnv`
Parameters:
  `object` - the object for which to remove from the field
  `value` - the field value to remove
  `frame` - the stack frame context in which to remove from the field value

### setQueue

public void setQueue()
Processes all elements in the "set" queue. Sets all queued features and fields, and clears the queue.

Specified by:
  `setQueue` in interface `ExecEnv`

### queueForRemap

public void queueForRemap(org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EObject target, StackFrame frame)
Queues the given source and target value for remapping.

Specified by:
  `queueForRemap` in interface `ExecEnv`
Parameters:
  `source` - the source value to remap
  `target` - the target value to map to
  `frame` - the stack frame context in which to remap

### remapQueue

public void remapQueue()
Processes all element in the "remap" queue. Remaps all queued source/target value pairs, and clears the queue.

Specified by:
  `remapQueue` in interface `ExecEnv`

### getMetaModels

public Map<String,Metamodel> getMetaModels()
Returns the value of the 'Meta Models' attribute. The default value is `""`.

If the meaning of the 'Meta Models' attribute isn't clear, there really should be more of a description here...

Specified by:
  `getMetaModels` in interface `ExecEnv`
Returns:
  the value of the 'Meta Models' attribute.
See Also:
  - `EmftvmPackage.getExecEnv_MetaModels()`

### getInputModels

public Map<String,Model> getInputModels()
Returns the value of the 'Input Models' attribute. The default value is `""`.

If the meaning of the 'Input Models' attribute isn't clear, there really should be more of a description here...

Specified by:
  `getInputModels` in interface `ExecEnv`
Returns:
  the value of the 'Input Models' attribute.
See Also:
  - `EmftvmPackage.getExecEnv_InputModels()`

### getInoutModels

public Map<String,Model> getInoutModels()
Returns the value of the 'Inout Models' attribute. The default value is `""`.

If the meaning of the 'Inout Models' attribute isn't clear, there really should be more of a description here...

Specified by:
  `getInoutModels` in interface `ExecEnv`
Returns:
  the value of the 'Inout Models' attribute.
See Also:
  - `EmftvmPackage.getExecEnv_InoutModels()`

### getOutputModels

public Map<String,Model> getOutputModels()
Returns the value of the 'Output Models' attribute. The default value is `""`.

If the meaning of the 'Output Models' attribute isn't clear, there really should be more of a description here...

Specified by:
  `getOutputModels` in interface `ExecEnv`
Returns:
  the value of the 'Output Models' attribute.
See Also:
  - `EmftvmPackage.getExecEnv_OutputModels()`

### loadModule

public Module loadModule(ModuleResolver resolver, String name)
Loads the module with the given `name` and its imports closure into this `ExecEnv` using the `resolver`, and registers its contents for execution.

Specified by:
  `loadModule` in interface `ExecEnv`
Parameters:
  `resolver` - the module file resolver
  `name` - the module name
Returns:
  the loaded module

### loadModule

public Module loadModule(ModuleResolver resolver, String name, boolean validate)
Loads the module with the given `name` and its imports closure into this `ExecEnv` using the `resolver`, and registers its contents for execution.

Specified by:
  `loadModule` in interface `ExecEnv`
Parameters:
  `resolver` - the module file resolver
  `name` - the module name
  `validate` - if `true`, validates the loaded bytecode
Returns:
  the loaded module

### registerFeature

protected void registerFeature(Feature feature)
Registers a `Feature` into this `ExecEnv`.

Parameters:
  `feature` - the `Feature` to register

### registerRule

protected void registerRule(Rule r)
Registers a `Rule` into this `ExecEnv`.

Parameters:
  `rule` - the `Rule` to register

### resolveRuleModels

protected void resolveRuleModels(Rule r)
Resolves model references for a `Rule`.

Parameters:
  `rule` - the `Rule` to resolve

### clearRuleModels

protected void clearRuleModels(Rule r)
Clears model references for a `Rule`.

Parameters:
  `rule` - the `Rule` to resolve

### findOperation

public Operation findOperation(Object context, String name, Object[] parameterTypes)
Finds an `Operation` registered within this `ExecEnv`.

Specified by:
  `findOperation` in interface `ExecEnv`
Parameters:
  `context` - the context type of the operation
  `name` - the operation name
  `parameterTypes` - the parameter types of the operation
Returns:
  the `Operation` with the given properties, or `null` if none registered

### findOperation

public Operation findOperation(Object context, String name)
Finds an `Operation` registered within this `ExecEnv`.

Specified by:
  `findOperation` in interface `ExecEnv`
Parameters:
  `context` - the context type of the operation
  `name` - the operation name
Returns:
  the `Operation` with the given properties, or `null` if none registered

### findOperation

public Operation findOperation(Object context, String name, Object parameterType)
Finds an `Operation` registered within this `ExecEnv`.

Specified by:
  `findOperation` in interface `ExecEnv`
Parameters:
  `context` - the context type of the operation
  `name` - the operation name
  `parameterType` - the parameter type of the operation
Returns:
  the `Operation` with the given properties, or `null` if none registered

### hasOperation

public boolean hasOperation(String name, int argcount)
Returns `true` iff this execution environment has any registered operations with the given `name` and `argcount`.

Specified by:
  `hasOperation` in interface `ExecEnv`
Parameters:
  `name` - the operation name
  `argcount` - the number of operation arguments (excluding `self`)
Returns:
  `true` iff this execution environment has any registered operations with the given `name` and `argcount`

### findStaticOperation

public Operation findStaticOperation(Object context, String name, Object[] parameterTypes)
Finds a static `Operation` registered within this `ExecEnv`.

Specified by:
  `findStaticOperation` in interface `ExecEnv`
Parameters:
  `context` - the context type of the operation
  `name` - the operation name
  `parameterTypes` - the parameter types of the operation
Returns:
  the static `Operation` with the given properties, or `null` if none registered

### findStaticOperation

public Operation findStaticOperation(Object context, String name)
Finds a static `Operation` registered within this `ExecEnv`.

Specified by:
  `findStaticOperation` in interface `ExecEnv`
Parameters:
  `context` - the context type of the operation
  `name` - the operation name
Returns:
  the static `Operation` with the given properties, or `null` if none registered

### findStaticOperation

public Operation findStaticOperation(Object context, String name, Object parameterType)
Finds a static `Operation` registered within this `ExecEnv`.

Specified by:
  `findStaticOperation` in interface `ExecEnv`
Parameters:
  `context` - the context type of the operation
  `name` - the operation name
  `parameterType` - the parameter type of the operation
Returns:
  the static `Operation` with the given properties, or `null` if none registered

### hasStaticOperation

public boolean hasStaticOperation(String name, int argcount)
Returns `true` iff this execution environment has any registered static operations with the given `name` and `argcount`.

Specified by:
  `hasStaticOperation` in interface `ExecEnv`
Parameters:
  `name` - the operation name
  `argcount` - the number of operation arguments
Returns:
  `true` iff this execution environment has any registered static operations with the given `name` and `argcount`

### findField

public Field findField(Object context, String name)
Finds a `Field` registered within this `ExecEnv`.

Specified by:
  `findField` in interface `ExecEnv`
Parameters:
  `context` - the context type of the field
  `name` - the operation name
Returns:
  the `Field` with the given properties, or `null` if none registered

### hasField

public boolean hasField(String name)
Returns `true` iff this execution environment has any registered fields with the given `name`.

Specified by:
  `hasField` in interface `ExecEnv`
Parameters:
  `name` - the field name
Returns:
  `true` iff this execution environment has any registered fields with the given `name`

### findStaticField

public Field findStaticField(Object context, String name)
Finds a static `Field` registered within this `ExecEnv`.

Specified by:
  `findStaticField` in interface `ExecEnv`
Parameters:
  `context` - the context type of the field
  `name` - the operation name
Returns:
  the static `Field` with the given properties, or `null` if none registered

### hasStaticField

public boolean hasStaticField(String name)
Returns `true` iff this execution environment has any registered static fields with the given `name`.

Specified by:
  `hasStaticField` in interface `ExecEnv`
Parameters:
  `name` - the field name
Returns:
  `true` iff this execution environment has any registered static fields with the given `name`

### findRule

public Rule findRule(String name)
Finds a `Rule` registered within this `ExecEnv`.

Specified by:
  `findRule` in interface `ExecEnv`
Parameters:
  `name` - the rule name
Returns:
  the `Rule` with the given name, or `null` if none registered

### findType

public Object findType(String modelName, String typeName) throws ClassNotFoundException
Finds the type for the given (meta-)`modelName` and `typeName`.

Specified by:
  `findType` in interface `ExecEnv`
Parameters:
  `modelName` - the name under which the metamodel that contains the type is registered
  `typeName` - the type/metaclass name (may be fully qualified using '`::`')
Returns:
  the type/metaclass
Throws:
  `ClassNotFoundException` - if the type is not found

### run

public Object run(TimingData timingData)
Executes the loaded modules and returns the execution result.

Specified by:
  `run` in interface `ExecEnv`
Parameters:
  `timingData` - the timing data object, or `null`
Returns:
  the execution result of the last loaded module's `main` operation

### cacheModels

protected void cacheModels()
Caches run-time models in various lookup tables.

### clearModelCaches

protected void clearModelCaches()
Clears the model caches.

### getRules

public LazyList<Rule> getRules()
Returns all rules registered in this `ExecEnv`.

Specified by:
  `getRules` in interface `ExecEnv`
Returns:
  all rules registered in this `ExecEnv`.

### getModelOf

public Model getModelOf(org.eclipse.emf.ecore.EObject object)
Returns the `Model` that is registered in this `ExecEnv`, and that contains `object`.

Specified by:
  `getModelOf` in interface `ExecEnv`
Parameters:
  `object` - the object for which to look up the containing model
Returns:
  the `Model` that contains `object`, or `null` if not found.

### getModelID

public String getModelID(Model model)
Returns the ID under which `model` is registered within this `ExecEnv`.

Specified by:
  `getModelID` in interface `ExecEnv`
Parameters:
  `model` - the registered `Model` to retrieve the ID for
Returns:
  the ID under which `model` is registered within this `ExecEnv`.

### getMetaModelID

public String getMetaModelID(Metamodel metamodel)
Returns the ID under which `metamodel` is registered within this `ExecEnv`.

Specified by:
  `getMetaModelID` in interface `ExecEnv`
Parameters:
  `metamodel` - the registered `Metamodel` to retrieve the ID for
Returns:
  the ID under which `metamodel` is registered within this `ExecEnv`.

### queueForDelete

public void queueForDelete(org.eclipse.emf.ecore.EObject element, StackFrame frame)
Queues `element` for deletion.

Specified by:
  `queueForDelete` in interface `ExecEnv`
Parameters:
  `element` - the element to delete
  `frame` - the stack frame context in which to perform the deletion

### deleteQueue

public void deleteQueue()
Deletes all elements in the deletion queue.

Specified by:
  `deleteQueue` in interface `ExecEnv`

### getInputModelOf

public Model getInputModelOf(org.eclipse.emf.ecore.EObject object)
Returns the input `Model` that is registered in this `ExecEnv`, and that contains `object`.

Specified by:
  `getInputModelOf` in interface `ExecEnv`
Parameters:
  `object` - the object for which to look up the containing model
Returns:
  the input `Model` that contains `object`, or `null` if not found.

### getInoutModelOf

public Model getInoutModelOf(org.eclipse.emf.ecore.EObject object)
Returns the in/out `Model` that is registered in this `ExecEnv`, and that contains `object`.

Specified by:
  `getInoutModelOf` in interface `ExecEnv`
Parameters:
  `object` - the object for which to look up the containing model
Returns:
  the in/out `Model` that contains `object`, or `null` if not found.

### getOutputModelOf

public Model getOutputModelOf(org.eclipse.emf.ecore.EObject object)
Returns the output `Model` that is registered in this `ExecEnv`, and that contains `object`.

Specified by:
  `getOutputModelOf` in interface `ExecEnv`
Parameters:
  `object` - the object for which to look up the containing model
Returns:
  the output `Model` that contains `object`, or `null` if not found.

### eGet

public Object eGet(int featureID, boolean resolve, boolean coreType)

Specified by:
  `eGet` in interface `org.eclipse.emf.ecore.InternalEObject`
Overrides:
  `eGet` in class `org.eclipse.emf.ecore.impl.BasicEObjectImpl`

### eSet

public void eSet(int featureID, Object newValue)

Specified by:
  `eSet` in interface `org.eclipse.emf.ecore.InternalEObject`
Overrides:
  `eSet` in class `org.eclipse.emf.ecore.impl.BasicEObjectImpl`

### eUnset

public void eUnset(int featureID)

Specified by:
  `eUnset` in interface `org.eclipse.emf.ecore.InternalEObject`
Overrides:
  `eUnset` in class `org.eclipse.emf.ecore.impl.BasicEObjectImpl`

### eIsSet

public boolean eIsSet(int featureID)

Specified by:
  `eIsSet` in interface `org.eclipse.emf.ecore.InternalEObject`
Overrides:
  `eIsSet` in class `org.eclipse.emf.ecore.impl.BasicEObjectImpl`

### toString

public String toString()

Overrides:
  `toString` in class `org.eclipse.emf.ecore.impl.BasicEObjectImpl`

### getJITCompiler

public CodeBlockJIT getJITCompiler()
Returns the JIT compiler instance for this execution environment.

Specified by:
  `getJITCompiler` in interface `ExecEnv`
Returns:
  the JIT compiler instance

### resetJITCompiler

protected void resetJITCompiler()
Sets the JIT compiler instance for this execution environment to `null`.

### isRuleStateCompiled

protected boolean isRuleStateCompiled()
Returns whether the internal state of the rules has been compiled.

Returns:
  the ruleStateCompiled

### setRuleStateCompiled

protected void setRuleStateCompiled(boolean ruleStateCompiled)
Sets whether the internal state of the rules has been compiled.

Parameters:
  `ruleStateCompiled` - the ruleStateCompiled to set