1 | /** |
2 | * <copyright> |
3 | * </copyright> |
4 | * |
5 | * $Id$ |
6 | */ |
7 | package de.uka.ipd.sdq.sensitivity.impl; |
8 | |
9 | import de.uka.ipd.sdq.pcm.core.entity.impl.EntityImpl; |
10 | |
11 | import de.uka.ipd.sdq.sensitivity.SensitivityConfiguration; |
12 | import de.uka.ipd.sdq.sensitivity.SensitivityPackage; |
13 | import de.uka.ipd.sdq.sensitivity.SensitivityParameter; |
14 | import de.uka.ipd.sdq.sensitivity.SensitivityResultSpecification; |
15 | |
16 | import java.util.Collection; |
17 | |
18 | import org.eclipse.emf.common.notify.Notification; |
19 | import org.eclipse.emf.common.notify.NotificationChain; |
20 | |
21 | import org.eclipse.emf.common.util.EList; |
22 | |
23 | import org.eclipse.emf.ecore.EClass; |
24 | import org.eclipse.emf.ecore.InternalEObject; |
25 | |
26 | import org.eclipse.emf.ecore.impl.ENotificationImpl; |
27 | |
28 | import org.eclipse.emf.ecore.util.EObjectContainmentEList; |
29 | import org.eclipse.emf.ecore.util.InternalEList; |
30 | |
31 | /** |
32 | * <!-- begin-user-doc --> |
33 | * An implementation of the model object '<em><b>Configuration</b></em>'. |
34 | * <!-- end-user-doc --> |
35 | * <p> |
36 | * The following features are implemented: |
37 | * <ul> |
38 | * <li>{@link de.uka.ipd.sdq.sensitivity.impl.SensitivityConfigurationImpl#getSensitivityParameters__SensitivityConfiguration <em>Sensitivity Parameters Sensitivity Configuration</em>}</li> |
39 | * <li>{@link de.uka.ipd.sdq.sensitivity.impl.SensitivityConfigurationImpl#getSensitivityResultSpecifications__SensitivityConfiguration <em>Sensitivity Result Specifications Sensitivity Configuration</em>}</li> |
40 | * </ul> |
41 | * </p> |
42 | * |
43 | * @generated |
44 | */ |
45 | public class SensitivityConfigurationImpl extends EntityImpl implements SensitivityConfiguration { |
46 | /** |
47 | * The cached value of the '{@link #getSensitivityParameters__SensitivityConfiguration() <em>Sensitivity Parameters Sensitivity Configuration</em>}' containment reference. |
48 | * <!-- begin-user-doc --> |
49 | * <!-- end-user-doc --> |
50 | * @see #getSensitivityParameters__SensitivityConfiguration() |
51 | * @generated |
52 | * @ordered |
53 | */ |
54 | protected SensitivityParameter sensitivityParameters__SensitivityConfiguration; |
55 | |
56 | /** |
57 | * The cached value of the '{@link #getSensitivityResultSpecifications__SensitivityConfiguration() <em>Sensitivity Result Specifications Sensitivity Configuration</em>}' containment reference list. |
58 | * <!-- begin-user-doc --> |
59 | * <!-- end-user-doc --> |
60 | * @see #getSensitivityResultSpecifications__SensitivityConfiguration() |
61 | * @generated |
62 | * @ordered |
63 | */ |
64 | protected EList<SensitivityResultSpecification> sensitivityResultSpecifications__SensitivityConfiguration; |
65 | |
66 | /** |
67 | * <!-- begin-user-doc --> |
68 | * <!-- end-user-doc --> |
69 | * @generated |
70 | */ |
71 | protected SensitivityConfigurationImpl() { |
72 | super(); |
73 | } |
74 | |
75 | /** |
76 | * <!-- begin-user-doc --> |
77 | * <!-- end-user-doc --> |
78 | * @generated |
79 | */ |
80 | @Override |
81 | protected EClass eStaticClass() { |
82 | return SensitivityPackage.Literals.SENSITIVITY_CONFIGURATION; |
83 | } |
84 | |
85 | /** |
86 | * <!-- begin-user-doc --> |
87 | * <!-- end-user-doc --> |
88 | * @generated |
89 | */ |
90 | public SensitivityParameter getSensitivityParameters__SensitivityConfiguration() { |
91 | return sensitivityParameters__SensitivityConfiguration; |
92 | } |
93 | |
94 | /** |
95 | * <!-- begin-user-doc --> |
96 | * <!-- end-user-doc --> |
97 | * @generated |
98 | */ |
99 | public NotificationChain basicSetSensitivityParameters__SensitivityConfiguration(SensitivityParameter newSensitivityParameters__SensitivityConfiguration, NotificationChain msgs) { |
100 | SensitivityParameter oldSensitivityParameters__SensitivityConfiguration = sensitivityParameters__SensitivityConfiguration; |
101 | sensitivityParameters__SensitivityConfiguration = newSensitivityParameters__SensitivityConfiguration; |
102 | if (eNotificationRequired()) { |
103 | ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SensitivityPackage.SENSITIVITY_CONFIGURATION__SENSITIVITY_PARAMETERS_SENSITIVITY_CONFIGURATION, oldSensitivityParameters__SensitivityConfiguration, newSensitivityParameters__SensitivityConfiguration); |
104 | if (msgs == null) msgs = notification; else msgs.add(notification); |
105 | } |
106 | return msgs; |
107 | } |
108 | |
109 | /** |
110 | * <!-- begin-user-doc --> |
111 | * <!-- end-user-doc --> |
112 | * @generated |
113 | */ |
114 | public void setSensitivityParameters__SensitivityConfiguration(SensitivityParameter newSensitivityParameters__SensitivityConfiguration) { |
115 | if (newSensitivityParameters__SensitivityConfiguration != sensitivityParameters__SensitivityConfiguration) { |
116 | NotificationChain msgs = null; |
117 | if (sensitivityParameters__SensitivityConfiguration != null) |
118 | msgs = ((InternalEObject)sensitivityParameters__SensitivityConfiguration).eInverseRemove(this, SensitivityPackage.SENSITIVITY_PARAMETER__SENSITIVITY_CONFIGURATION_SENSITIVITY_PARAMETER, SensitivityParameter.class, msgs); |
119 | if (newSensitivityParameters__SensitivityConfiguration != null) |
120 | msgs = ((InternalEObject)newSensitivityParameters__SensitivityConfiguration).eInverseAdd(this, SensitivityPackage.SENSITIVITY_PARAMETER__SENSITIVITY_CONFIGURATION_SENSITIVITY_PARAMETER, SensitivityParameter.class, msgs); |
121 | msgs = basicSetSensitivityParameters__SensitivityConfiguration(newSensitivityParameters__SensitivityConfiguration, msgs); |
122 | if (msgs != null) msgs.dispatch(); |
123 | } |
124 | else if (eNotificationRequired()) |
125 | eNotify(new ENotificationImpl(this, Notification.SET, SensitivityPackage.SENSITIVITY_CONFIGURATION__SENSITIVITY_PARAMETERS_SENSITIVITY_CONFIGURATION, newSensitivityParameters__SensitivityConfiguration, newSensitivityParameters__SensitivityConfiguration)); |
126 | } |
127 | |
128 | /** |
129 | * <!-- begin-user-doc --> |
130 | * <!-- end-user-doc --> |
131 | * @generated |
132 | */ |
133 | public EList<SensitivityResultSpecification> getSensitivityResultSpecifications__SensitivityConfiguration() { |
134 | if (sensitivityResultSpecifications__SensitivityConfiguration == null) { |
135 | sensitivityResultSpecifications__SensitivityConfiguration = new EObjectContainmentEList<SensitivityResultSpecification>(SensitivityResultSpecification.class, this, SensitivityPackage.SENSITIVITY_CONFIGURATION__SENSITIVITY_RESULT_SPECIFICATIONS_SENSITIVITY_CONFIGURATION); |
136 | } |
137 | return sensitivityResultSpecifications__SensitivityConfiguration; |
138 | } |
139 | |
140 | /** |
141 | * <!-- begin-user-doc --> |
142 | * <!-- end-user-doc --> |
143 | * @generated |
144 | */ |
145 | @Override |
146 | public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
147 | switch (featureID) { |
148 | case SensitivityPackage.SENSITIVITY_CONFIGURATION__SENSITIVITY_PARAMETERS_SENSITIVITY_CONFIGURATION: |
149 | if (sensitivityParameters__SensitivityConfiguration != null) |
150 | msgs = ((InternalEObject)sensitivityParameters__SensitivityConfiguration).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - SensitivityPackage.SENSITIVITY_CONFIGURATION__SENSITIVITY_PARAMETERS_SENSITIVITY_CONFIGURATION, null, msgs); |
151 | return basicSetSensitivityParameters__SensitivityConfiguration((SensitivityParameter)otherEnd, msgs); |
152 | } |
153 | return super.eInverseAdd(otherEnd, featureID, msgs); |
154 | } |
155 | |
156 | /** |
157 | * <!-- begin-user-doc --> |
158 | * <!-- end-user-doc --> |
159 | * @generated |
160 | */ |
161 | @Override |
162 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
163 | switch (featureID) { |
164 | case SensitivityPackage.SENSITIVITY_CONFIGURATION__SENSITIVITY_PARAMETERS_SENSITIVITY_CONFIGURATION: |
165 | return basicSetSensitivityParameters__SensitivityConfiguration(null, msgs); |
166 | case SensitivityPackage.SENSITIVITY_CONFIGURATION__SENSITIVITY_RESULT_SPECIFICATIONS_SENSITIVITY_CONFIGURATION: |
167 | return ((InternalEList<?>)getSensitivityResultSpecifications__SensitivityConfiguration()).basicRemove(otherEnd, msgs); |
168 | } |
169 | return super.eInverseRemove(otherEnd, featureID, msgs); |
170 | } |
171 | |
172 | /** |
173 | * <!-- begin-user-doc --> |
174 | * <!-- end-user-doc --> |
175 | * @generated |
176 | */ |
177 | @Override |
178 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
179 | switch (featureID) { |
180 | case SensitivityPackage.SENSITIVITY_CONFIGURATION__SENSITIVITY_PARAMETERS_SENSITIVITY_CONFIGURATION: |
181 | return getSensitivityParameters__SensitivityConfiguration(); |
182 | case SensitivityPackage.SENSITIVITY_CONFIGURATION__SENSITIVITY_RESULT_SPECIFICATIONS_SENSITIVITY_CONFIGURATION: |
183 | return getSensitivityResultSpecifications__SensitivityConfiguration(); |
184 | } |
185 | return super.eGet(featureID, resolve, coreType); |
186 | } |
187 | |
188 | /** |
189 | * <!-- begin-user-doc --> |
190 | * <!-- end-user-doc --> |
191 | * @generated |
192 | */ |
193 | @SuppressWarnings("unchecked") |
194 | @Override |
195 | public void eSet(int featureID, Object newValue) { |
196 | switch (featureID) { |
197 | case SensitivityPackage.SENSITIVITY_CONFIGURATION__SENSITIVITY_PARAMETERS_SENSITIVITY_CONFIGURATION: |
198 | setSensitivityParameters__SensitivityConfiguration((SensitivityParameter)newValue); |
199 | return; |
200 | case SensitivityPackage.SENSITIVITY_CONFIGURATION__SENSITIVITY_RESULT_SPECIFICATIONS_SENSITIVITY_CONFIGURATION: |
201 | getSensitivityResultSpecifications__SensitivityConfiguration().clear(); |
202 | getSensitivityResultSpecifications__SensitivityConfiguration().addAll((Collection<? extends SensitivityResultSpecification>)newValue); |
203 | return; |
204 | } |
205 | super.eSet(featureID, newValue); |
206 | } |
207 | |
208 | /** |
209 | * <!-- begin-user-doc --> |
210 | * <!-- end-user-doc --> |
211 | * @generated |
212 | */ |
213 | @Override |
214 | public void eUnset(int featureID) { |
215 | switch (featureID) { |
216 | case SensitivityPackage.SENSITIVITY_CONFIGURATION__SENSITIVITY_PARAMETERS_SENSITIVITY_CONFIGURATION: |
217 | setSensitivityParameters__SensitivityConfiguration((SensitivityParameter)null); |
218 | return; |
219 | case SensitivityPackage.SENSITIVITY_CONFIGURATION__SENSITIVITY_RESULT_SPECIFICATIONS_SENSITIVITY_CONFIGURATION: |
220 | getSensitivityResultSpecifications__SensitivityConfiguration().clear(); |
221 | return; |
222 | } |
223 | super.eUnset(featureID); |
224 | } |
225 | |
226 | /** |
227 | * <!-- begin-user-doc --> |
228 | * <!-- end-user-doc --> |
229 | * @generated |
230 | */ |
231 | @Override |
232 | public boolean eIsSet(int featureID) { |
233 | switch (featureID) { |
234 | case SensitivityPackage.SENSITIVITY_CONFIGURATION__SENSITIVITY_PARAMETERS_SENSITIVITY_CONFIGURATION: |
235 | return sensitivityParameters__SensitivityConfiguration != null; |
236 | case SensitivityPackage.SENSITIVITY_CONFIGURATION__SENSITIVITY_RESULT_SPECIFICATIONS_SENSITIVITY_CONFIGURATION: |
237 | return sensitivityResultSpecifications__SensitivityConfiguration != null && !sensitivityResultSpecifications__SensitivityConfiguration.isEmpty(); |
238 | } |
239 | return super.eIsSet(featureID); |
240 | } |
241 | |
242 | } //SensitivityConfigurationImpl |