org.eclipse.ocl.examples.impactanalyzer.util
Class EcoreEvaluationEnvironmentWithScopedExtentMap

java.lang.Object
  extended by org.eclipse.ocl.AbstractEvaluationEnvironment<org.eclipse.emf.ecore.EClassifier,org.eclipse.emf.ecore.EOperation,org.eclipse.emf.ecore.EStructuralFeature,org.eclipse.emf.ecore.EClass,org.eclipse.emf.ecore.EObject>
      extended by org.eclipse.ocl.ecore.EcoreEvaluationEnvironment
          extended by org.eclipse.ocl.examples.impactanalyzer.util.EcoreEvaluationEnvironmentWithScopedExtentMap
All Implemented Interfaces:
EvaluationEnvironmentWithHiddenOpposites, EvaluationEnvironment<org.eclipse.emf.ecore.EClassifier,org.eclipse.emf.ecore.EOperation,org.eclipse.emf.ecore.EStructuralFeature,org.eclipse.emf.ecore.EClass,org.eclipse.emf.ecore.EObject>, EvaluationEnvironment.Enumerations<org.eclipse.emf.ecore.EEnumLiteral>, Customizable, Adaptable
Direct Known Subclasses:
PartialEcoreEvaluationEnvironment

public class EcoreEvaluationEnvironmentWithScopedExtentMap
extends EcoreEvaluationEnvironment


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.ocl.EvaluationEnvironment
EvaluationEnvironment.Enumerations<EL>
 
Constructor Summary
EcoreEvaluationEnvironmentWithScopedExtentMap(EcoreEnvironmentFactoryWithScopedExtentMap factory)
           
EcoreEvaluationEnvironmentWithScopedExtentMap(EvaluationEnvironment<org.eclipse.emf.ecore.EClassifier,org.eclipse.emf.ecore.EOperation,org.eclipse.emf.ecore.EStructuralFeature,org.eclipse.emf.ecore.EClass,org.eclipse.emf.ecore.EObject> parent)
           
 
Method Summary
 java.util.Map<org.eclipse.emf.ecore.EClass,java.util.Set<org.eclipse.emf.ecore.EObject>> createExtentMap(java.lang.Object object)
          Creates an extent map for invocation of OclType.allInstances() using the specified object as a context from which to find the scope in which OCL classifier extents are defined.
protected  EcoreEnvironmentFactoryWithScopedExtentMap getFactory()
           
 
Methods inherited from class org.eclipse.ocl.ecore.EcoreEvaluationEnvironment
callOperation, checkOperationReflectionConsistency, createTuple, getInvalidResult, getJavaMethodFor, getType, getValue, isKindOf, isTypeOf, navigateAssociationClass, navigateOppositeProperty, navigateProperty, setOperationReflectionCheckDisabled
 
Methods inherited from class org.eclipse.ocl.AbstractEvaluationEnvironment
add, basicGetOptions, clear, clearOptions, getAdapter, getOptions, getParent, getValue, getValueOf, isEnabled, overrides, putOptions, remove, removeOption, removeOptions, replace, setOption, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EcoreEvaluationEnvironmentWithScopedExtentMap

public EcoreEvaluationEnvironmentWithScopedExtentMap(EcoreEnvironmentFactoryWithScopedExtentMap factory)

EcoreEvaluationEnvironmentWithScopedExtentMap

public EcoreEvaluationEnvironmentWithScopedExtentMap(EvaluationEnvironment<org.eclipse.emf.ecore.EClassifier,org.eclipse.emf.ecore.EOperation,org.eclipse.emf.ecore.EStructuralFeature,org.eclipse.emf.ecore.EClass,org.eclipse.emf.ecore.EObject> parent)
Method Detail

createExtentMap

public java.util.Map<org.eclipse.emf.ecore.EClass,java.util.Set<org.eclipse.emf.ecore.EObject>> createExtentMap(java.lang.Object object)
Description copied from interface: EvaluationEnvironment
Creates an extent map for invocation of OclType.allInstances() using the specified object as a context from which to find the scope in which OCL classifier extents are defined. This scope may be a resource, resource set, or some metamodel-specific scope. Note that in the case that the object is not an EObject but is, instead, some primitive type, then this may be difficult to determine.

Clients are encouraged to do what they can to optimize this mapping, by lazy initialization of key-value pairs, workspace indices, or whatever means is available. Note that the map will only ever be accessed by key (Map.get(java.lang.Object)); it will never be queried for all entries, all keys, all values, etc. This knowledge could help optimization.

Specified by:
createExtentMap in interface EvaluationEnvironment<org.eclipse.emf.ecore.EClassifier,org.eclipse.emf.ecore.EOperation,org.eclipse.emf.ecore.EStructuralFeature,org.eclipse.emf.ecore.EClass,org.eclipse.emf.ecore.EObject>
Overrides:
createExtentMap in class EcoreEvaluationEnvironment
Parameters:
object - a context object in the scope that covers the OCL classifier extents
Returns:
the extent map

getFactory

protected EcoreEnvironmentFactoryWithScopedExtentMap getFactory()