| 1 | /** |
| 2 | * <copyright> |
| 3 | * </copyright> |
| 4 | * |
| 5 | * $Id$ |
| 6 | */ |
| 7 | package de.fzi.se.quality.parameters.impl; |
| 8 | |
| 9 | import de.fzi.se.quality.parameters.CallInstance; |
| 10 | import de.fzi.se.quality.parameters.OperationReference; |
| 11 | import de.fzi.se.quality.parameters.ParametersPackage; |
| 12 | |
| 13 | import org.eclipse.emf.common.notify.Notification; |
| 14 | import org.eclipse.emf.common.notify.NotificationChain; |
| 15 | |
| 16 | import org.eclipse.emf.ecore.EClass; |
| 17 | import org.eclipse.emf.ecore.InternalEObject; |
| 18 | |
| 19 | import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| 20 | import org.eclipse.emf.ecore.impl.EObjectImpl; |
| 21 | |
| 22 | import org.eclipse.emf.ecore.util.EcoreUtil; |
| 23 | |
| 24 | /** |
| 25 | * <!-- begin-user-doc --> |
| 26 | * An implementation of the model object '<em><b>Operation Reference</b></em>'. |
| 27 | * <!-- end-user-doc --> |
| 28 | * <p> |
| 29 | * The following features are implemented: |
| 30 | * <ul> |
| 31 | * <li>{@link de.fzi.se.quality.parameters.impl.OperationReferenceImpl#getCallInstance <em>Call Instance</em>}</li> |
| 32 | * </ul> |
| 33 | * </p> |
| 34 | * |
| 35 | * @generated |
| 36 | */ |
| 37 | public abstract class OperationReferenceImpl extends EObjectImpl implements OperationReference { |
| 38 | /** |
| 39 | * <!-- begin-user-doc --> |
| 40 | * <!-- end-user-doc --> |
| 41 | * @generated |
| 42 | */ |
| 43 | protected OperationReferenceImpl() { |
| 44 | super(); |
| 45 | } |
| 46 | |
| 47 | /** |
| 48 | * <!-- begin-user-doc --> |
| 49 | * <!-- end-user-doc --> |
| 50 | * @generated |
| 51 | */ |
| 52 | @Override |
| 53 | protected EClass eStaticClass() { |
| 54 | return ParametersPackage.Literals.OPERATION_REFERENCE; |
| 55 | } |
| 56 | |
| 57 | /** |
| 58 | * <!-- begin-user-doc --> |
| 59 | * <!-- end-user-doc --> |
| 60 | * @generated |
| 61 | */ |
| 62 | public CallInstance getCallInstance() { |
| 63 | if (eContainerFeatureID() != ParametersPackage.OPERATION_REFERENCE__CALL_INSTANCE) return null; |
| 64 | return (CallInstance)eContainer(); |
| 65 | } |
| 66 | |
| 67 | /** |
| 68 | * <!-- begin-user-doc --> |
| 69 | * <!-- end-user-doc --> |
| 70 | * @generated |
| 71 | */ |
| 72 | public NotificationChain basicSetCallInstance(CallInstance newCallInstance, NotificationChain msgs) { |
| 73 | msgs = eBasicSetContainer((InternalEObject)newCallInstance, ParametersPackage.OPERATION_REFERENCE__CALL_INSTANCE, msgs); |
| 74 | return msgs; |
| 75 | } |
| 76 | |
| 77 | /** |
| 78 | * <!-- begin-user-doc --> |
| 79 | * <!-- end-user-doc --> |
| 80 | * @generated |
| 81 | */ |
| 82 | public void setCallInstance(CallInstance newCallInstance) { |
| 83 | if (newCallInstance != eInternalContainer() || (eContainerFeatureID() != ParametersPackage.OPERATION_REFERENCE__CALL_INSTANCE && newCallInstance != null)) { |
| 84 | if (EcoreUtil.isAncestor(this, newCallInstance)) |
| 85 | throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); |
| 86 | NotificationChain msgs = null; |
| 87 | if (eInternalContainer() != null) |
| 88 | msgs = eBasicRemoveFromContainer(msgs); |
| 89 | if (newCallInstance != null) |
| 90 | msgs = ((InternalEObject)newCallInstance).eInverseAdd(this, ParametersPackage.CALL_INSTANCE__OPERATION_REFERENCE, CallInstance.class, msgs); |
| 91 | msgs = basicSetCallInstance(newCallInstance, msgs); |
| 92 | if (msgs != null) msgs.dispatch(); |
| 93 | } |
| 94 | else if (eNotificationRequired()) |
| 95 | eNotify(new ENotificationImpl(this, Notification.SET, ParametersPackage.OPERATION_REFERENCE__CALL_INSTANCE, newCallInstance, newCallInstance)); |
| 96 | } |
| 97 | |
| 98 | /** |
| 99 | * <!-- begin-user-doc --> |
| 100 | * <!-- end-user-doc --> |
| 101 | * @generated |
| 102 | */ |
| 103 | @Override |
| 104 | public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| 105 | switch (featureID) { |
| 106 | case ParametersPackage.OPERATION_REFERENCE__CALL_INSTANCE: |
| 107 | if (eInternalContainer() != null) |
| 108 | msgs = eBasicRemoveFromContainer(msgs); |
| 109 | return basicSetCallInstance((CallInstance)otherEnd, msgs); |
| 110 | } |
| 111 | return super.eInverseAdd(otherEnd, featureID, msgs); |
| 112 | } |
| 113 | |
| 114 | /** |
| 115 | * <!-- begin-user-doc --> |
| 116 | * <!-- end-user-doc --> |
| 117 | * @generated |
| 118 | */ |
| 119 | @Override |
| 120 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| 121 | switch (featureID) { |
| 122 | case ParametersPackage.OPERATION_REFERENCE__CALL_INSTANCE: |
| 123 | return basicSetCallInstance(null, msgs); |
| 124 | } |
| 125 | return super.eInverseRemove(otherEnd, featureID, msgs); |
| 126 | } |
| 127 | |
| 128 | /** |
| 129 | * <!-- begin-user-doc --> |
| 130 | * <!-- end-user-doc --> |
| 131 | * @generated |
| 132 | */ |
| 133 | @Override |
| 134 | public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { |
| 135 | switch (eContainerFeatureID()) { |
| 136 | case ParametersPackage.OPERATION_REFERENCE__CALL_INSTANCE: |
| 137 | return eInternalContainer().eInverseRemove(this, ParametersPackage.CALL_INSTANCE__OPERATION_REFERENCE, CallInstance.class, msgs); |
| 138 | } |
| 139 | return super.eBasicRemoveFromContainerFeature(msgs); |
| 140 | } |
| 141 | |
| 142 | /** |
| 143 | * <!-- begin-user-doc --> |
| 144 | * <!-- end-user-doc --> |
| 145 | * @generated |
| 146 | */ |
| 147 | @Override |
| 148 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| 149 | switch (featureID) { |
| 150 | case ParametersPackage.OPERATION_REFERENCE__CALL_INSTANCE: |
| 151 | return getCallInstance(); |
| 152 | } |
| 153 | return super.eGet(featureID, resolve, coreType); |
| 154 | } |
| 155 | |
| 156 | /** |
| 157 | * <!-- begin-user-doc --> |
| 158 | * <!-- end-user-doc --> |
| 159 | * @generated |
| 160 | */ |
| 161 | @Override |
| 162 | public void eSet(int featureID, Object newValue) { |
| 163 | switch (featureID) { |
| 164 | case ParametersPackage.OPERATION_REFERENCE__CALL_INSTANCE: |
| 165 | setCallInstance((CallInstance)newValue); |
| 166 | return; |
| 167 | } |
| 168 | super.eSet(featureID, newValue); |
| 169 | } |
| 170 | |
| 171 | /** |
| 172 | * <!-- begin-user-doc --> |
| 173 | * <!-- end-user-doc --> |
| 174 | * @generated |
| 175 | */ |
| 176 | @Override |
| 177 | public void eUnset(int featureID) { |
| 178 | switch (featureID) { |
| 179 | case ParametersPackage.OPERATION_REFERENCE__CALL_INSTANCE: |
| 180 | setCallInstance((CallInstance)null); |
| 181 | return; |
| 182 | } |
| 183 | super.eUnset(featureID); |
| 184 | } |
| 185 | |
| 186 | /** |
| 187 | * <!-- begin-user-doc --> |
| 188 | * <!-- end-user-doc --> |
| 189 | * @generated |
| 190 | */ |
| 191 | @Override |
| 192 | public boolean eIsSet(int featureID) { |
| 193 | switch (featureID) { |
| 194 | case ParametersPackage.OPERATION_REFERENCE__CALL_INSTANCE: |
| 195 | return getCallInstance() != null; |
| 196 | } |
| 197 | return super.eIsSet(featureID); |
| 198 | } |
| 199 | |
| 200 | } //OperationReferenceImpl |