edu.cmu.sei.aadl.model.core.impl
Class SubcomponentImpl

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.EObjectImpl
              extended by edu.cmu.sei.aadl.model.core.impl.AObjectImpl
                  extended by edu.cmu.sei.aadl.model.core.impl.NamedElementImpl
                      extended by edu.cmu.sei.aadl.model.core.impl.PropertyHolderImpl
                          extended by edu.cmu.sei.aadl.model.core.impl.ModeMemberImpl
                              extended by edu.cmu.sei.aadl.model.core.impl.SubcomponentImpl
All Implemented Interfaces:
FeatureContext, AObject, ModeMember, NamedElement, PropertyHolder, Subcomponent, ReferenceElement, org.eclipse.core.runtime.IAdaptable, org.eclipse.emf.common.notify.Notifier, org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.InternalEObject
Direct Known Subclasses:
BusSubcomponentImpl, DataSubcomponentImpl, DeviceSubcomponentImpl, MemorySubcomponentImpl, ProcessorSubcomponentImpl, ProcessSubcomponentImpl, SubprogramSubcomponentImpl, SystemSubcomponentImpl, ThreadGroupSubcomponentImpl, ThreadSubcomponentImpl

public class SubcomponentImpl
extends ModeMemberImpl
implements Subcomponent

An implementation of the model object 'Subcomponent'.

Note: This class is abstract in the metamodel.


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 java.lang.Object & org.eclipse.emf.common.notify.Adapter>
 
Nested classes/interfaces inherited from interface org.eclipse.emf.ecore.InternalEObject
org.eclipse.emf.ecore.InternalEObject.EStore
 
Field Summary
protected  ClassifierReference classifierReference
          holds classifier reference
static java.lang.String copyright
           
protected  boolean refined
          The cached value of the 'Refined' attribute
protected static boolean REFINED_EDEFAULT
          The default value of the 'Refined' attribute
protected  RefinedReference refinedReference
          holds feature refined reference
 
Fields inherited from class edu.cmu.sei.aadl.model.core.impl.ModeMemberImpl
inModes, modeName, NO_MODE_EDEFAULT, noMode
 
Fields inherited from class edu.cmu.sei.aadl.model.core.impl.PropertyHolderImpl
properties
 
Fields inherited from class edu.cmu.sei.aadl.model.core.impl.NamedElementImpl
name, NAME_EDEFAULT
 
Fields inherited from class edu.cmu.sei.aadl.model.core.impl.AObjectImpl
comment, locationReference
 
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
protected SubcomponentImpl()
           
 
Method Summary
protected  org.eclipse.emf.ecore.EClass eStaticClass()
           
 org.eclipse.emf.common.util.EList getAllSubcomponentRefinements()
          Return the subcomponent and any of the subcomponents it refines
 ComponentCategory getCategory()
          returns the ComponentCategory literal for the given subcomponent
 ClassifierReference getClassifierReference()
          get extends reference names from ClassifierReference
 ComponentClassifier getComponentClassifier()
          returns component classifier object of a given subcomponent
 ComponentImpl getComponentImpl()
          returns the component implemenation object of a given subcomponent
 ComponentType getComponentType()
          returns the component implemenation object of a given subcomponent
protected  java.util.List getInModesForPropertyAssociationSearch()
           
 void getPropertyValueInternal(PropertyDefinition pn, ModalPropertyValueAccumulator pva, boolean fromInstanceSlaveCall)
          Helper routine for computing the value of the property.
 java.lang.String getQualifiedClassifierName()
          get qualified subcomponent classifier name from reference or parsed name.
 AObject getReferencedObject()
          get the first object being referenced by this object.
 RefinedReference getRefinedReference()
          get reference names from flowReference
 ComponentType getSubcomponentType()
          returns the component type object for the subcomponent
 java.util.Collection getXAllAbstractPort()
          get list of all abstract ports (ports, port groups, parameters )of a subcomponent, including those of ancestors These are the abstract ports of its classifier In case of refined abstract ports the refined abstract ports is returned in the list.
 ComponentClassifier getXAllClassifier()
          Returns the component classifier object for the subcomponent.
 org.eclipse.emf.common.util.EList getXAllFeature()
          get list of all features of a subcomponent, including ancestor features These are the features of its classifier In case of refined features the refined features is returned in the list.
 ComponentClassifier getXClassifier()
          returns the component classifier object for the subcomponent same as getComponentClassifier.
 Subcomponent getXRefines()
          returns component classifier being refined
 boolean isRefined()
          flag indicating whether the subcomponent is refined
protected  void searchClassifier(PropertyDefinition pn, ModalPropertyValueAccumulator pva, boolean fromInstanceSlaveCall)
           
protected  void searchRefinements(PropertyDefinition pn, ModalPropertyValueAccumulator pva, ModeContext mc)
           
 void setClassifierReference(ClassifierReference cr)
          set extends reference names from ClassifierReference
 void setComponentClassifier(ComponentClassifier ct)
          sets the component type object reference of a given subcomponent
 void setRefined(boolean newRefined)
          set flag indicating whether the subcomponent is refined
 void setRefinedReference(RefinedReference fr)
          set sets reference names from refined reference
 
Methods inherited from class edu.cmu.sei.aadl.model.core.impl.ModeMemberImpl
acceptsProperty, addInModes, addModeName, eGet, eInverseAdd, eInverseRemove, eIsSet, eSet, eUnset, getAllInModes, getInModes, getModeName, getPropertyValueInternal, isAllInMode, isInMode, isNoMode, setNoMode, toString
 
Methods inherited from class edu.cmu.sei.aadl.model.core.impl.PropertyHolderImpl
addProperty, addPropertyValue, basicSetProperties, checkPropertyAssociation, createAccumulator, createPropertyAssociation, findPropertyAssociation, getProperties, getPropertyAssociation, getPropertyValue, getPropertyValueList, getSimplePropertyValue, isModalPropertyValue, removeContainedPropertyAssociations, removeContainedPropertyAssociations, removePropertyAssociations, removePropertyAssociations, setContainedPropertyValue, setContainedPropertyValue, setContainedPropertyValue, setContainedPropertyValue, setProperties, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue
 
Methods inherited from class edu.cmu.sei.aadl.model.core.impl.NamedElementImpl
checkName, getName, setName
 
Methods inherited from class edu.cmu.sei.aadl.model.core.impl.AObjectImpl
addComment, eObjectForURIFragmentSegment, eURIFragmentSegment, getAadlSpec, getAdapter, getAObjectRoot, getChildren, getComment, getContainingClassifier, getContainingClassifierNameSpace, getContainingComponentImpl, getContainingComponentType, getContainingPropertyAssociationDefinitionConstant, getContainingSubcomponent, getLocationReference, getSecondReferencedObject, getSystemInstance, setLocationReference, setLocationReference
 
Methods inherited from class org.eclipse.emf.ecore.impl.EObjectImpl
eAdapters, eBasicAdapters, eBasicProperties, eBasicSetContainer, eClass, eContainerFeatureID, eDeliver, eInternalContainer, eIsProxy, eProperties, eSetClass, eSetDeliver, eSetProxyURI
 
Methods inherited from class org.eclipse.emf.ecore.impl.BasicEObjectImpl
eAddVirtualValue, eAllContents, eBaseStructuralFeatureID, eBasicRemoveFromContainer, eBasicRemoveFromContainerFeature, eBasicSetContainer, eComputeVirtualValuesCapacity, eContainer, eContainingFeature, eContainmentFeature, eContainmentFeature, eContains, eContents, eCrossReferences, eDerivedStructuralFeatureID, eDerivedStructuralFeatureID, eDirectResource, eDynamicBasicRemoveFromContainer, eDynamicClass, eDynamicFeature, eDynamicFeatureID, eDynamicGet, eDynamicGet, eDynamicGet, eDynamicInverseAdd, eDynamicInverseAdd, eDynamicInverseRemove, eDynamicInverseRemove, eDynamicIsSet, eDynamicIsSet, eDynamicIsSet, eDynamicSet, eDynamicSet, eDynamicSet, eDynamicUnset, eDynamicUnset, eDynamicUnset, eGet, eGet, eGet, eHasSettings, eInternalResource, eInverseAdd, eInverseRemove, eIsSet, eOpenGet, eOpenIsSet, eOpenSet, eOpenUnset, eProxyURI, eRemoveVirtualValue, eResolveProxy, eResource, eSet, eSetDirectResource, eSetResource, eSetStore, eSetting, eSettingDelegate, eSettings, eSetVirtualIndexBits, eSetVirtualValue, eSetVirtualValues, eStaticFeatureCount, eStore, eUnset, 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 edu.cmu.sei.aadl.model.core.ModeMember
addInModes, addModeName, getAllInModes, getInModes, getModeName, isAllInMode, isInMode, isNoMode, setNoMode
 
Methods inherited from interface edu.cmu.sei.aadl.model.core.PropertyHolder
acceptsProperty, addProperty, addPropertyValue, checkPropertyAssociation, findPropertyAssociation, getProperties, getPropertyAssociation, getPropertyValue, getPropertyValueList, getSimplePropertyValue, isModalPropertyValue, removeContainedPropertyAssociations, removeContainedPropertyAssociations, removePropertyAssociations, removePropertyAssociations, setContainedPropertyValue, setContainedPropertyValue, setContainedPropertyValue, setContainedPropertyValue, setProperties, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue
 
Methods inherited from interface edu.cmu.sei.aadl.model.core.NamedElement
getName, setName
 
Methods inherited from interface edu.cmu.sei.aadl.model.core.AObject
addComment, getAadlSpec, getAObjectRoot, getChildren, getComment, getContainingClassifier, getContainingClassifierNameSpace, getContainingComponentImpl, getContainingComponentType, getContainingPropertyAssociationDefinitionConstant, getContainingSubcomponent, getLocationReference, getSecondReferencedObject, getSystemInstance, setLocationReference, setLocationReference
 
Methods inherited from interface org.eclipse.emf.ecore.EObject
eAllContents, eClass, eContainer, eContainingFeature, eContainmentFeature, eContents, eCrossReferences, eGet, eGet, 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.core.runtime.IAdaptable
getAdapter
 
Methods inherited from interface org.eclipse.emf.ecore.InternalEObject
eNotificationRequired
 

Field Detail

copyright

public static final java.lang.String copyright

See Also:
Constant Field Values

refinedReference

protected RefinedReference refinedReference
holds feature refined reference


classifierReference

protected ClassifierReference classifierReference
holds classifier reference


REFINED_EDEFAULT

protected static final boolean REFINED_EDEFAULT
The default value of the 'Refined' attribute.

See Also:
isRefined(), Constant Field Values

refined

protected boolean refined
The cached value of the 'Refined' attribute.

See Also:
isRefined()
Constructor Detail

SubcomponentImpl

protected SubcomponentImpl()

Method Detail

eStaticClass

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

Overrides:
eStaticClass in class ModeMemberImpl

isRefined

public boolean isRefined()
flag indicating whether the subcomponent is refined

Specified by:
isRefined in interface Subcomponent
Returns:
the value of the 'Refined' attribute.
See Also:
Subcomponent.setRefined(boolean)

setRefined

public void setRefined(boolean newRefined)
set flag indicating whether the subcomponent is refined

Specified by:
setRefined in interface Subcomponent
Parameters:
newRefined - boolean
See Also:
Subcomponent.isRefined()

getSubcomponentType

public ComponentType getSubcomponentType()
returns the component type object for the subcomponent

Specified by:
getSubcomponentType in interface Subcomponent
Returns:
component type object

getXClassifier

public ComponentClassifier getXClassifier()
returns the component classifier object for the subcomponent same as getComponentClassifier. Provided as part of X naming convention

Specified by:
getXClassifier in interface Subcomponent
Returns:
component impl or type object

getXAllClassifier

public ComponentClassifier getXAllClassifier()
Description copied from interface: Subcomponent
Returns the component classifier object for the subcomponent. Not really needed for Subcompnent because we don't look for the classifier in the subcomponents being refined if it is missing: if it is missing here, then it will be missing in refined subcomponents. But we keep this method for consistency with the naming conventions.

Specified by:
getXAllClassifier in interface Subcomponent
Returns:
component impl or type object

getQualifiedClassifierName

public java.lang.String getQualifiedClassifierName()
get qualified subcomponent classifier name from reference or parsed name. The classifier name is always qualified, even if it is located in the same pacakge Always a String

Specified by:
getQualifiedClassifierName in interface Subcomponent

getComponentImpl

public ComponentImpl getComponentImpl()
returns the component implemenation object of a given subcomponent

Specified by:
getComponentImpl in interface Subcomponent
Returns:
Component implementation

getComponentType

public ComponentType getComponentType()
returns the component implemenation object of a given subcomponent

Specified by:
getComponentType in interface Subcomponent
Returns:
Component implementation

getComponentClassifier

public ComponentClassifier getComponentClassifier()
returns component classifier object of a given subcomponent

Returns:
Component Classifier

setComponentClassifier

public void setComponentClassifier(ComponentClassifier ct)
sets the component type object reference of a given subcomponent

Specified by:
setComponentClassifier in interface Subcomponent
Parameters:
ct -

setClassifierReference

public void setClassifierReference(ClassifierReference cr)
set extends reference names from ClassifierReference

Specified by:
setClassifierReference in interface Subcomponent

getClassifierReference

public ClassifierReference getClassifierReference()
get extends reference names from ClassifierReference

Specified by:
getClassifierReference in interface Subcomponent

setRefinedReference

public void setRefinedReference(RefinedReference fr)
set sets reference names from refined reference

Specified by:
setRefinedReference in interface Subcomponent

getRefinedReference

public RefinedReference getRefinedReference()
get reference names from flowReference

Specified by:
getRefinedReference in interface Subcomponent

getXRefines

public Subcomponent getXRefines()
returns component classifier being refined

Specified by:
getXRefines in interface Subcomponent
Returns:
component classifier

getAllSubcomponentRefinements

public org.eclipse.emf.common.util.EList getAllSubcomponentRefinements()
Return the subcomponent and any of the subcomponents it refines

Specified by:
getAllSubcomponentRefinements in interface Subcomponent
Returns:
EList of subcomponent

getXAllFeature

public org.eclipse.emf.common.util.EList getXAllFeature()
get list of all features of a subcomponent, including ancestor features These are the features of its classifier In case of refined features the refined features is returned in the list.

Specified by:
getXAllFeature in interface Subcomponent
Returns:
List of features

getXAllAbstractPort

public java.util.Collection getXAllAbstractPort()
get list of all abstract ports (ports, port groups, parameters )of a subcomponent, including those of ancestors These are the abstract ports of its classifier In case of refined abstract ports the refined abstract ports is returned in the list.

Specified by:
getXAllAbstractPort in interface Subcomponent
Returns:
List of abstract ports

getPropertyValueInternal

public final void getPropertyValueInternal(PropertyDefinition pn,
                                           ModalPropertyValueAccumulator pva,
                                           boolean fromInstanceSlaveCall)
                                    throws InvalidModelException
Description copied from interface: PropertyHolder
Helper routine for computing the value of the property. As the name suggests, this method is not intended for use by clients of the model, but is used during the property lookup process. It should really be a protected method in PropertyHolderImpl, but because of the way that EMF deals with multiple inheritance, not all implementations of PropertyHolder actually extend from PropertyHolderImpl.

In particular, this method does not create a new property value accumulator—it uses the one provided—and it does not look up the default value of the property.

Specified by:
getPropertyValueInternal in interface PropertyHolder
Overrides:
getPropertyValueInternal in class PropertyHolderImpl
Parameters:
pn - The property whose value is to be retreived. It must be the case that this property is accepted by the property holder, i.e., PropertyHolder.acceptsProperty(PropertyDefinition) must return true.
pva - The working property value accumulator to add results to.
fromInstanceSlaveCall - true if the call is performing a lookup on the declarative model on behalf of an instance model object. When true the lookup algorithm ignores the "inherits" attribute on property definitions when it would mean that the lookup should defer to the containing component implemenation. Also disables the interpretation of contained property associations in the declarative model because they have already been applied to the instance model at this point. The expectation is that the instance model lookup itself is not ignoring the inherits attribute, and thus any inherited property values will still be found correctly. Interpreting the inherits attribute during the declarative model search is redundant and causes problems later on. This flag does not affect lookup for feature declarations because in that case the inherit flag defers to the component type or port group type.
Throws:
InvalidModelException - Thrown if the property value cannot be retreived because the model is incomplete or otherwise invalid.

getInModesForPropertyAssociationSearch

protected java.util.List getInModesForPropertyAssociationSearch()

searchRefinements

protected void searchRefinements(PropertyDefinition pn,
                                 ModalPropertyValueAccumulator pva,
                                 ModeContext mc)

searchClassifier

protected void searchClassifier(PropertyDefinition pn,
                                ModalPropertyValueAccumulator pva,
                                boolean fromInstanceSlaveCall)

getReferencedObject

public AObject getReferencedObject()
Description copied from class: AObjectImpl
get the first object being referenced by this object. Implementations are provided by different classes Typically it is used to allow navigation to classifiers or to the source of a connection

Specified by:
getReferencedObject in interface AObject
Overrides:
getReferencedObject in class AObjectImpl

getCategory

public ComponentCategory getCategory()
returns the ComponentCategory literal for the given subcomponent

Specified by:
getCategory in interface Subcomponent
Returns:
ComponentCategory