org.eclipse.ocl.examples.impactanalyzer.deltaPropagation
Class PartialEcoreEnvironmentFactory

java.lang.Object
  extended by org.eclipse.ocl.AbstractEnvironmentFactory<org.eclipse.emf.ecore.EPackage,org.eclipse.emf.ecore.EClassifier,org.eclipse.emf.ecore.EOperation,org.eclipse.emf.ecore.EStructuralFeature,org.eclipse.emf.ecore.EEnumLiteral,org.eclipse.emf.ecore.EParameter,org.eclipse.emf.ecore.EObject,CallOperationAction,SendSignalAction,Constraint,org.eclipse.emf.ecore.EClass,org.eclipse.emf.ecore.EObject>
      extended by org.eclipse.ocl.ecore.EcoreEnvironmentFactory
          extended by org.eclipse.ocl.ecore.opposites.EcoreEnvironmentFactoryWithHiddenOpposites
              extended by org.eclipse.ocl.examples.impactanalyzer.util.EcoreEnvironmentFactoryWithScopedExtentMap
                  extended by org.eclipse.ocl.examples.impactanalyzer.deltaPropagation.PartialEcoreEnvironmentFactory
All Implemented Interfaces:
EnvironmentFactory<org.eclipse.emf.ecore.EPackage,org.eclipse.emf.ecore.EClassifier,org.eclipse.emf.ecore.EOperation,org.eclipse.emf.ecore.EStructuralFeature,org.eclipse.emf.ecore.EEnumLiteral,org.eclipse.emf.ecore.EParameter,org.eclipse.emf.ecore.EObject,CallOperationAction,SendSignalAction,Constraint,org.eclipse.emf.ecore.EClass,org.eclipse.emf.ecore.EObject>, Adaptable
Direct Known Subclasses:
PartialEcoreEnvironmentFactoryNoAllInstances

public class PartialEcoreEnvironmentFactory
extends EcoreEnvironmentFactoryWithScopedExtentMap


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.ocl.EnvironmentFactory
EnvironmentFactory.Lookup<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E>
 
Field Summary
 
Fields inherited from class org.eclipse.ocl.ecore.opposites.EcoreEnvironmentFactoryWithHiddenOpposites
INSTANCE
 
Constructor Summary
PartialEcoreEnvironmentFactory()
          Uses a DefaultOppositeEndFinder for querying hidden opposites
PartialEcoreEnvironmentFactory(org.eclipse.emf.common.notify.Notification atPre)
          Taking a Notification object such that an evaluation performed with the EvaluationVisitor returned by this factory's createEvaluationVisitor(Environment, EvaluationEnvironment, Map) operation will be based on the state before the notification.
PartialEcoreEnvironmentFactory(org.eclipse.emf.common.notify.Notification atPre, OppositeEndFinder oppositeEndFinder)
          Uses the specific oppositeEndFinder to retrieve and navigate hidden opposite properties and for allInstances() evaluation.
PartialEcoreEnvironmentFactory(OppositeEndFinder oppositeEndFinder)
          Uses a null atPre.
 
Method Summary
 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> createEvaluationEnvironment()
          Creates a new evaluation environment to track the values of variables in an OCL expression as it is evaluated.
 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> createEvaluationEnvironment(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)
          Creates a new evaluation environment as a nested environment of the specified parent.
 EvaluationVisitor<org.eclipse.emf.ecore.EPackage,org.eclipse.emf.ecore.EClassifier,org.eclipse.emf.ecore.EOperation,org.eclipse.emf.ecore.EStructuralFeature,org.eclipse.emf.ecore.EEnumLiteral,org.eclipse.emf.ecore.EParameter,org.eclipse.emf.ecore.EObject,CallOperationAction,SendSignalAction,Constraint,org.eclipse.emf.ecore.EClass,org.eclipse.emf.ecore.EObject> createEvaluationVisitor(Environment<org.eclipse.emf.ecore.EPackage,org.eclipse.emf.ecore.EClassifier,org.eclipse.emf.ecore.EOperation,org.eclipse.emf.ecore.EStructuralFeature,org.eclipse.emf.ecore.EEnumLiteral,org.eclipse.emf.ecore.EParameter,org.eclipse.emf.ecore.EObject,CallOperationAction,SendSignalAction,Constraint,org.eclipse.emf.ecore.EClass,org.eclipse.emf.ecore.EObject> env, 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> evalEnv, java.util.Map<? extends org.eclipse.emf.ecore.EClass,? extends java.util.Set<? extends org.eclipse.emf.ecore.EObject>> extentMap)
          Creates a visitor.
protected  org.eclipse.emf.common.notify.Notification getAtPre()
           
protected  OCLExpression getSourceExpression()
           
protected  java.lang.Object getValueOfSourceExpression()
           
 void setExpressionValue(OCLExpression sourceExpression, java.lang.Object valueOfSourceExpression)
           
protected  void setSourceExpression(OCLExpression sourceExpression)
           
protected  void setValueOfSourceExpression(java.lang.Object valueOfSourceExpression)
           
 
Methods inherited from class org.eclipse.ocl.ecore.opposites.EcoreEnvironmentFactoryWithHiddenOpposites
createOppositeEndFinder
 
Methods inherited from class org.eclipse.ocl.ecore.EcoreEnvironmentFactory
createEnvironment, createEnvironment, createOCLAnalyzer, createOCLAnalyzer, createOCLFactoryWithHistory, createOCLSyntaxHelper, createValidationVisitor, getClassifier, getEPackageRegistry, getOppositeEndFinder, loadEnvironment, lookupPackage
 
Methods inherited from class org.eclipse.ocl.AbstractEnvironmentFactory
createAttributeContext, createClassifierContext, createInstanceContext, createOperationContext, createPackageContext, createPackageContext, getAdapter, isEvaluationTracingEnabled, setEvaluationTracingEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PartialEcoreEnvironmentFactory

public PartialEcoreEnvironmentFactory()
Uses a DefaultOppositeEndFinder for querying hidden opposites


PartialEcoreEnvironmentFactory

public PartialEcoreEnvironmentFactory(org.eclipse.emf.common.notify.Notification atPre)
Taking a Notification object such that an evaluation performed with the EvaluationVisitor returned by this factory's createEvaluationVisitor(Environment, EvaluationEnvironment, Map) operation will be based on the state before the notification. For example, if the notification indicates the removal of a reference from an element e1 to an element e2 across reference r then when during partial evaluation r is traversed starting from e1 then e2 will show in the results although in the current version of the model it would not.

Uses a DefaultOppositeEndFinder for navigating hidden opposites.


PartialEcoreEnvironmentFactory

public PartialEcoreEnvironmentFactory(org.eclipse.emf.common.notify.Notification atPre,
                                      OppositeEndFinder oppositeEndFinder)
Uses the specific oppositeEndFinder to retrieve and navigate hidden opposite properties and for allInstances() evaluation.


PartialEcoreEnvironmentFactory

public PartialEcoreEnvironmentFactory(OppositeEndFinder oppositeEndFinder)
Uses a null atPre.

Method Detail

createEvaluationEnvironment

public 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> createEvaluationEnvironment()
Description copied from interface: EnvironmentFactory
Creates a new evaluation environment to track the values of variables in an OCL expression as it is evaluated.

Specified by:
createEvaluationEnvironment in interface EnvironmentFactory<org.eclipse.emf.ecore.EPackage,org.eclipse.emf.ecore.EClassifier,org.eclipse.emf.ecore.EOperation,org.eclipse.emf.ecore.EStructuralFeature,org.eclipse.emf.ecore.EEnumLiteral,org.eclipse.emf.ecore.EParameter,org.eclipse.emf.ecore.EObject,CallOperationAction,SendSignalAction,Constraint,org.eclipse.emf.ecore.EClass,org.eclipse.emf.ecore.EObject>
Overrides:
createEvaluationEnvironment in class EcoreEnvironmentFactoryWithScopedExtentMap
Returns:
a new evaluation environment

createEvaluationEnvironment

public 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> createEvaluationEnvironment(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)
Description copied from interface: EnvironmentFactory
Creates a new evaluation environment as a nested environment of the specified parent.

Specified by:
createEvaluationEnvironment in interface EnvironmentFactory<org.eclipse.emf.ecore.EPackage,org.eclipse.emf.ecore.EClassifier,org.eclipse.emf.ecore.EOperation,org.eclipse.emf.ecore.EStructuralFeature,org.eclipse.emf.ecore.EEnumLiteral,org.eclipse.emf.ecore.EParameter,org.eclipse.emf.ecore.EObject,CallOperationAction,SendSignalAction,Constraint,org.eclipse.emf.ecore.EClass,org.eclipse.emf.ecore.EObject>
Overrides:
createEvaluationEnvironment in class EcoreEnvironmentFactory
Parameters:
parent - a nesting evaluation environment
Returns:
a new nested evaluation environment

createEvaluationVisitor

public EvaluationVisitor<org.eclipse.emf.ecore.EPackage,org.eclipse.emf.ecore.EClassifier,org.eclipse.emf.ecore.EOperation,org.eclipse.emf.ecore.EStructuralFeature,org.eclipse.emf.ecore.EEnumLiteral,org.eclipse.emf.ecore.EParameter,org.eclipse.emf.ecore.EObject,CallOperationAction,SendSignalAction,Constraint,org.eclipse.emf.ecore.EClass,org.eclipse.emf.ecore.EObject> createEvaluationVisitor(Environment<org.eclipse.emf.ecore.EPackage,org.eclipse.emf.ecore.EClassifier,org.eclipse.emf.ecore.EOperation,org.eclipse.emf.ecore.EStructuralFeature,org.eclipse.emf.ecore.EEnumLiteral,org.eclipse.emf.ecore.EParameter,org.eclipse.emf.ecore.EObject,CallOperationAction,SendSignalAction,Constraint,org.eclipse.emf.ecore.EClass,org.eclipse.emf.ecore.EObject> env,
                                                                                                                                                                                                                                                                                                                                                                                                          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> evalEnv,
                                                                                                                                                                                                                                                                                                                                                                                                          java.util.Map<? extends org.eclipse.emf.ecore.EClass,? extends java.util.Set<? extends org.eclipse.emf.ecore.EObject>> extentMap)
Creates a visitor. The AbstractEnvironmentFactory.isEvaluationTracingEnabled() result is ignored here. Unfortunately, the TracingEvaluationVisitor class is not visible here. The sourceExpression and valueOfSourceExpression are passed to the PartialEvaluationVisitorImpl constructor and are nulled out before the constructor is called. As a consequence of this, subsequent requests to this factory to create a visitor will result in visitors that don't treat the source expression special anymore. This prevents incorrect use of the cached value during recursions.

Specified by:
createEvaluationVisitor in interface EnvironmentFactory<org.eclipse.emf.ecore.EPackage,org.eclipse.emf.ecore.EClassifier,org.eclipse.emf.ecore.EOperation,org.eclipse.emf.ecore.EStructuralFeature,org.eclipse.emf.ecore.EEnumLiteral,org.eclipse.emf.ecore.EParameter,org.eclipse.emf.ecore.EObject,CallOperationAction,SendSignalAction,Constraint,org.eclipse.emf.ecore.EClass,org.eclipse.emf.ecore.EObject>
Overrides:
createEvaluationVisitor in class EcoreEnvironmentFactory
Parameters:
env - the environment in which the expression was originally parsed (or some compatible environment)
evalEnv - the evaluation environment that the visitor is to use for tracking variables, navigating properties, etc.
extentMap - the map of Classes to their extends
Returns:
the new evaluation visitor

setExpressionValue

public void setExpressionValue(OCLExpression sourceExpression,
                               java.lang.Object valueOfSourceExpression)

getValueOfSourceExpression

protected java.lang.Object getValueOfSourceExpression()

getSourceExpression

protected OCLExpression getSourceExpression()

setSourceExpression

protected void setSourceExpression(OCLExpression sourceExpression)

setValueOfSourceExpression

protected void setValueOfSourceExpression(java.lang.Object valueOfSourceExpression)

getAtPre

protected org.eclipse.emf.common.notify.Notification getAtPre()