1 | /** |
2 | * <copyright> |
3 | * </copyright> |
4 | * |
5 | * $Id$ |
6 | */ |
7 | package de.uka.ipd.sdq.sensitivity.impl; |
8 | |
9 | import de.uka.ipd.sdq.sensitivity.SensitivityPackage; |
10 | import de.uka.ipd.sdq.sensitivity.SensitivityParameterVariation; |
11 | import de.uka.ipd.sdq.sensitivity.SingleSensitivityParameter; |
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>Parameter Variation</b></em>'. |
27 | * <!-- end-user-doc --> |
28 | * <p> |
29 | * The following features are implemented: |
30 | * <ul> |
31 | * <li>{@link de.uka.ipd.sdq.sensitivity.impl.SensitivityParameterVariationImpl#getSingleSensitivityParameter__SensitivityParameterVariation <em>Single Sensitivity Parameter Sensitivity Parameter Variation</em>}</li> |
32 | * </ul> |
33 | * </p> |
34 | * |
35 | * @generated |
36 | */ |
37 | public abstract class SensitivityParameterVariationImpl extends EObjectImpl implements SensitivityParameterVariation { |
38 | /** |
39 | * <!-- begin-user-doc --> |
40 | * <!-- end-user-doc --> |
41 | * @generated |
42 | */ |
43 | protected SensitivityParameterVariationImpl() { |
44 | super(); |
45 | } |
46 | |
47 | /** |
48 | * <!-- begin-user-doc --> |
49 | * <!-- end-user-doc --> |
50 | * @generated |
51 | */ |
52 | @Override |
53 | protected EClass eStaticClass() { |
54 | return SensitivityPackage.Literals.SENSITIVITY_PARAMETER_VARIATION; |
55 | } |
56 | |
57 | /** |
58 | * <!-- begin-user-doc --> |
59 | * <!-- end-user-doc --> |
60 | * @generated |
61 | */ |
62 | public SingleSensitivityParameter getSingleSensitivityParameter__SensitivityParameterVariation() { |
63 | if (eContainerFeatureID() != SensitivityPackage.SENSITIVITY_PARAMETER_VARIATION__SINGLE_SENSITIVITY_PARAMETER_SENSITIVITY_PARAMETER_VARIATION) return null; |
64 | return (SingleSensitivityParameter)eContainer(); |
65 | } |
66 | |
67 | /** |
68 | * <!-- begin-user-doc --> |
69 | * <!-- end-user-doc --> |
70 | * @generated |
71 | */ |
72 | public NotificationChain basicSetSingleSensitivityParameter__SensitivityParameterVariation(SingleSensitivityParameter newSingleSensitivityParameter__SensitivityParameterVariation, NotificationChain msgs) { |
73 | msgs = eBasicSetContainer((InternalEObject)newSingleSensitivityParameter__SensitivityParameterVariation, SensitivityPackage.SENSITIVITY_PARAMETER_VARIATION__SINGLE_SENSITIVITY_PARAMETER_SENSITIVITY_PARAMETER_VARIATION, msgs); |
74 | return msgs; |
75 | } |
76 | |
77 | /** |
78 | * <!-- begin-user-doc --> |
79 | * <!-- end-user-doc --> |
80 | * @generated |
81 | */ |
82 | public void setSingleSensitivityParameter__SensitivityParameterVariation(SingleSensitivityParameter newSingleSensitivityParameter__SensitivityParameterVariation) { |
83 | if (newSingleSensitivityParameter__SensitivityParameterVariation != eInternalContainer() || (eContainerFeatureID() != SensitivityPackage.SENSITIVITY_PARAMETER_VARIATION__SINGLE_SENSITIVITY_PARAMETER_SENSITIVITY_PARAMETER_VARIATION && newSingleSensitivityParameter__SensitivityParameterVariation != null)) { |
84 | if (EcoreUtil.isAncestor(this, newSingleSensitivityParameter__SensitivityParameterVariation)) |
85 | throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); |
86 | NotificationChain msgs = null; |
87 | if (eInternalContainer() != null) |
88 | msgs = eBasicRemoveFromContainer(msgs); |
89 | if (newSingleSensitivityParameter__SensitivityParameterVariation != null) |
90 | msgs = ((InternalEObject)newSingleSensitivityParameter__SensitivityParameterVariation).eInverseAdd(this, SensitivityPackage.SINGLE_SENSITIVITY_PARAMETER__SENSITIVITY_PARAMETER_VARIATION_SINGLE_SENSITIVITY_PARAMETER, SingleSensitivityParameter.class, msgs); |
91 | msgs = basicSetSingleSensitivityParameter__SensitivityParameterVariation(newSingleSensitivityParameter__SensitivityParameterVariation, msgs); |
92 | if (msgs != null) msgs.dispatch(); |
93 | } |
94 | else if (eNotificationRequired()) |
95 | eNotify(new ENotificationImpl(this, Notification.SET, SensitivityPackage.SENSITIVITY_PARAMETER_VARIATION__SINGLE_SENSITIVITY_PARAMETER_SENSITIVITY_PARAMETER_VARIATION, newSingleSensitivityParameter__SensitivityParameterVariation, newSingleSensitivityParameter__SensitivityParameterVariation)); |
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 SensitivityPackage.SENSITIVITY_PARAMETER_VARIATION__SINGLE_SENSITIVITY_PARAMETER_SENSITIVITY_PARAMETER_VARIATION: |
107 | if (eInternalContainer() != null) |
108 | msgs = eBasicRemoveFromContainer(msgs); |
109 | return basicSetSingleSensitivityParameter__SensitivityParameterVariation((SingleSensitivityParameter)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 SensitivityPackage.SENSITIVITY_PARAMETER_VARIATION__SINGLE_SENSITIVITY_PARAMETER_SENSITIVITY_PARAMETER_VARIATION: |
123 | return basicSetSingleSensitivityParameter__SensitivityParameterVariation(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 SensitivityPackage.SENSITIVITY_PARAMETER_VARIATION__SINGLE_SENSITIVITY_PARAMETER_SENSITIVITY_PARAMETER_VARIATION: |
137 | return eInternalContainer().eInverseRemove(this, SensitivityPackage.SINGLE_SENSITIVITY_PARAMETER__SENSITIVITY_PARAMETER_VARIATION_SINGLE_SENSITIVITY_PARAMETER, SingleSensitivityParameter.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 SensitivityPackage.SENSITIVITY_PARAMETER_VARIATION__SINGLE_SENSITIVITY_PARAMETER_SENSITIVITY_PARAMETER_VARIATION: |
151 | return getSingleSensitivityParameter__SensitivityParameterVariation(); |
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 SensitivityPackage.SENSITIVITY_PARAMETER_VARIATION__SINGLE_SENSITIVITY_PARAMETER_SENSITIVITY_PARAMETER_VARIATION: |
165 | setSingleSensitivityParameter__SensitivityParameterVariation((SingleSensitivityParameter)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 SensitivityPackage.SENSITIVITY_PARAMETER_VARIATION__SINGLE_SENSITIVITY_PARAMETER_SENSITIVITY_PARAMETER_VARIATION: |
180 | setSingleSensitivityParameter__SensitivityParameterVariation((SingleSensitivityParameter)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 SensitivityPackage.SENSITIVITY_PARAMETER_VARIATION__SINGLE_SENSITIVITY_PARAMETER_SENSITIVITY_PARAMETER_VARIATION: |
195 | return getSingleSensitivityParameter__SensitivityParameterVariation() != null; |
196 | } |
197 | return super.eIsSet(featureID); |
198 | } |
199 | |
200 | } //SensitivityParameterVariationImpl |