| 1 | /** |
| 2 | * Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany |
| 3 | * |
| 4 | * $Id$ |
| 5 | */ |
| 6 | package de.uka.ipd.sdq.pcm.qosannotations.impl; |
| 7 | |
| 8 | import org.eclipse.emf.common.notify.Notification; |
| 9 | import org.eclipse.emf.common.notify.NotificationChain; |
| 10 | import org.eclipse.emf.ecore.EClass; |
| 11 | import org.eclipse.emf.ecore.InternalEObject; |
| 12 | import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| 13 | import org.eclipse.emf.ecore.impl.EObjectImpl; |
| 14 | import org.eclipse.emf.ecore.util.EcoreUtil; |
| 15 | |
| 16 | import de.uka.ipd.sdq.pcm.qosannotations.QoSAnnotations; |
| 17 | import de.uka.ipd.sdq.pcm.qosannotations.QosannotationsPackage; |
| 18 | import de.uka.ipd.sdq.pcm.qosannotations.SpecifiedQoSAnnotation; |
| 19 | import de.uka.ipd.sdq.pcm.repository.Role; |
| 20 | import de.uka.ipd.sdq.pcm.repository.Signature; |
| 21 | |
| 22 | /** |
| 23 | * <!-- begin-user-doc --> |
| 24 | * An implementation of the model object '<em><b>Specified Qo SAnnotation</b></em>'. |
| 25 | * <!-- end-user-doc --> |
| 26 | * <p> |
| 27 | * The following features are implemented: |
| 28 | * <ul> |
| 29 | * <li>{@link de.uka.ipd.sdq.pcm.qosannotations.impl.SpecifiedQoSAnnotationImpl#getSignature_SpecifiedQoSAnnation <em>Signature Specified Qo SAnnation</em>}</li> |
| 30 | * <li>{@link de.uka.ipd.sdq.pcm.qosannotations.impl.SpecifiedQoSAnnotationImpl#getRole_SpecifiedQoSAnnotation <em>Role Specified Qo SAnnotation</em>}</li> |
| 31 | * <li>{@link de.uka.ipd.sdq.pcm.qosannotations.impl.SpecifiedQoSAnnotationImpl#getQosAnnotations_SpecifiedQoSAnnotation <em>Qos Annotations Specified Qo SAnnotation</em>}</li> |
| 32 | * </ul> |
| 33 | * </p> |
| 34 | * |
| 35 | * @generated |
| 36 | */ |
| 37 | public abstract class SpecifiedQoSAnnotationImpl extends EObjectImpl implements SpecifiedQoSAnnotation { |
| 38 | /** |
| 39 | * <!-- begin-user-doc --> |
| 40 | * <!-- end-user-doc --> |
| 41 | * @generated |
| 42 | */ |
| 43 | public static final String copyright = "Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany"; |
| 44 | |
| 45 | /** |
| 46 | * The cached value of the '{@link #getSignature_SpecifiedQoSAnnation() <em>Signature Specified Qo SAnnation</em>}' reference. |
| 47 | * <!-- begin-user-doc --> |
| 48 | * <!-- end-user-doc --> |
| 49 | * @see #getSignature_SpecifiedQoSAnnation() |
| 50 | * @generated |
| 51 | * @ordered |
| 52 | */ |
| 53 | protected Signature signature_SpecifiedQoSAnnation; |
| 54 | |
| 55 | /** |
| 56 | * The cached value of the '{@link #getRole_SpecifiedQoSAnnotation() <em>Role Specified Qo SAnnotation</em>}' reference. |
| 57 | * <!-- begin-user-doc --> |
| 58 | * <!-- end-user-doc --> |
| 59 | * @see #getRole_SpecifiedQoSAnnotation() |
| 60 | * @generated |
| 61 | * @ordered |
| 62 | */ |
| 63 | protected Role role_SpecifiedQoSAnnotation; |
| 64 | |
| 65 | /** |
| 66 | * <!-- begin-user-doc --> |
| 67 | * <!-- end-user-doc --> |
| 68 | * @generated |
| 69 | */ |
| 70 | protected SpecifiedQoSAnnotationImpl() { |
| 71 | super(); |
| 72 | } |
| 73 | |
| 74 | /** |
| 75 | * <!-- begin-user-doc --> |
| 76 | * <!-- end-user-doc --> |
| 77 | * @generated |
| 78 | */ |
| 79 | @Override |
| 80 | protected EClass eStaticClass() { |
| 81 | return QosannotationsPackage.Literals.SPECIFIED_QO_SANNOTATION; |
| 82 | } |
| 83 | |
| 84 | /** |
| 85 | * <!-- begin-user-doc --> |
| 86 | * <!-- end-user-doc --> |
| 87 | * @generated |
| 88 | */ |
| 89 | public Signature getSignature_SpecifiedQoSAnnation() { |
| 90 | if (signature_SpecifiedQoSAnnation != null && signature_SpecifiedQoSAnnation.eIsProxy()) { |
| 91 | InternalEObject oldSignature_SpecifiedQoSAnnation = (InternalEObject)signature_SpecifiedQoSAnnation; |
| 92 | signature_SpecifiedQoSAnnation = (Signature)eResolveProxy(oldSignature_SpecifiedQoSAnnation); |
| 93 | if (signature_SpecifiedQoSAnnation != oldSignature_SpecifiedQoSAnnation) { |
| 94 | if (eNotificationRequired()) |
| 95 | eNotify(new ENotificationImpl(this, Notification.RESOLVE, QosannotationsPackage.SPECIFIED_QO_SANNOTATION__SIGNATURE_SPECIFIED_QO_SANNATION, oldSignature_SpecifiedQoSAnnation, signature_SpecifiedQoSAnnation)); |
| 96 | } |
| 97 | } |
| 98 | return signature_SpecifiedQoSAnnation; |
| 99 | } |
| 100 | |
| 101 | /** |
| 102 | * <!-- begin-user-doc --> |
| 103 | * <!-- end-user-doc --> |
| 104 | * @generated |
| 105 | */ |
| 106 | public Signature basicGetSignature_SpecifiedQoSAnnation() { |
| 107 | return signature_SpecifiedQoSAnnation; |
| 108 | } |
| 109 | |
| 110 | /** |
| 111 | * <!-- begin-user-doc --> |
| 112 | * <!-- end-user-doc --> |
| 113 | * @generated |
| 114 | */ |
| 115 | public void setSignature_SpecifiedQoSAnnation(Signature newSignature_SpecifiedQoSAnnation) { |
| 116 | Signature oldSignature_SpecifiedQoSAnnation = signature_SpecifiedQoSAnnation; |
| 117 | signature_SpecifiedQoSAnnation = newSignature_SpecifiedQoSAnnation; |
| 118 | if (eNotificationRequired()) |
| 119 | eNotify(new ENotificationImpl(this, Notification.SET, QosannotationsPackage.SPECIFIED_QO_SANNOTATION__SIGNATURE_SPECIFIED_QO_SANNATION, oldSignature_SpecifiedQoSAnnation, signature_SpecifiedQoSAnnation)); |
| 120 | } |
| 121 | |
| 122 | /** |
| 123 | * <!-- begin-user-doc --> |
| 124 | * <!-- end-user-doc --> |
| 125 | * @generated |
| 126 | */ |
| 127 | public Role getRole_SpecifiedQoSAnnotation() { |
| 128 | if (role_SpecifiedQoSAnnotation != null && role_SpecifiedQoSAnnotation.eIsProxy()) { |
| 129 | InternalEObject oldRole_SpecifiedQoSAnnotation = (InternalEObject)role_SpecifiedQoSAnnotation; |
| 130 | role_SpecifiedQoSAnnotation = (Role)eResolveProxy(oldRole_SpecifiedQoSAnnotation); |
| 131 | if (role_SpecifiedQoSAnnotation != oldRole_SpecifiedQoSAnnotation) { |
| 132 | if (eNotificationRequired()) |
| 133 | eNotify(new ENotificationImpl(this, Notification.RESOLVE, QosannotationsPackage.SPECIFIED_QO_SANNOTATION__ROLE_SPECIFIED_QO_SANNOTATION, oldRole_SpecifiedQoSAnnotation, role_SpecifiedQoSAnnotation)); |
| 134 | } |
| 135 | } |
| 136 | return role_SpecifiedQoSAnnotation; |
| 137 | } |
| 138 | |
| 139 | /** |
| 140 | * <!-- begin-user-doc --> |
| 141 | * <!-- end-user-doc --> |
| 142 | * @generated |
| 143 | */ |
| 144 | public Role basicGetRole_SpecifiedQoSAnnotation() { |
| 145 | return role_SpecifiedQoSAnnotation; |
| 146 | } |
| 147 | |
| 148 | /** |
| 149 | * <!-- begin-user-doc --> |
| 150 | * <!-- end-user-doc --> |
| 151 | * @generated |
| 152 | */ |
| 153 | public void setRole_SpecifiedQoSAnnotation(Role newRole_SpecifiedQoSAnnotation) { |
| 154 | Role oldRole_SpecifiedQoSAnnotation = role_SpecifiedQoSAnnotation; |
| 155 | role_SpecifiedQoSAnnotation = newRole_SpecifiedQoSAnnotation; |
| 156 | if (eNotificationRequired()) |
| 157 | eNotify(new ENotificationImpl(this, Notification.SET, QosannotationsPackage.SPECIFIED_QO_SANNOTATION__ROLE_SPECIFIED_QO_SANNOTATION, oldRole_SpecifiedQoSAnnotation, role_SpecifiedQoSAnnotation)); |
| 158 | } |
| 159 | |
| 160 | /** |
| 161 | * <!-- begin-user-doc --> |
| 162 | * <!-- end-user-doc --> |
| 163 | * @generated |
| 164 | */ |
| 165 | public QoSAnnotations getQosAnnotations_SpecifiedQoSAnnotation() { |
| 166 | if (eContainerFeatureID() != QosannotationsPackage.SPECIFIED_QO_SANNOTATION__QOS_ANNOTATIONS_SPECIFIED_QO_SANNOTATION) return null; |
| 167 | return (QoSAnnotations)eContainer(); |
| 168 | } |
| 169 | |
| 170 | /** |
| 171 | * <!-- begin-user-doc --> |
| 172 | * <!-- end-user-doc --> |
| 173 | * @generated |
| 174 | */ |
| 175 | public NotificationChain basicSetQosAnnotations_SpecifiedQoSAnnotation(QoSAnnotations newQosAnnotations_SpecifiedQoSAnnotation, NotificationChain msgs) { |
| 176 | msgs = eBasicSetContainer((InternalEObject)newQosAnnotations_SpecifiedQoSAnnotation, QosannotationsPackage.SPECIFIED_QO_SANNOTATION__QOS_ANNOTATIONS_SPECIFIED_QO_SANNOTATION, msgs); |
| 177 | return msgs; |
| 178 | } |
| 179 | |
| 180 | /** |
| 181 | * <!-- begin-user-doc --> |
| 182 | * <!-- end-user-doc --> |
| 183 | * @generated |
| 184 | */ |
| 185 | public void setQosAnnotations_SpecifiedQoSAnnotation(QoSAnnotations newQosAnnotations_SpecifiedQoSAnnotation) { |
| 186 | if (newQosAnnotations_SpecifiedQoSAnnotation != eInternalContainer() || (eContainerFeatureID() != QosannotationsPackage.SPECIFIED_QO_SANNOTATION__QOS_ANNOTATIONS_SPECIFIED_QO_SANNOTATION && newQosAnnotations_SpecifiedQoSAnnotation != null)) { |
| 187 | if (EcoreUtil.isAncestor(this, newQosAnnotations_SpecifiedQoSAnnotation)) |
| 188 | throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); |
| 189 | NotificationChain msgs = null; |
| 190 | if (eInternalContainer() != null) |
| 191 | msgs = eBasicRemoveFromContainer(msgs); |
| 192 | if (newQosAnnotations_SpecifiedQoSAnnotation != null) |
| 193 | msgs = ((InternalEObject)newQosAnnotations_SpecifiedQoSAnnotation).eInverseAdd(this, QosannotationsPackage.QO_SANNOTATIONS__SPECIFIED_QO_SANNOTATIONS_QO_SANNOTATIONS, QoSAnnotations.class, msgs); |
| 194 | msgs = basicSetQosAnnotations_SpecifiedQoSAnnotation(newQosAnnotations_SpecifiedQoSAnnotation, msgs); |
| 195 | if (msgs != null) msgs.dispatch(); |
| 196 | } |
| 197 | else if (eNotificationRequired()) |
| 198 | eNotify(new ENotificationImpl(this, Notification.SET, QosannotationsPackage.SPECIFIED_QO_SANNOTATION__QOS_ANNOTATIONS_SPECIFIED_QO_SANNOTATION, newQosAnnotations_SpecifiedQoSAnnotation, newQosAnnotations_SpecifiedQoSAnnotation)); |
| 199 | } |
| 200 | |
| 201 | /** |
| 202 | * <!-- begin-user-doc --> |
| 203 | * <!-- end-user-doc --> |
| 204 | * @generated |
| 205 | */ |
| 206 | @Override |
| 207 | public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| 208 | switch (featureID) { |
| 209 | case QosannotationsPackage.SPECIFIED_QO_SANNOTATION__QOS_ANNOTATIONS_SPECIFIED_QO_SANNOTATION: |
| 210 | if (eInternalContainer() != null) |
| 211 | msgs = eBasicRemoveFromContainer(msgs); |
| 212 | return basicSetQosAnnotations_SpecifiedQoSAnnotation((QoSAnnotations)otherEnd, msgs); |
| 213 | } |
| 214 | return super.eInverseAdd(otherEnd, featureID, msgs); |
| 215 | } |
| 216 | |
| 217 | /** |
| 218 | * <!-- begin-user-doc --> |
| 219 | * <!-- end-user-doc --> |
| 220 | * @generated |
| 221 | */ |
| 222 | @Override |
| 223 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| 224 | switch (featureID) { |
| 225 | case QosannotationsPackage.SPECIFIED_QO_SANNOTATION__QOS_ANNOTATIONS_SPECIFIED_QO_SANNOTATION: |
| 226 | return basicSetQosAnnotations_SpecifiedQoSAnnotation(null, msgs); |
| 227 | } |
| 228 | return super.eInverseRemove(otherEnd, featureID, msgs); |
| 229 | } |
| 230 | |
| 231 | /** |
| 232 | * <!-- begin-user-doc --> |
| 233 | * <!-- end-user-doc --> |
| 234 | * @generated |
| 235 | */ |
| 236 | @Override |
| 237 | public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { |
| 238 | switch (eContainerFeatureID()) { |
| 239 | case QosannotationsPackage.SPECIFIED_QO_SANNOTATION__QOS_ANNOTATIONS_SPECIFIED_QO_SANNOTATION: |
| 240 | return eInternalContainer().eInverseRemove(this, QosannotationsPackage.QO_SANNOTATIONS__SPECIFIED_QO_SANNOTATIONS_QO_SANNOTATIONS, QoSAnnotations.class, msgs); |
| 241 | } |
| 242 | return super.eBasicRemoveFromContainerFeature(msgs); |
| 243 | } |
| 244 | |
| 245 | /** |
| 246 | * <!-- begin-user-doc --> |
| 247 | * <!-- end-user-doc --> |
| 248 | * @generated |
| 249 | */ |
| 250 | @Override |
| 251 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| 252 | switch (featureID) { |
| 253 | case QosannotationsPackage.SPECIFIED_QO_SANNOTATION__SIGNATURE_SPECIFIED_QO_SANNATION: |
| 254 | if (resolve) return getSignature_SpecifiedQoSAnnation(); |
| 255 | return basicGetSignature_SpecifiedQoSAnnation(); |
| 256 | case QosannotationsPackage.SPECIFIED_QO_SANNOTATION__ROLE_SPECIFIED_QO_SANNOTATION: |
| 257 | if (resolve) return getRole_SpecifiedQoSAnnotation(); |
| 258 | return basicGetRole_SpecifiedQoSAnnotation(); |
| 259 | case QosannotationsPackage.SPECIFIED_QO_SANNOTATION__QOS_ANNOTATIONS_SPECIFIED_QO_SANNOTATION: |
| 260 | return getQosAnnotations_SpecifiedQoSAnnotation(); |
| 261 | } |
| 262 | return super.eGet(featureID, resolve, coreType); |
| 263 | } |
| 264 | |
| 265 | /** |
| 266 | * <!-- begin-user-doc --> |
| 267 | * <!-- end-user-doc --> |
| 268 | * @generated |
| 269 | */ |
| 270 | @Override |
| 271 | public void eSet(int featureID, Object newValue) { |
| 272 | switch (featureID) { |
| 273 | case QosannotationsPackage.SPECIFIED_QO_SANNOTATION__SIGNATURE_SPECIFIED_QO_SANNATION: |
| 274 | setSignature_SpecifiedQoSAnnation((Signature)newValue); |
| 275 | return; |
| 276 | case QosannotationsPackage.SPECIFIED_QO_SANNOTATION__ROLE_SPECIFIED_QO_SANNOTATION: |
| 277 | setRole_SpecifiedQoSAnnotation((Role)newValue); |
| 278 | return; |
| 279 | case QosannotationsPackage.SPECIFIED_QO_SANNOTATION__QOS_ANNOTATIONS_SPECIFIED_QO_SANNOTATION: |
| 280 | setQosAnnotations_SpecifiedQoSAnnotation((QoSAnnotations)newValue); |
| 281 | return; |
| 282 | } |
| 283 | super.eSet(featureID, newValue); |
| 284 | } |
| 285 | |
| 286 | /** |
| 287 | * <!-- begin-user-doc --> |
| 288 | * <!-- end-user-doc --> |
| 289 | * @generated |
| 290 | */ |
| 291 | @Override |
| 292 | public void eUnset(int featureID) { |
| 293 | switch (featureID) { |
| 294 | case QosannotationsPackage.SPECIFIED_QO_SANNOTATION__SIGNATURE_SPECIFIED_QO_SANNATION: |
| 295 | setSignature_SpecifiedQoSAnnation((Signature)null); |
| 296 | return; |
| 297 | case QosannotationsPackage.SPECIFIED_QO_SANNOTATION__ROLE_SPECIFIED_QO_SANNOTATION: |
| 298 | setRole_SpecifiedQoSAnnotation((Role)null); |
| 299 | return; |
| 300 | case QosannotationsPackage.SPECIFIED_QO_SANNOTATION__QOS_ANNOTATIONS_SPECIFIED_QO_SANNOTATION: |
| 301 | setQosAnnotations_SpecifiedQoSAnnotation((QoSAnnotations)null); |
| 302 | return; |
| 303 | } |
| 304 | super.eUnset(featureID); |
| 305 | } |
| 306 | |
| 307 | /** |
| 308 | * <!-- begin-user-doc --> |
| 309 | * <!-- end-user-doc --> |
| 310 | * @generated |
| 311 | */ |
| 312 | @Override |
| 313 | public boolean eIsSet(int featureID) { |
| 314 | switch (featureID) { |
| 315 | case QosannotationsPackage.SPECIFIED_QO_SANNOTATION__SIGNATURE_SPECIFIED_QO_SANNATION: |
| 316 | return signature_SpecifiedQoSAnnation != null; |
| 317 | case QosannotationsPackage.SPECIFIED_QO_SANNOTATION__ROLE_SPECIFIED_QO_SANNOTATION: |
| 318 | return role_SpecifiedQoSAnnotation != null; |
| 319 | case QosannotationsPackage.SPECIFIED_QO_SANNOTATION__QOS_ANNOTATIONS_SPECIFIED_QO_SANNOTATION: |
| 320 | return getQosAnnotations_SpecifiedQoSAnnotation() != null; |
| 321 | } |
| 322 | return super.eIsSet(featureID); |
| 323 | } |
| 324 | |
| 325 | } //SpecifiedQoSAnnotationImpl |