edu.cmu.sei.aadl.model.instance.impl
Class ConnectionInstanceImpl

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.instance.impl.InstanceObjectImpl
                              extended by edu.cmu.sei.aadl.model.instance.impl.FlowElementInstanceImpl
                                  extended by edu.cmu.sei.aadl.model.instance.impl.ConnectionInstanceImpl
All Implemented Interfaces:
AObject, NamedElement, PropertyHolder, ConnectionInstance, FlowElementInstance, InstanceObject, org.eclipse.core.runtime.IAdaptable, org.eclipse.emf.common.notify.Notifier, org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.InternalEObject
Direct Known Subclasses:
AccessConnectionInstanceImpl, ModeTransitionConnectionInstanceImpl, PortConnectionInstanceImpl

public class ConnectionInstanceImpl
extends FlowElementInstanceImpl
implements ConnectionInstance

An implementation of the model object 'Connection Instance'.

The following features are implemented:

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  org.eclipse.emf.common.util.EList connection
          The cached value of the 'Connection' reference list
protected  org.eclipse.emf.common.util.EList connectionContext
          The cached value of the 'Connection Context' reference list
static java.lang.String copyright
           
protected  org.eclipse.emf.common.util.EList inModeTransitions
          The cached value of the 'In Mode Transitions' reference list
protected  org.eclipse.emf.common.util.EList inSystemOperationMode
          The cached value of the 'In System Operation Mode' reference list
 
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 ConnectionInstanceImpl()
           
 
Method Summary
 void addConnection(Connection newConnection)
          phf: add element to multiplicity EList
 void addConnectionContext(ComponentInstance newConnectionContext)
          phf: add element to multiplicity EList
 void addInModeTransitions(ModeTransitionInstance newInModeTransitions)
          phf: add element to multiplicity EList
 void addInSystemOperationMode(SystemOperationMode newInSystemOperationMode)
          phf: add element to multiplicity EList
 ConnectionInstance cloneInstance(java.lang.String name, java.util.List connection, java.util.List connectionContext, InstanceObject src, InstanceObject dst)
          Create a new ConnectionInstance of the same type as this one, with the given name, connections, connectionContext, src, and dst.
protected  ConnectionInstance createEmptyClone()
           
 java.lang.Object eGet(int featureID, boolean resolve, boolean coreType)
           
 boolean eIsSet(int featureID)
           
 void eSet(int featureID, java.lang.Object newValue)
           
protected  org.eclipse.emf.ecore.EClass eStaticClass()
           
 void eUnset(int featureID)
           
 boolean exists()
          Does the connection exist in the current system operation mode of its containing system instance.
 org.eclipse.emf.common.util.EList getConnection()
           
 org.eclipse.emf.common.util.EList getConnectionContext()
           
 java.util.List getConnectionPropertyValues(PropertyDefinition property)
          Get the values associated with the given property for each connection declaration that defines this semantic connection.
protected  java.util.List getExistsInModes()
          Returns the System Operation Modes in which the element exists, or null if the element always exists.
 org.eclipse.emf.common.util.EList getInModeTransitions()
           
 java.util.List getInstantiatedObjects()
          Return the declarative objects that define this instance.
 org.eclipse.emf.common.util.EList getInSystemOperationMode()
           
protected  void getPropertyValueFromDeclarativeModel(PropertyDefinition property, InstanceMPVA pva)
          Get the property value from the declarative model elements associated with the instance object.
 java.util.List getThroughFeatureInstances()
          Get the features instances that this semantic connections passes through including the ultimate start and end points.
 InstanceObject getXDst()
          returns the reference to the destination feature instance
 InstanceObject getXSrc()
          returns the reference to the source feature instance
 
Methods inherited from class edu.cmu.sei.aadl.model.instance.impl.InstanceObjectImpl
createAccumulator, getComponentInstanceList, getComponentInstancePath, getContainingComponentInstance, getContainingComponentInstanceOrSelf, getInstanceObjectPath, getPropertyValueInternal, getSystemInstance
 
Methods inherited from class edu.cmu.sei.aadl.model.core.impl.PropertyHolderImpl
acceptsProperty, addProperty, addPropertyValue, basicSetProperties, checkPropertyAssociation, createPropertyAssociation, eInverseRemove, 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, toString
 
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, getReferencedObject, getSecondReferencedObject, 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, 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.instance.InstanceObject
getComponentInstanceList, getComponentInstancePath, getContainingComponentInstance, getInstanceObjectPath, getSystemInstance
 
Methods inherited from interface edu.cmu.sei.aadl.model.core.PropertyHolder
acceptsProperty, addProperty, addPropertyValue, checkPropertyAssociation, findPropertyAssociation, getProperties, getPropertyAssociation, getPropertyValue, getPropertyValueInternal, 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, getReferencedObject, getSecondReferencedObject, 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

connection

protected org.eclipse.emf.common.util.EList connection
The cached value of the 'Connection' reference list.

See Also:
getConnection()

inSystemOperationMode

protected org.eclipse.emf.common.util.EList inSystemOperationMode
The cached value of the 'In System Operation Mode' reference list.

See Also:
getInSystemOperationMode()

connectionContext

protected org.eclipse.emf.common.util.EList connectionContext
The cached value of the 'Connection Context' reference list.

See Also:
getConnectionContext()

inModeTransitions

protected org.eclipse.emf.common.util.EList inModeTransitions
The cached value of the 'In Mode Transitions' reference list.

See Also:
getInModeTransitions()
Constructor Detail

ConnectionInstanceImpl

protected ConnectionInstanceImpl()

Method Detail

eStaticClass

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

Overrides:
eStaticClass in class FlowElementInstanceImpl

getConnection

public org.eclipse.emf.common.util.EList getConnection()

Specified by:
getConnection in interface ConnectionInstance
Returns:
the value of the 'Connection' reference list.
See Also:
InstancePackage.getConnectionInstance_Connection()

addConnection

public void addConnection(Connection newConnection)
phf: add element to multiplicity EList

Specified by:
addConnection in interface ConnectionInstance
Parameters:
newConnection - the value to add to 'Connection' reference list.

getInSystemOperationMode

public org.eclipse.emf.common.util.EList getInSystemOperationMode()

Specified by:
getInSystemOperationMode in interface ConnectionInstance
Returns:
the value of the 'In System Operation Mode' reference list.
See Also:
InstancePackage.getConnectionInstance_InSystemOperationMode()

addInSystemOperationMode

public void addInSystemOperationMode(SystemOperationMode newInSystemOperationMode)
phf: add element to multiplicity EList

Specified by:
addInSystemOperationMode in interface ConnectionInstance
Parameters:
newInSystemOperationMode - the value to add to 'In System Operation Mode' reference list.

getConnectionContext

public org.eclipse.emf.common.util.EList getConnectionContext()

Specified by:
getConnectionContext in interface ConnectionInstance
Returns:
the value of the 'Connection Context' reference list.
See Also:
InstancePackage.getConnectionInstance_ConnectionContext()

addConnectionContext

public void addConnectionContext(ComponentInstance newConnectionContext)
phf: add element to multiplicity EList

Specified by:
addConnectionContext in interface ConnectionInstance
Parameters:
newConnectionContext - the value to add to 'Connection Context' reference list.

getInModeTransitions

public org.eclipse.emf.common.util.EList getInModeTransitions()

Specified by:
getInModeTransitions in interface ConnectionInstance
Returns:
the value of the 'In Mode Transitions' reference list.
See Also:
InstancePackage.getConnectionInstance_InModeTransitions()

addInModeTransitions

public void addInModeTransitions(ModeTransitionInstance newInModeTransitions)
phf: add element to multiplicity EList

Specified by:
addInModeTransitions in interface ConnectionInstance
Parameters:
newInModeTransitions - the value to add to 'In Mode Transitions' reference list.

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 PropertyHolderImpl

eSet

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

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

eUnset

public void eUnset(int featureID)

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

eIsSet

public boolean eIsSet(int featureID)

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

getConnectionPropertyValues

public java.util.List getConnectionPropertyValues(PropertyDefinition property)
                                           throws InvalidModelException
Description copied from interface: ConnectionInstance
Get the values associated with the given property for each connection declaration that defines this semantic connection.

Specified by:
getConnectionPropertyValues in interface ConnectionInstance
Parameters:
property - The property to look up
Returns:
A list of ModalPropertyValue objects, one for each connection declaration. The objects are in the same order as the connection declaration objects returned by ConnectionInstance.getConnection(). Furthermore, the values are in terms of the connection instance object, that is, modal dependencies are given in terms of system operation modes, and reference values have been resolved to point to instance objects.
Throws:
InvalidModelException - Thrown if the property values cannot be retreived because the model is incomplete.

getPropertyValueFromDeclarativeModel

protected void getPropertyValueFromDeclarativeModel(PropertyDefinition property,
                                                    InstanceMPVA pva)
                                             throws InvalidModelException
Get the property value from the declarative model elements associated with the instance object. This implementation works for Semantic Connections and the multiple connections that are instantiated to create the single ConnectionInstance.

Overrides:
getPropertyValueFromDeclarativeModel in class InstanceObjectImpl
Parameters:
property - The property to lookup
pva - The property value accumulator to use to build the property value
Throws:
InvalidModelException - Thrown if the property value cannot be retreived because the model is incomplete or otherwise invalid.

getInstantiatedObjects

public final java.util.List getInstantiatedObjects()
Description copied from class: InstanceObjectImpl
Return the declarative objects that define this instance. Most of the time this will return a singleton list. But in the case of semantic connections, it will return a list of connection objects.

Specified by:
getInstantiatedObjects in interface InstanceObject
Overrides:
getInstantiatedObjects in class InstanceObjectImpl
Returns:
A List of PropertyHolder objects that should be declarative model elements. Returns an empty list if no named declarative object exists, such as in the case of ModeTransitionInstances.

getExistsInModes

protected final java.util.List getExistsInModes()
Description copied from class: InstanceObjectImpl
Returns the System Operation Modes in which the element exists, or null if the element always exists.

Overrides:
getExistsInModes in class InstanceObjectImpl

getXSrc

public InstanceObject getXSrc()
returns the reference to the source feature instance

Specified by:
getXSrc in interface ConnectionInstance
Returns:
feature instance

getXDst

public InstanceObject getXDst()
returns the reference to the destination feature instance

Specified by:
getXDst in interface ConnectionInstance
Returns:
feature instance

getThroughFeatureInstances

public final java.util.List getThroughFeatureInstances()
Description copied from interface: ConnectionInstance
Get the features instances that this semantic connections passes through including the ultimate start and end points. The features are returned in the order in which they are passed through.

Specified by:
getThroughFeatureInstances in interface ConnectionInstance
Returns:
A List of InstanceObjects. The first item in the list will be a ComponentInstance if the connection is an AccessConnectionInstance. In this case, the component is the data or bus component that is being accesses through the connection. In all other cases the first element will be a FeatureInstance. All subsequent elements in the list are always FeatureInstance objects.

createEmptyClone

protected ConnectionInstance createEmptyClone()

cloneInstance

public ConnectionInstance cloneInstance(java.lang.String name,
                                        java.util.List connection,
                                        java.util.List connectionContext,
                                        InstanceObject src,
                                        InstanceObject dst)
Description copied from interface: ConnectionInstance
Create a new ConnectionInstance of the same type as this one, with the given name, connections, connectionContext, src, and dst. This is basically a factory method that uses the type of the receiver to determine which kind of connection instance to create. The values of the features of the receiver are completely ignored.

Specified by:
cloneInstance in interface ConnectionInstance

exists

public final boolean exists()
Description copied from interface: ConnectionInstance
Does the connection exist in the current system operation mode of its containing system instance. If the connection is detached from a system instance then it always exists. If the containing system instance is not projected into a system operation mode then the connection exists.

Specified by:
exists in interface ConnectionInstance
See Also:
SystemInstance.setCurrentSystemOperationMode(edu.cmu.sei.aadl.model.instance.SystemOperationMode)