org.eclipse.ocl.examples.codegen.cgmodel.impl
Class CGValuedElementImpl

java.lang.Object
  extended by org.eclipse.emf.common.notify.impl.BasicNotifierImpl
      extended by org.eclipse.emf.ecore.impl.BasicEObjectImpl
          extended by org.eclipse.emf.ecore.impl.MinimalEObjectImpl
              extended by org.eclipse.emf.ecore.impl.MinimalEObjectImpl.Container
                  extended by org.eclipse.ocl.examples.codegen.cgmodel.impl.CGElementImpl
                      extended by org.eclipse.ocl.examples.codegen.cgmodel.impl.CGNamedElementImpl
                          extended by org.eclipse.ocl.examples.codegen.cgmodel.impl.CGTypedElementImpl
                              extended by org.eclipse.ocl.examples.codegen.cgmodel.impl.CGValuedElementImpl
All Implemented Interfaces:
org.eclipse.emf.common.notify.Notifier, org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EStructuralFeature.Internal.DynamicValueHolder, org.eclipse.emf.ecore.InternalEObject, CGElement, CGNamedElement, CGTypedElement, CGValuedElement, Nameable
Direct Known Subclasses:
CGCallableImpl, CGCallExpImpl, CGCollectionExpImpl, CGCollectionPartImpl, CGConstantExpImpl, CGConstantImpl, CGConstructorExpImpl, CGConstructorPartImpl, CGContainmentBodyImpl, CGContainmentPartImpl, CGExecutorOperationImpl, CGExecutorPropertyImpl, CGExecutorTypeImpl, CGIfExpImpl, CGLetExpImpl, CGPropertyImpl, CGTupleExpImpl, CGTuplePartImpl, CGTypeExpImpl, CGVariableExpImpl, CGVariableImpl

public abstract class CGValuedElementImpl
extends CGTypedElementImpl
implements CGValuedElement

An implementation of the model object 'CG Valued Element'.

The following features are implemented:

Generated

Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.emf.ecore.impl.MinimalEObjectImpl.Container
org.eclipse.emf.ecore.impl.MinimalEObjectImpl.Container.Dynamic
 
Nested classes/interfaces inherited from class org.eclipse.emf.ecore.impl.MinimalEObjectImpl
org.eclipse.emf.ecore.impl.MinimalEObjectImpl.Container
 
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 java.lang.Object & org.eclipse.emf.common.notify.Adapter>, org.eclipse.emf.common.notify.impl.BasicNotifierImpl.EObservableAdapterList
 
Nested classes/interfaces inherited from interface org.eclipse.emf.ecore.InternalEObject
org.eclipse.emf.ecore.InternalEObject.EStore
 
Field Summary
protected  boolean caught
           
protected  org.eclipse.emf.common.util.EList<CGValuedElement> dependsOn
          The cached value of the 'Depends On' reference list.
protected  org.eclipse.emf.common.util.EList<CGValuedElement> owns
          The cached value of the 'Owns' containment reference list.
protected  java.lang.String valueName
           
 
Fields inherited from class org.eclipse.ocl.examples.codegen.cgmodel.impl.CGTypedElementImpl
required, REQUIRED_EDEFAULT, typeId
 
Fields inherited from class org.eclipse.ocl.examples.codegen.cgmodel.impl.CGNamedElementImpl
ast, AST_EDEFAULT, name, NAME_EDEFAULT
 
Fields inherited from class org.eclipse.emf.ecore.impl.MinimalEObjectImpl.Container
eContainer
 
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.EStructuralFeature.Internal.DynamicValueHolder
NIL
 
Fields inherited from interface org.eclipse.emf.ecore.InternalEObject
EOPPOSITE_FEATURE_BASE
 
Constructor Summary
protected CGValuedElementImpl()
           
 
Method Summary
 java.lang.Object eGet(int featureID, boolean resolve, boolean coreType)
           
 org.eclipse.emf.common.notify.NotificationChain eInverseRemove(org.eclipse.emf.ecore.InternalEObject otherEnd, int featureID, org.eclipse.emf.common.notify.NotificationChain msgs)
           
 boolean eIsSet(int featureID)
           
 void eSet(int featureID, java.lang.Object newValue)
           
protected  org.eclipse.emf.ecore.EClass eStaticClass()
           
 void eUnset(int featureID)
           
 java.util.List<CGValuedElement> getDependsOn()
           
 CGInvalid getInvalidValue()
          Return a non-null invalid value if this value is invalid.
 CGValuedElement getNamedValue()
          Return the CGValuedElement that provides the name of a declaration from which the value of this CGValuedElement may be obtained.
 java.util.List<CGValuedElement> getOwns()
           
 AbstractPlace getPlace(java.util.Map<CGElement,AbstractPlace> element2place)
          Returns the place for this element, updating and reusing element2place as required.
 CGValuedElement getReferredValue()
          Return the CGValuedElement to which the value of this CGValuedElement delegates.
 CGValuedElement getSourceValue()
          Return the CGValuedElement which is the source of the information value of this element.
 CGValuedElement getThisValue()
          Return a simpler CGValuedElement that is fully equivalent to this element.
 CGValuedElement getTypedValue()
          Return the CGValuedElement that provides the narrowest type declaration from which the type of this CGValuedElement may be obtained.
 java.lang.String getValueName()
          Return the declared name value of this element.
 boolean isAssertedNonNull()
          Return true if this value is not null, possibly with the aid of an assertion.
 boolean isBoxed()
          Return true if this value is a boxed value.
 boolean isCaught()
          Returns true if any exception associated with this value has been caught and consequently the value may be an InvalidValueException.
 boolean isCommonable()
          Return true if this value can be shared as part of a Common Subexpression.
 boolean isConstant()
          Return true if this value is a local constant (dependent of the user type system).
 boolean isContext()
          Returns true if this node may have its own symbol name context.
 java.lang.Boolean isEquivalentTo(CGValuedElement thatValue)
          Returns true/false if this value can be determined to have deep value equivalence/inequivalence to thatValue, null if no determination can be made.
 boolean isFalse()
          Return true if this value is false.
 boolean isGlobal()
          Return true if this value is a global constant (independent of the user type system).
 boolean isInlined()
          Return true if this value is inlined and so has no local or global declaration.
 boolean isInvalid()
          Return true if this value is false.
 boolean isNonInvalid()
          Return true if this value is false.
 boolean isNonNull()
          Return true if this value is not null.
 boolean isNull()
          Return true if this value is null.
 boolean isSettable()
          Return true if this value can be inlined as an expression term.
 boolean isTrue()
          Return true if this value is true.
 boolean isUnboxed()
          Return true if this value is an unboxed value.
 boolean isUncommonable()
          Return true if this value does not have to be shared as part of a Common Subexpression.
 boolean rewriteAs(CGValuedElement oldValue, CGValuedElement newValue)
          Rewrite the reference to oldValue by newValue.
 void setCaught(boolean isCaught)
          Set the caught status.
 void setValueName(java.lang.String valueName)
          Set the name of the value.
 
Methods inherited from class org.eclipse.ocl.examples.codegen.cgmodel.impl.CGTypedElementImpl
getASTypeId, getTypeId, isRequired, setRequired, setTypeId, toString
 
Methods inherited from class org.eclipse.ocl.examples.codegen.cgmodel.impl.CGNamedElementImpl
getAst, getName, setAst, setName
 
Methods inherited from class org.eclipse.ocl.examples.codegen.cgmodel.impl.CGElementImpl
accept, getChildren, getParent
 
Methods inherited from class org.eclipse.emf.ecore.impl.MinimalEObjectImpl.Container
eBasicSetContainer, eInternalContainer
 
Methods inherited from class org.eclipse.emf.ecore.impl.MinimalEObjectImpl
dynamicGet, dynamicSet, dynamicUnset, eAdapters, eBasicAdapterArray, eBasicAdapterListeners, eBasicAdapters, eBasicHasAdapters, eBasicProperties, eBasicSetAdapterArray, eBasicSetAdapterListeners, eBasicSetContainer, eBasicSetContainerFeatureID, eBasicSetSettings, eBasicSettings, eClass, eContainerFeatureID, eContents, eCrossReferences, eDeliver, eDirectResource, eDynamicClass, eHasSettings, eIsProxy, eProperties, eProxyURI, eSetClass, eSetDeliver, eSetDirectResource, eSetProxyURI, eSettings
 
Methods inherited from class org.eclipse.emf.ecore.impl.BasicEObjectImpl
eAddVirtualValue, eAllContents, eBaseStructuralFeatureID, eBasicRemoveFromContainer, eBasicRemoveFromContainerFeature, eBasicSetContainer, eComputeVirtualValuesCapacity, eContainer, eContainerAdapterArray, eContainingFeature, eContainmentFeature, eContainmentFeature, eContains, eDerivedOperationID, eDerivedOperationID, eDerivedStructuralFeatureID, eDerivedStructuralFeatureID, eDynamicBasicRemoveFromContainer, eDynamicFeature, eDynamicFeatureID, eDynamicGet, eDynamicGet, eDynamicGet, eDynamicInverseAdd, eDynamicInverseAdd, eDynamicInverseRemove, eDynamicInverseRemove, eDynamicInvoke, eDynamicInvoke, eDynamicIsSet, eDynamicIsSet, eDynamicIsSet, eDynamicSet, eDynamicSet, eDynamicSet, eDynamicUnset, eDynamicUnset, eDynamicUnset, eGet, eGet, eGet, eInternalResource, eInverseAdd, eInverseAdd, eInverseRemove, eInvocationDelegate, eInvoke, eInvoke, eIsSet, eObjectForURIFragmentSegment, eOpenGet, eOpenIsSet, eOpenSet, eOpenUnset, eRemoveVirtualValue, eResolveProxy, eResource, eSet, eSetResource, eSetStore, eSetting, eSettingDelegate, 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
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.ocl.examples.codegen.cgmodel.CGValuedElement
isEquivalentToInternal
 
Methods inherited from interface org.eclipse.ocl.examples.codegen.cgmodel.CGTypedElement
getASTypeId, getTypeId, isRequired, setRequired, setTypeId
 
Methods inherited from interface org.eclipse.ocl.examples.codegen.cgmodel.CGNamedElement
getAst, getName, setAst, setName
 
Methods inherited from interface org.eclipse.ocl.examples.codegen.cgmodel.CGElement
accept, getChildren, getParent
 
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.common.notify.Notifier
eAdapters, eDeliver, eNotify, eSetDeliver
 
Methods inherited from interface org.eclipse.emf.ecore.InternalEObject
eNotificationRequired
 

Field Detail

dependsOn

protected org.eclipse.emf.common.util.EList<CGValuedElement> dependsOn
The cached value of the 'Depends On' reference list.

See Also:
getDependsOn()
Generated
Ordered

owns

protected org.eclipse.emf.common.util.EList<CGValuedElement> owns
The cached value of the 'Owns' containment reference list.

See Also:
getOwns()
Generated
Ordered

caught

protected boolean caught
Generated

valueName

protected java.lang.String valueName
Generated
Constructor Detail

CGValuedElementImpl

protected CGValuedElementImpl()

Generated
Method Detail

eStaticClass

protected org.eclipse.emf.ecore.EClass eStaticClass()

Overrides:
eStaticClass in class CGTypedElementImpl
Generated

getDependsOn

public java.util.List<CGValuedElement> getDependsOn()

Specified by:
getDependsOn in interface CGValuedElement
Returns:
the value of the 'Depends On' reference list.
See Also:
CGModelPackage.getCGValuedElement_DependsOn()
Generated

getOwns

public java.util.List<CGValuedElement> getOwns()

Specified by:
getOwns in interface CGValuedElement
Returns:
the value of the 'Owns' containment reference list.
See Also:
CGModelPackage.getCGValuedElement_Owns()
Generated

eInverseRemove

public org.eclipse.emf.common.notify.NotificationChain eInverseRemove(org.eclipse.emf.ecore.InternalEObject otherEnd,
                                                                      int featureID,
                                                                      org.eclipse.emf.common.notify.NotificationChain msgs)

Overrides:
eInverseRemove in class org.eclipse.emf.ecore.impl.BasicEObjectImpl
Generated

eGet

public java.lang.Object eGet(int featureID,
                             boolean resolve,
                             boolean coreType)

Specified by:
eGet in interface org.eclipse.emf.ecore.InternalEObject
Overrides:
eGet in class CGTypedElementImpl
Generated

eSet

public void eSet(int featureID,
                 java.lang.Object newValue)

Specified by:
eSet in interface org.eclipse.emf.ecore.InternalEObject
Overrides:
eSet in class CGTypedElementImpl
Generated

eUnset

public void eUnset(int featureID)

Specified by:
eUnset in interface org.eclipse.emf.ecore.InternalEObject
Overrides:
eUnset in class CGTypedElementImpl
Generated

eIsSet

public boolean eIsSet(int featureID)

Specified by:
eIsSet in interface org.eclipse.emf.ecore.InternalEObject
Overrides:
eIsSet in class CGTypedElementImpl
Generated

getInvalidValue

@Nullable
public CGInvalid getInvalidValue()
Return a non-null invalid value if this value is invalid.

Specified by:
getInvalidValue in interface CGValuedElement
Generated

getPlace

@Nullable
public AbstractPlace getPlace(@NonNull
                                       java.util.Map<CGElement,AbstractPlace> element2place)
Returns the place for this element, updating and reusing element2place as required. All parent elements have entries in element2place. No child elements have entries in element2place. The global place is accessible as the null element.

Specified by:
getPlace in interface CGElement
Overrides:
getPlace in class CGElementImpl
Generated

getReferredValue

@NonNull
public CGValuedElement getReferredValue()
Return the CGValuedElement to which the value of this CGValuedElement delegates. Fundamental elements such as constants and operation calls provide the named value themselves. More complex elements such as VariableExp and ThrowExp may delegate.

Specified by:
getReferredValue in interface CGValuedElement
Generated

getSourceValue

@NonNull
public CGValuedElement getSourceValue()
Return the CGValuedElement which is the source of the information value of this element. Note that the source value may be differently guarded, caught/thrown and boxed/unboxed to this value. Returns this if no delegation occurs.

Specified by:
getSourceValue in interface CGValuedElement
Generated

getThisValue

@NonNull
public CGValuedElement getThisValue()
Return a simpler CGValuedElement that is fully equivalent to this element. May return CGInvalid if this element is invalid. May return the internal value of a CollectionPart or TuplePart. May follow a delegation when the delegation has no semantic significance. Returns this if no simplification occurs.

Specified by:
getThisValue in interface CGValuedElement
Generated

getNamedValue

@NonNull
public CGValuedElement getNamedValue()
Return the CGValuedElement that provides the name of a declaration from which the value of this CGValuedElement may be obtained. Fundamental elements such as constants and operation calls provide the named value themselves. More complex elements such as VariableExp and ThrowExp may delegate.

Specified by:
getNamedValue in interface CGValuedElement
Generated

getTypedValue

@NonNull
public CGValuedElement getTypedValue()
Return the CGValuedElement that provides the narrowest type declaration from which the type of this CGValuedElement may be obtained. Fundamental elements such as constants and operations call provide their own narrow type. More complex elements such as CatchExp have a wide type that includes invalid and so delegate to identify the narrow type. More complex elements such as GuardExp/ThrowExp propagate an unchanged value with a narrower type than their source.

Specified by:
getTypedValue in interface CGValuedElement
Generated

getValueName

@Nullable
public java.lang.String getValueName()
Return the declared name value of this element. The text is valid for use in the target language and unique within the context in which this element is declared.

Specified by:
getValueName in interface CGValuedElement
Generated

isAssertedNonNull

public boolean isAssertedNonNull()
Return true if this value is not null, possibly with the aid of an assertion.

Specified by:
isAssertedNonNull in interface CGValuedElement
Generated

isBoxed

public boolean isBoxed()
Return true if this value is a boxed value.

Specified by:
isBoxed in interface CGValuedElement
Generated

isCaught

public boolean isCaught()
Returns true if any exception associated with this value has been caught and consequently the value may be an InvalidValueException. Returns true if any exception has been thrown.

Specified by:
isCaught in interface CGValuedElement
Generated

isCommonable

public boolean isCommonable()
Return true if this value can be shared as part of a Common Subexpression.

Specified by:
isCommonable in interface CGValuedElement
Generated

isConstant

public boolean isConstant()
Return true if this value is a local constant (dependent of the user type system).

Specified by:
isConstant in interface CGValuedElement
Generated

isContext

public boolean isContext()
Returns true if this node may have its own symbol name context.

Specified by:
isContext in interface CGElement
Overrides:
isContext in class CGElementImpl
Generated

isEquivalentTo

@Nullable
public java.lang.Boolean isEquivalentTo(@NonNull
                                                 CGValuedElement thatValue)
Returns true/false if this value can be determined to have deep value equivalence/inequivalence to thatValue, null if no determination can be made.

Specified by:
isEquivalentTo in interface CGValuedElement
Generated

isFalse

public boolean isFalse()
Return true if this value is false.

Specified by:
isFalse in interface CGValuedElement
Generated

isGlobal

public boolean isGlobal()
Return true if this value is a global constant (independent of the user type system).

Specified by:
isGlobal in interface CGValuedElement
Generated

isInlined

public boolean isInlined()
Return true if this value is inlined and so has no local or global declaration.

Specified by:
isInlined in interface CGValuedElement
Generated

isInvalid

public boolean isInvalid()
Return true if this value is false.

Specified by:
isInvalid in interface CGValuedElement
Generated

isNonInvalid

public boolean isNonInvalid()
Return true if this value is false.

Specified by:
isNonInvalid in interface CGValuedElement
Generated

isNonNull

public boolean isNonNull()
Return true if this value is not null.

Specified by:
isNonNull in interface CGValuedElement
Generated

isNull

public boolean isNull()
Return true if this value is null.

Specified by:
isNull in interface CGValuedElement
Generated

isSettable

public boolean isSettable()
Return true if this value can be inlined as an expression term.

Specified by:
isSettable in interface CGValuedElement
Generated

isTrue

public boolean isTrue()
Return true if this value is true.

Specified by:
isTrue in interface CGValuedElement
Generated

isUnboxed

public boolean isUnboxed()
Return true if this value is an unboxed value.

Specified by:
isUnboxed in interface CGValuedElement
Generated

isUncommonable

public boolean isUncommonable()
Return true if this value does not have to be shared as part of a Common Subexpression.

Specified by:
isUncommonable in interface CGValuedElement
Generated

rewriteAs

public boolean rewriteAs(@NonNull
                         CGValuedElement oldValue,
                         @NonNull
                         CGValuedElement newValue)
Rewrite the reference to oldValue by newValue.

Specified by:
rewriteAs in interface CGElement
Overrides:
rewriteAs in class CGElementImpl
Generated

setCaught

public void setCaught(boolean isCaught)
Set the caught status.

Specified by:
setCaught in interface CGValuedElement
Generated

setValueName

public void setValueName(@NonNull
                         java.lang.String valueName)
Set the name of the value.

Specified by:
setValueName in interface CGValuedElement
Generated