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.reliability.SoftwareInducedFailureType; |
10 | |
11 | import de.uka.ipd.sdq.pcm.seff.InternalAction; |
12 | |
13 | import de.uka.ipd.sdq.sensitivity.InternalActionReliabilityParameter; |
14 | import de.uka.ipd.sdq.sensitivity.SensitivityPackage; |
15 | |
16 | import de.uka.ipd.sdq.sensitivity.util.SensitivityValidator; |
17 | |
18 | import java.util.Map; |
19 | |
20 | import org.eclipse.emf.common.notify.Notification; |
21 | |
22 | import org.eclipse.emf.common.util.BasicDiagnostic; |
23 | import org.eclipse.emf.common.util.Diagnostic; |
24 | import org.eclipse.emf.common.util.DiagnosticChain; |
25 | |
26 | import org.eclipse.emf.ecore.EClass; |
27 | import org.eclipse.emf.ecore.InternalEObject; |
28 | |
29 | import org.eclipse.emf.ecore.impl.ENotificationImpl; |
30 | |
31 | import org.eclipse.emf.ecore.plugin.EcorePlugin; |
32 | |
33 | import org.eclipse.emf.ecore.util.EObjectValidator; |
34 | |
35 | /** |
36 | * <!-- begin-user-doc --> |
37 | * An implementation of the model object '<em><b>Internal Action Reliability Parameter</b></em>'. |
38 | * <!-- end-user-doc --> |
39 | * <p> |
40 | * The following features are implemented: |
41 | * <ul> |
42 | * <li>{@link de.uka.ipd.sdq.sensitivity.impl.InternalActionReliabilityParameterImpl#getSoftwareInducedFailureType__InternalActionReliabilityParameter <em>Software Induced Failure Type Internal Action Reliability Parameter</em>}</li> |
43 | * <li>{@link de.uka.ipd.sdq.sensitivity.impl.InternalActionReliabilityParameterImpl#getInternalAction__InternalActionReliabilityParameter <em>Internal Action Internal Action Reliability Parameter</em>}</li> |
44 | * </ul> |
45 | * </p> |
46 | * |
47 | * @generated |
48 | */ |
49 | public class InternalActionReliabilityParameterImpl extends SingleSensitivityParameterImpl implements InternalActionReliabilityParameter { |
50 | /** |
51 | * The cached value of the '{@link #getSoftwareInducedFailureType__InternalActionReliabilityParameter() <em>Software Induced Failure Type Internal Action Reliability Parameter</em>}' reference. |
52 | * <!-- begin-user-doc --> |
53 | * <!-- end-user-doc --> |
54 | * @see #getSoftwareInducedFailureType__InternalActionReliabilityParameter() |
55 | * @generated |
56 | * @ordered |
57 | */ |
58 | protected SoftwareInducedFailureType softwareInducedFailureType__InternalActionReliabilityParameter; |
59 | |
60 | /** |
61 | * The cached value of the '{@link #getInternalAction__InternalActionReliabilityParameter() <em>Internal Action Internal Action Reliability Parameter</em>}' reference. |
62 | * <!-- begin-user-doc --> |
63 | * <!-- end-user-doc --> |
64 | * @see #getInternalAction__InternalActionReliabilityParameter() |
65 | * @generated |
66 | * @ordered |
67 | */ |
68 | protected InternalAction internalAction__InternalActionReliabilityParameter; |
69 | |
70 | /** |
71 | * <!-- begin-user-doc --> |
72 | * <!-- end-user-doc --> |
73 | * @generated |
74 | */ |
75 | protected InternalActionReliabilityParameterImpl() { |
76 | super(); |
77 | } |
78 | |
79 | /** |
80 | * <!-- begin-user-doc --> |
81 | * <!-- end-user-doc --> |
82 | * @generated |
83 | */ |
84 | @Override |
85 | protected EClass eStaticClass() { |
86 | return SensitivityPackage.Literals.INTERNAL_ACTION_RELIABILITY_PARAMETER; |
87 | } |
88 | |
89 | /** |
90 | * <!-- begin-user-doc --> |
91 | * <!-- end-user-doc --> |
92 | * @generated |
93 | */ |
94 | public SoftwareInducedFailureType getSoftwareInducedFailureType__InternalActionReliabilityParameter() { |
95 | if (softwareInducedFailureType__InternalActionReliabilityParameter != null && softwareInducedFailureType__InternalActionReliabilityParameter.eIsProxy()) { |
96 | InternalEObject oldSoftwareInducedFailureType__InternalActionReliabilityParameter = (InternalEObject)softwareInducedFailureType__InternalActionReliabilityParameter; |
97 | softwareInducedFailureType__InternalActionReliabilityParameter = (SoftwareInducedFailureType)eResolveProxy(oldSoftwareInducedFailureType__InternalActionReliabilityParameter); |
98 | if (softwareInducedFailureType__InternalActionReliabilityParameter != oldSoftwareInducedFailureType__InternalActionReliabilityParameter) { |
99 | if (eNotificationRequired()) |
100 | eNotify(new ENotificationImpl(this, Notification.RESOLVE, SensitivityPackage.INTERNAL_ACTION_RELIABILITY_PARAMETER__SOFTWARE_INDUCED_FAILURE_TYPE_INTERNAL_ACTION_RELIABILITY_PARAMETER, oldSoftwareInducedFailureType__InternalActionReliabilityParameter, softwareInducedFailureType__InternalActionReliabilityParameter)); |
101 | } |
102 | } |
103 | return softwareInducedFailureType__InternalActionReliabilityParameter; |
104 | } |
105 | |
106 | /** |
107 | * <!-- begin-user-doc --> |
108 | * <!-- end-user-doc --> |
109 | * @generated |
110 | */ |
111 | public SoftwareInducedFailureType basicGetSoftwareInducedFailureType__InternalActionReliabilityParameter() { |
112 | return softwareInducedFailureType__InternalActionReliabilityParameter; |
113 | } |
114 | |
115 | /** |
116 | * <!-- begin-user-doc --> |
117 | * <!-- end-user-doc --> |
118 | * @generated |
119 | */ |
120 | public void setSoftwareInducedFailureType__InternalActionReliabilityParameter(SoftwareInducedFailureType newSoftwareInducedFailureType__InternalActionReliabilityParameter) { |
121 | SoftwareInducedFailureType oldSoftwareInducedFailureType__InternalActionReliabilityParameter = softwareInducedFailureType__InternalActionReliabilityParameter; |
122 | softwareInducedFailureType__InternalActionReliabilityParameter = newSoftwareInducedFailureType__InternalActionReliabilityParameter; |
123 | if (eNotificationRequired()) |
124 | eNotify(new ENotificationImpl(this, Notification.SET, SensitivityPackage.INTERNAL_ACTION_RELIABILITY_PARAMETER__SOFTWARE_INDUCED_FAILURE_TYPE_INTERNAL_ACTION_RELIABILITY_PARAMETER, oldSoftwareInducedFailureType__InternalActionReliabilityParameter, softwareInducedFailureType__InternalActionReliabilityParameter)); |
125 | } |
126 | |
127 | /** |
128 | * <!-- begin-user-doc --> |
129 | * <!-- end-user-doc --> |
130 | * @generated |
131 | */ |
132 | public InternalAction getInternalAction__InternalActionReliabilityParameter() { |
133 | if (internalAction__InternalActionReliabilityParameter != null && internalAction__InternalActionReliabilityParameter.eIsProxy()) { |
134 | InternalEObject oldInternalAction__InternalActionReliabilityParameter = (InternalEObject)internalAction__InternalActionReliabilityParameter; |
135 | internalAction__InternalActionReliabilityParameter = (InternalAction)eResolveProxy(oldInternalAction__InternalActionReliabilityParameter); |
136 | if (internalAction__InternalActionReliabilityParameter != oldInternalAction__InternalActionReliabilityParameter) { |
137 | if (eNotificationRequired()) |
138 | eNotify(new ENotificationImpl(this, Notification.RESOLVE, SensitivityPackage.INTERNAL_ACTION_RELIABILITY_PARAMETER__INTERNAL_ACTION_INTERNAL_ACTION_RELIABILITY_PARAMETER, oldInternalAction__InternalActionReliabilityParameter, internalAction__InternalActionReliabilityParameter)); |
139 | } |
140 | } |
141 | return internalAction__InternalActionReliabilityParameter; |
142 | } |
143 | |
144 | /** |
145 | * <!-- begin-user-doc --> |
146 | * <!-- end-user-doc --> |
147 | * @generated |
148 | */ |
149 | public InternalAction basicGetInternalAction__InternalActionReliabilityParameter() { |
150 | return internalAction__InternalActionReliabilityParameter; |
151 | } |
152 | |
153 | /** |
154 | * <!-- begin-user-doc --> |
155 | * <!-- end-user-doc --> |
156 | * @generated |
157 | */ |
158 | public void setInternalAction__InternalActionReliabilityParameter(InternalAction newInternalAction__InternalActionReliabilityParameter) { |
159 | InternalAction oldInternalAction__InternalActionReliabilityParameter = internalAction__InternalActionReliabilityParameter; |
160 | internalAction__InternalActionReliabilityParameter = newInternalAction__InternalActionReliabilityParameter; |
161 | if (eNotificationRequired()) |
162 | eNotify(new ENotificationImpl(this, Notification.SET, SensitivityPackage.INTERNAL_ACTION_RELIABILITY_PARAMETER__INTERNAL_ACTION_INTERNAL_ACTION_RELIABILITY_PARAMETER, oldInternalAction__InternalActionReliabilityParameter, internalAction__InternalActionReliabilityParameter)); |
163 | } |
164 | |
165 | /** |
166 | * <!-- begin-user-doc --> |
167 | * <!-- end-user-doc --> |
168 | * @generated |
169 | */ |
170 | public boolean InternalActionReliabilityParameterMustHaveDoubleVariation(DiagnosticChain diagnostics, Map<Object, Object> context) { |
171 | // TODO: implement this method |
172 | // -> specify the condition that violates the invariant |
173 | // -> verify the details of the diagnostic, including severity and message |
174 | // Ensure that you remove @generated or mark it @generated NOT |
175 | if (false) { |
176 | if (diagnostics != null) { |
177 | diagnostics.add |
178 | (new BasicDiagnostic |
179 | (Diagnostic.ERROR, |
180 | SensitivityValidator.DIAGNOSTIC_SOURCE, |
181 | SensitivityValidator.INTERNAL_ACTION_RELIABILITY_PARAMETER__INTERNAL_ACTION_RELIABILITY_PARAMETER_MUST_HAVE_DOUBLE_VARIATION, |
182 | EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "InternalActionReliabilityParameterMustHaveDoubleVariation", EObjectValidator.getObjectLabel(this, context) }), |
183 | new Object [] { this })); |
184 | } |
185 | return false; |
186 | } |
187 | return true; |
188 | } |
189 | |
190 | /** |
191 | * <!-- begin-user-doc --> |
192 | * <!-- end-user-doc --> |
193 | * @generated |
194 | */ |
195 | @Override |
196 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
197 | switch (featureID) { |
198 | case SensitivityPackage.INTERNAL_ACTION_RELIABILITY_PARAMETER__SOFTWARE_INDUCED_FAILURE_TYPE_INTERNAL_ACTION_RELIABILITY_PARAMETER: |
199 | if (resolve) return getSoftwareInducedFailureType__InternalActionReliabilityParameter(); |
200 | return basicGetSoftwareInducedFailureType__InternalActionReliabilityParameter(); |
201 | case SensitivityPackage.INTERNAL_ACTION_RELIABILITY_PARAMETER__INTERNAL_ACTION_INTERNAL_ACTION_RELIABILITY_PARAMETER: |
202 | if (resolve) return getInternalAction__InternalActionReliabilityParameter(); |
203 | return basicGetInternalAction__InternalActionReliabilityParameter(); |
204 | } |
205 | return super.eGet(featureID, resolve, coreType); |
206 | } |
207 | |
208 | /** |
209 | * <!-- begin-user-doc --> |
210 | * <!-- end-user-doc --> |
211 | * @generated |
212 | */ |
213 | @Override |
214 | public void eSet(int featureID, Object newValue) { |
215 | switch (featureID) { |
216 | case SensitivityPackage.INTERNAL_ACTION_RELIABILITY_PARAMETER__SOFTWARE_INDUCED_FAILURE_TYPE_INTERNAL_ACTION_RELIABILITY_PARAMETER: |
217 | setSoftwareInducedFailureType__InternalActionReliabilityParameter((SoftwareInducedFailureType)newValue); |
218 | return; |
219 | case SensitivityPackage.INTERNAL_ACTION_RELIABILITY_PARAMETER__INTERNAL_ACTION_INTERNAL_ACTION_RELIABILITY_PARAMETER: |
220 | setInternalAction__InternalActionReliabilityParameter((InternalAction)newValue); |
221 | return; |
222 | } |
223 | super.eSet(featureID, newValue); |
224 | } |
225 | |
226 | /** |
227 | * <!-- begin-user-doc --> |
228 | * <!-- end-user-doc --> |
229 | * @generated |
230 | */ |
231 | @Override |
232 | public void eUnset(int featureID) { |
233 | switch (featureID) { |
234 | case SensitivityPackage.INTERNAL_ACTION_RELIABILITY_PARAMETER__SOFTWARE_INDUCED_FAILURE_TYPE_INTERNAL_ACTION_RELIABILITY_PARAMETER: |
235 | setSoftwareInducedFailureType__InternalActionReliabilityParameter((SoftwareInducedFailureType)null); |
236 | return; |
237 | case SensitivityPackage.INTERNAL_ACTION_RELIABILITY_PARAMETER__INTERNAL_ACTION_INTERNAL_ACTION_RELIABILITY_PARAMETER: |
238 | setInternalAction__InternalActionReliabilityParameter((InternalAction)null); |
239 | return; |
240 | } |
241 | super.eUnset(featureID); |
242 | } |
243 | |
244 | /** |
245 | * <!-- begin-user-doc --> |
246 | * <!-- end-user-doc --> |
247 | * @generated |
248 | */ |
249 | @Override |
250 | public boolean eIsSet(int featureID) { |
251 | switch (featureID) { |
252 | case SensitivityPackage.INTERNAL_ACTION_RELIABILITY_PARAMETER__SOFTWARE_INDUCED_FAILURE_TYPE_INTERNAL_ACTION_RELIABILITY_PARAMETER: |
253 | return softwareInducedFailureType__InternalActionReliabilityParameter != null; |
254 | case SensitivityPackage.INTERNAL_ACTION_RELIABILITY_PARAMETER__INTERNAL_ACTION_INTERNAL_ACTION_RELIABILITY_PARAMETER: |
255 | return internalAction__InternalActionReliabilityParameter != null; |
256 | } |
257 | return super.eIsSet(featureID); |
258 | } |
259 | |
260 | } //InternalActionReliabilityParameterImpl |