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.resourceenvironment.ResourceContainer; |
10 | |
11 | import de.uka.ipd.sdq.pcm.resourcetype.ProcessingResourceType; |
12 | |
13 | import de.uka.ipd.sdq.sensitivity.ResourceMTTFParameter; |
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>Resource MTTF 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.ResourceMTTFParameterImpl#getProcessingResourceType__ResourceMTTFParameter <em>Processing Resource Type Resource MTTF Parameter</em>}</li> |
43 | * <li>{@link de.uka.ipd.sdq.sensitivity.impl.ResourceMTTFParameterImpl#getResourceContainer__ResourceMTTFParameter <em>Resource Container Resource MTTF Parameter</em>}</li> |
44 | * </ul> |
45 | * </p> |
46 | * |
47 | * @generated |
48 | */ |
49 | public class ResourceMTTFParameterImpl extends SingleSensitivityParameterImpl implements ResourceMTTFParameter { |
50 | /** |
51 | * The cached value of the '{@link #getProcessingResourceType__ResourceMTTFParameter() <em>Processing Resource Type Resource MTTF Parameter</em>}' reference. |
52 | * <!-- begin-user-doc --> |
53 | * <!-- end-user-doc --> |
54 | * @see #getProcessingResourceType__ResourceMTTFParameter() |
55 | * @generated |
56 | * @ordered |
57 | */ |
58 | protected ProcessingResourceType processingResourceType__ResourceMTTFParameter; |
59 | |
60 | /** |
61 | * The cached value of the '{@link #getResourceContainer__ResourceMTTFParameter() <em>Resource Container Resource MTTF Parameter</em>}' reference. |
62 | * <!-- begin-user-doc --> |
63 | * <!-- end-user-doc --> |
64 | * @see #getResourceContainer__ResourceMTTFParameter() |
65 | * @generated |
66 | * @ordered |
67 | */ |
68 | protected ResourceContainer resourceContainer__ResourceMTTFParameter; |
69 | |
70 | /** |
71 | * <!-- begin-user-doc --> |
72 | * <!-- end-user-doc --> |
73 | * @generated |
74 | */ |
75 | protected ResourceMTTFParameterImpl() { |
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.RESOURCE_MTTF_PARAMETER; |
87 | } |
88 | |
89 | /** |
90 | * <!-- begin-user-doc --> |
91 | * <!-- end-user-doc --> |
92 | * @generated |
93 | */ |
94 | public ProcessingResourceType getProcessingResourceType__ResourceMTTFParameter() { |
95 | if (processingResourceType__ResourceMTTFParameter != null && processingResourceType__ResourceMTTFParameter.eIsProxy()) { |
96 | InternalEObject oldProcessingResourceType__ResourceMTTFParameter = (InternalEObject)processingResourceType__ResourceMTTFParameter; |
97 | processingResourceType__ResourceMTTFParameter = (ProcessingResourceType)eResolveProxy(oldProcessingResourceType__ResourceMTTFParameter); |
98 | if (processingResourceType__ResourceMTTFParameter != oldProcessingResourceType__ResourceMTTFParameter) { |
99 | if (eNotificationRequired()) |
100 | eNotify(new ENotificationImpl(this, Notification.RESOLVE, SensitivityPackage.RESOURCE_MTTF_PARAMETER__PROCESSING_RESOURCE_TYPE_RESOURCE_MTTF_PARAMETER, oldProcessingResourceType__ResourceMTTFParameter, processingResourceType__ResourceMTTFParameter)); |
101 | } |
102 | } |
103 | return processingResourceType__ResourceMTTFParameter; |
104 | } |
105 | |
106 | /** |
107 | * <!-- begin-user-doc --> |
108 | * <!-- end-user-doc --> |
109 | * @generated |
110 | */ |
111 | public ProcessingResourceType basicGetProcessingResourceType__ResourceMTTFParameter() { |
112 | return processingResourceType__ResourceMTTFParameter; |
113 | } |
114 | |
115 | /** |
116 | * <!-- begin-user-doc --> |
117 | * <!-- end-user-doc --> |
118 | * @generated |
119 | */ |
120 | public void setProcessingResourceType__ResourceMTTFParameter(ProcessingResourceType newProcessingResourceType__ResourceMTTFParameter) { |
121 | ProcessingResourceType oldProcessingResourceType__ResourceMTTFParameter = processingResourceType__ResourceMTTFParameter; |
122 | processingResourceType__ResourceMTTFParameter = newProcessingResourceType__ResourceMTTFParameter; |
123 | if (eNotificationRequired()) |
124 | eNotify(new ENotificationImpl(this, Notification.SET, SensitivityPackage.RESOURCE_MTTF_PARAMETER__PROCESSING_RESOURCE_TYPE_RESOURCE_MTTF_PARAMETER, oldProcessingResourceType__ResourceMTTFParameter, processingResourceType__ResourceMTTFParameter)); |
125 | } |
126 | |
127 | /** |
128 | * <!-- begin-user-doc --> |
129 | * <!-- end-user-doc --> |
130 | * @generated |
131 | */ |
132 | public ResourceContainer getResourceContainer__ResourceMTTFParameter() { |
133 | if (resourceContainer__ResourceMTTFParameter != null && resourceContainer__ResourceMTTFParameter.eIsProxy()) { |
134 | InternalEObject oldResourceContainer__ResourceMTTFParameter = (InternalEObject)resourceContainer__ResourceMTTFParameter; |
135 | resourceContainer__ResourceMTTFParameter = (ResourceContainer)eResolveProxy(oldResourceContainer__ResourceMTTFParameter); |
136 | if (resourceContainer__ResourceMTTFParameter != oldResourceContainer__ResourceMTTFParameter) { |
137 | if (eNotificationRequired()) |
138 | eNotify(new ENotificationImpl(this, Notification.RESOLVE, SensitivityPackage.RESOURCE_MTTF_PARAMETER__RESOURCE_CONTAINER_RESOURCE_MTTF_PARAMETER, oldResourceContainer__ResourceMTTFParameter, resourceContainer__ResourceMTTFParameter)); |
139 | } |
140 | } |
141 | return resourceContainer__ResourceMTTFParameter; |
142 | } |
143 | |
144 | /** |
145 | * <!-- begin-user-doc --> |
146 | * <!-- end-user-doc --> |
147 | * @generated |
148 | */ |
149 | public ResourceContainer basicGetResourceContainer__ResourceMTTFParameter() { |
150 | return resourceContainer__ResourceMTTFParameter; |
151 | } |
152 | |
153 | /** |
154 | * <!-- begin-user-doc --> |
155 | * <!-- end-user-doc --> |
156 | * @generated |
157 | */ |
158 | public void setResourceContainer__ResourceMTTFParameter(ResourceContainer newResourceContainer__ResourceMTTFParameter) { |
159 | ResourceContainer oldResourceContainer__ResourceMTTFParameter = resourceContainer__ResourceMTTFParameter; |
160 | resourceContainer__ResourceMTTFParameter = newResourceContainer__ResourceMTTFParameter; |
161 | if (eNotificationRequired()) |
162 | eNotify(new ENotificationImpl(this, Notification.SET, SensitivityPackage.RESOURCE_MTTF_PARAMETER__RESOURCE_CONTAINER_RESOURCE_MTTF_PARAMETER, oldResourceContainer__ResourceMTTFParameter, resourceContainer__ResourceMTTFParameter)); |
163 | } |
164 | |
165 | /** |
166 | * <!-- begin-user-doc --> |
167 | * <!-- end-user-doc --> |
168 | * @generated |
169 | */ |
170 | public boolean ResourceMTTFParameterMustHaveDoubleVariation(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.RESOURCE_MTTF_PARAMETER__RESOURCE_MTTF_PARAMETER_MUST_HAVE_DOUBLE_VARIATION, |
182 | EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "ResourceMTTFParameterMustHaveDoubleVariation", 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.RESOURCE_MTTF_PARAMETER__PROCESSING_RESOURCE_TYPE_RESOURCE_MTTF_PARAMETER: |
199 | if (resolve) return getProcessingResourceType__ResourceMTTFParameter(); |
200 | return basicGetProcessingResourceType__ResourceMTTFParameter(); |
201 | case SensitivityPackage.RESOURCE_MTTF_PARAMETER__RESOURCE_CONTAINER_RESOURCE_MTTF_PARAMETER: |
202 | if (resolve) return getResourceContainer__ResourceMTTFParameter(); |
203 | return basicGetResourceContainer__ResourceMTTFParameter(); |
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.RESOURCE_MTTF_PARAMETER__PROCESSING_RESOURCE_TYPE_RESOURCE_MTTF_PARAMETER: |
217 | setProcessingResourceType__ResourceMTTFParameter((ProcessingResourceType)newValue); |
218 | return; |
219 | case SensitivityPackage.RESOURCE_MTTF_PARAMETER__RESOURCE_CONTAINER_RESOURCE_MTTF_PARAMETER: |
220 | setResourceContainer__ResourceMTTFParameter((ResourceContainer)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.RESOURCE_MTTF_PARAMETER__PROCESSING_RESOURCE_TYPE_RESOURCE_MTTF_PARAMETER: |
235 | setProcessingResourceType__ResourceMTTFParameter((ProcessingResourceType)null); |
236 | return; |
237 | case SensitivityPackage.RESOURCE_MTTF_PARAMETER__RESOURCE_CONTAINER_RESOURCE_MTTF_PARAMETER: |
238 | setResourceContainer__ResourceMTTFParameter((ResourceContainer)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.RESOURCE_MTTF_PARAMETER__PROCESSING_RESOURCE_TYPE_RESOURCE_MTTF_PARAMETER: |
253 | return processingResourceType__ResourceMTTFParameter != null; |
254 | case SensitivityPackage.RESOURCE_MTTF_PARAMETER__RESOURCE_CONTAINER_RESOURCE_MTTF_PARAMETER: |
255 | return resourceContainer__ResourceMTTFParameter != null; |
256 | } |
257 | return super.eIsSet(featureID); |
258 | } |
259 | |
260 | } //ResourceMTTFParameterImpl |