| 1 | /** |
| 2 | * <copyright> |
| 3 | * </copyright> |
| 4 | * |
| 5 | * $Id$ |
| 6 | */ |
| 7 | package de.fzi.se.quality.parameters.pcm.impl; |
| 8 | |
| 9 | import de.fzi.se.quality.parameters.pcm.PCMComponentParameterReference; |
| 10 | import de.fzi.se.quality.parameters.pcm.PCMPackage; |
| 11 | |
| 12 | import de.uka.ipd.sdq.pcm.parameter.VariableUsage; |
| 13 | |
| 14 | import de.uka.ipd.sdq.pcm.repository.ImplementationComponentType; |
| 15 | |
| 16 | import org.eclipse.emf.common.notify.Notification; |
| 17 | |
| 18 | import org.eclipse.emf.ecore.EClass; |
| 19 | import org.eclipse.emf.ecore.InternalEObject; |
| 20 | |
| 21 | import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| 22 | |
| 23 | /** |
| 24 | * <!-- begin-user-doc --> |
| 25 | * An implementation of the model object '<em><b>Component Parameter Reference</b></em>'. |
| 26 | * <!-- end-user-doc --> |
| 27 | * <p> |
| 28 | * The following features are implemented: |
| 29 | * <ul> |
| 30 | * <li>{@link de.fzi.se.quality.parameters.pcm.impl.PCMComponentParameterReferenceImpl#getImplementationComponentType <em>Implementation Component Type</em>}</li> |
| 31 | * <li>{@link de.fzi.se.quality.parameters.pcm.impl.PCMComponentParameterReferenceImpl#getVariableUsage <em>Variable Usage</em>}</li> |
| 32 | * </ul> |
| 33 | * </p> |
| 34 | * |
| 35 | * @generated |
| 36 | */ |
| 37 | public class PCMComponentParameterReferenceImpl extends PCMParameterReferenceImpl implements PCMComponentParameterReference { |
| 38 | /** |
| 39 | * The cached value of the '{@link #getImplementationComponentType() <em>Implementation Component Type</em>}' reference. |
| 40 | * <!-- begin-user-doc --> |
| 41 | * <!-- end-user-doc --> |
| 42 | * @see #getImplementationComponentType() |
| 43 | * @generated |
| 44 | * @ordered |
| 45 | */ |
| 46 | protected ImplementationComponentType implementationComponentType; |
| 47 | |
| 48 | /** |
| 49 | * The cached value of the '{@link #getVariableUsage() <em>Variable Usage</em>}' reference. |
| 50 | * <!-- begin-user-doc --> |
| 51 | * <!-- end-user-doc --> |
| 52 | * @see #getVariableUsage() |
| 53 | * @generated |
| 54 | * @ordered |
| 55 | */ |
| 56 | protected VariableUsage variableUsage; |
| 57 | |
| 58 | /** |
| 59 | * <!-- begin-user-doc --> |
| 60 | * <!-- end-user-doc --> |
| 61 | * @generated |
| 62 | */ |
| 63 | protected PCMComponentParameterReferenceImpl() { |
| 64 | super(); |
| 65 | } |
| 66 | |
| 67 | /** |
| 68 | * <!-- begin-user-doc --> |
| 69 | * <!-- end-user-doc --> |
| 70 | * @generated |
| 71 | */ |
| 72 | @Override |
| 73 | protected EClass eStaticClass() { |
| 74 | return PCMPackage.Literals.PCM_COMPONENT_PARAMETER_REFERENCE; |
| 75 | } |
| 76 | |
| 77 | /** |
| 78 | * <!-- begin-user-doc --> |
| 79 | * <!-- end-user-doc --> |
| 80 | * @generated |
| 81 | */ |
| 82 | public ImplementationComponentType getImplementationComponentType() { |
| 83 | if (implementationComponentType != null && implementationComponentType.eIsProxy()) { |
| 84 | InternalEObject oldImplementationComponentType = (InternalEObject)implementationComponentType; |
| 85 | implementationComponentType = (ImplementationComponentType)eResolveProxy(oldImplementationComponentType); |
| 86 | if (implementationComponentType != oldImplementationComponentType) { |
| 87 | if (eNotificationRequired()) |
| 88 | eNotify(new ENotificationImpl(this, Notification.RESOLVE, PCMPackage.PCM_COMPONENT_PARAMETER_REFERENCE__IMPLEMENTATION_COMPONENT_TYPE, oldImplementationComponentType, implementationComponentType)); |
| 89 | } |
| 90 | } |
| 91 | return implementationComponentType; |
| 92 | } |
| 93 | |
| 94 | /** |
| 95 | * <!-- begin-user-doc --> |
| 96 | * <!-- end-user-doc --> |
| 97 | * @generated |
| 98 | */ |
| 99 | public ImplementationComponentType basicGetImplementationComponentType() { |
| 100 | return implementationComponentType; |
| 101 | } |
| 102 | |
| 103 | /** |
| 104 | * <!-- begin-user-doc --> |
| 105 | * <!-- end-user-doc --> |
| 106 | * @generated |
| 107 | */ |
| 108 | public void setImplementationComponentType(ImplementationComponentType newImplementationComponentType) { |
| 109 | ImplementationComponentType oldImplementationComponentType = implementationComponentType; |
| 110 | implementationComponentType = newImplementationComponentType; |
| 111 | if (eNotificationRequired()) |
| 112 | eNotify(new ENotificationImpl(this, Notification.SET, PCMPackage.PCM_COMPONENT_PARAMETER_REFERENCE__IMPLEMENTATION_COMPONENT_TYPE, oldImplementationComponentType, implementationComponentType)); |
| 113 | } |
| 114 | |
| 115 | /** |
| 116 | * <!-- begin-user-doc --> |
| 117 | * <!-- end-user-doc --> |
| 118 | * @generated |
| 119 | */ |
| 120 | public VariableUsage getVariableUsage() { |
| 121 | if (variableUsage != null && variableUsage.eIsProxy()) { |
| 122 | InternalEObject oldVariableUsage = (InternalEObject)variableUsage; |
| 123 | variableUsage = (VariableUsage)eResolveProxy(oldVariableUsage); |
| 124 | if (variableUsage != oldVariableUsage) { |
| 125 | if (eNotificationRequired()) |
| 126 | eNotify(new ENotificationImpl(this, Notification.RESOLVE, PCMPackage.PCM_COMPONENT_PARAMETER_REFERENCE__VARIABLE_USAGE, oldVariableUsage, variableUsage)); |
| 127 | } |
| 128 | } |
| 129 | return variableUsage; |
| 130 | } |
| 131 | |
| 132 | /** |
| 133 | * <!-- begin-user-doc --> |
| 134 | * <!-- end-user-doc --> |
| 135 | * @generated |
| 136 | */ |
| 137 | public VariableUsage basicGetVariableUsage() { |
| 138 | return variableUsage; |
| 139 | } |
| 140 | |
| 141 | /** |
| 142 | * <!-- begin-user-doc --> |
| 143 | * <!-- end-user-doc --> |
| 144 | * @generated |
| 145 | */ |
| 146 | public void setVariableUsage(VariableUsage newVariableUsage) { |
| 147 | VariableUsage oldVariableUsage = variableUsage; |
| 148 | variableUsage = newVariableUsage; |
| 149 | if (eNotificationRequired()) |
| 150 | eNotify(new ENotificationImpl(this, Notification.SET, PCMPackage.PCM_COMPONENT_PARAMETER_REFERENCE__VARIABLE_USAGE, oldVariableUsage, variableUsage)); |
| 151 | } |
| 152 | |
| 153 | /** |
| 154 | * <!-- begin-user-doc --> |
| 155 | * <!-- end-user-doc --> |
| 156 | * @generated |
| 157 | */ |
| 158 | @Override |
| 159 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| 160 | switch (featureID) { |
| 161 | case PCMPackage.PCM_COMPONENT_PARAMETER_REFERENCE__IMPLEMENTATION_COMPONENT_TYPE: |
| 162 | if (resolve) return getImplementationComponentType(); |
| 163 | return basicGetImplementationComponentType(); |
| 164 | case PCMPackage.PCM_COMPONENT_PARAMETER_REFERENCE__VARIABLE_USAGE: |
| 165 | if (resolve) return getVariableUsage(); |
| 166 | return basicGetVariableUsage(); |
| 167 | } |
| 168 | return super.eGet(featureID, resolve, coreType); |
| 169 | } |
| 170 | |
| 171 | /** |
| 172 | * <!-- begin-user-doc --> |
| 173 | * <!-- end-user-doc --> |
| 174 | * @generated |
| 175 | */ |
| 176 | @Override |
| 177 | public void eSet(int featureID, Object newValue) { |
| 178 | switch (featureID) { |
| 179 | case PCMPackage.PCM_COMPONENT_PARAMETER_REFERENCE__IMPLEMENTATION_COMPONENT_TYPE: |
| 180 | setImplementationComponentType((ImplementationComponentType)newValue); |
| 181 | return; |
| 182 | case PCMPackage.PCM_COMPONENT_PARAMETER_REFERENCE__VARIABLE_USAGE: |
| 183 | setVariableUsage((VariableUsage)newValue); |
| 184 | return; |
| 185 | } |
| 186 | super.eSet(featureID, newValue); |
| 187 | } |
| 188 | |
| 189 | /** |
| 190 | * <!-- begin-user-doc --> |
| 191 | * <!-- end-user-doc --> |
| 192 | * @generated |
| 193 | */ |
| 194 | @Override |
| 195 | public void eUnset(int featureID) { |
| 196 | switch (featureID) { |
| 197 | case PCMPackage.PCM_COMPONENT_PARAMETER_REFERENCE__IMPLEMENTATION_COMPONENT_TYPE: |
| 198 | setImplementationComponentType((ImplementationComponentType)null); |
| 199 | return; |
| 200 | case PCMPackage.PCM_COMPONENT_PARAMETER_REFERENCE__VARIABLE_USAGE: |
| 201 | setVariableUsage((VariableUsage)null); |
| 202 | return; |
| 203 | } |
| 204 | super.eUnset(featureID); |
| 205 | } |
| 206 | |
| 207 | /** |
| 208 | * <!-- begin-user-doc --> |
| 209 | * <!-- end-user-doc --> |
| 210 | * @generated |
| 211 | */ |
| 212 | @Override |
| 213 | public boolean eIsSet(int featureID) { |
| 214 | switch (featureID) { |
| 215 | case PCMPackage.PCM_COMPONENT_PARAMETER_REFERENCE__IMPLEMENTATION_COMPONENT_TYPE: |
| 216 | return implementationComponentType != null; |
| 217 | case PCMPackage.PCM_COMPONENT_PARAMETER_REFERENCE__VARIABLE_USAGE: |
| 218 | return variableUsage != null; |
| 219 | } |
| 220 | return super.eIsSet(featureID); |
| 221 | } |
| 222 | |
| 223 | } //PCMComponentParameterReferenceImpl |