1 | /** |
2 | * <copyright> |
3 | * </copyright> |
4 | * |
5 | * $Id$ |
6 | */ |
7 | package de.uka.ipd.sdq.pcm.resultdecorator.resourceenvironmentdecorator.impl; |
8 | |
9 | import de.uka.ipd.sdq.pcm.core.composition.AssemblyContext; |
10 | import de.uka.ipd.sdq.pcm.repository.PassiveResource; |
11 | |
12 | import de.uka.ipd.sdq.pcm.resultdecorator.resourceenvironmentdecorator.PassiveResourceResult; |
13 | import de.uka.ipd.sdq.pcm.resultdecorator.resourceenvironmentdecorator.ResourceenvironmentdecoratorPackage; |
14 | |
15 | import org.eclipse.emf.common.notify.Notification; |
16 | |
17 | import org.eclipse.emf.ecore.EClass; |
18 | import org.eclipse.emf.ecore.InternalEObject; |
19 | |
20 | import org.eclipse.emf.ecore.impl.ENotificationImpl; |
21 | |
22 | /** |
23 | * <!-- begin-user-doc --> |
24 | * An implementation of the model object '<em><b>Passive Resource Result</b></em>'. |
25 | * <!-- end-user-doc --> |
26 | * <p> |
27 | * The following features are implemented: |
28 | * <ul> |
29 | * <li>{@link de.uka.ipd.sdq.pcm.resultdecorator.resourceenvironmentdecorator.impl.PassiveResourceResultImpl#getPassiveResource_PassiveResourceResult <em>Passive Resource Passive Resource Result</em>}</li> |
30 | * <li>{@link de.uka.ipd.sdq.pcm.resultdecorator.resourceenvironmentdecorator.impl.PassiveResourceResultImpl#getAssemblyContext_PassiveResourceResult <em>Assembly Context Passive Resource Result</em>}</li> |
31 | * <li>{@link de.uka.ipd.sdq.pcm.resultdecorator.resourceenvironmentdecorator.impl.PassiveResourceResultImpl#getAverageHoldingTime <em>Average Holding Time</em>}</li> |
32 | * </ul> |
33 | * </p> |
34 | * |
35 | * @generated |
36 | */ |
37 | public class PassiveResourceResultImpl extends UtilisationResultImpl implements PassiveResourceResult { |
38 | /** |
39 | * The cached value of the '{@link #getPassiveResource_PassiveResourceResult() <em>Passive Resource Passive Resource Result</em>}' reference. |
40 | * <!-- begin-user-doc --> |
41 | * <!-- end-user-doc --> |
42 | * @see #getPassiveResource_PassiveResourceResult() |
43 | * @generated |
44 | * @ordered |
45 | */ |
46 | protected PassiveResource passiveResource_PassiveResourceResult; |
47 | /** |
48 | * The cached value of the '{@link #getAssemblyContext_PassiveResourceResult() <em>Assembly Context Passive Resource Result</em>}' reference. |
49 | * <!-- begin-user-doc --> |
50 | * <!-- end-user-doc --> |
51 | * @see #getAssemblyContext_PassiveResourceResult() |
52 | * @generated |
53 | * @ordered |
54 | */ |
55 | protected AssemblyContext assemblyContext_PassiveResourceResult; |
56 | /** |
57 | * The default value of the '{@link #getAverageHoldingTime() <em>Average Holding Time</em>}' attribute. |
58 | * <!-- begin-user-doc --> |
59 | * <!-- end-user-doc --> |
60 | * @see #getAverageHoldingTime() |
61 | * @generated |
62 | * @ordered |
63 | */ |
64 | protected static final double AVERAGE_HOLDING_TIME_EDEFAULT = 0.0; |
65 | /** |
66 | * The cached value of the '{@link #getAverageHoldingTime() <em>Average Holding Time</em>}' attribute. |
67 | * <!-- begin-user-doc --> |
68 | * <!-- end-user-doc --> |
69 | * @see #getAverageHoldingTime() |
70 | * @generated |
71 | * @ordered |
72 | */ |
73 | protected double averageHoldingTime = AVERAGE_HOLDING_TIME_EDEFAULT; |
74 | /** |
75 | * <!-- begin-user-doc --> |
76 | * <!-- end-user-doc --> |
77 | * @generated |
78 | */ |
79 | protected PassiveResourceResultImpl() { |
80 | super(); |
81 | } |
82 | |
83 | /** |
84 | * <!-- begin-user-doc --> |
85 | * <!-- end-user-doc --> |
86 | * @generated |
87 | */ |
88 | @Override |
89 | protected EClass eStaticClass() { |
90 | return ResourceenvironmentdecoratorPackage.Literals.PASSIVE_RESOURCE_RESULT; |
91 | } |
92 | |
93 | /** |
94 | * <!-- begin-user-doc --> |
95 | * <!-- end-user-doc --> |
96 | * @generated |
97 | */ |
98 | public PassiveResource getPassiveResource_PassiveResourceResult() { |
99 | if (passiveResource_PassiveResourceResult != null && passiveResource_PassiveResourceResult.eIsProxy()) { |
100 | InternalEObject oldPassiveResource_PassiveResourceResult = (InternalEObject)passiveResource_PassiveResourceResult; |
101 | passiveResource_PassiveResourceResult = (PassiveResource)eResolveProxy(oldPassiveResource_PassiveResourceResult); |
102 | if (passiveResource_PassiveResourceResult != oldPassiveResource_PassiveResourceResult) { |
103 | if (eNotificationRequired()) |
104 | eNotify(new ENotificationImpl(this, Notification.RESOLVE, ResourceenvironmentdecoratorPackage.PASSIVE_RESOURCE_RESULT__PASSIVE_RESOURCE_PASSIVE_RESOURCE_RESULT, oldPassiveResource_PassiveResourceResult, passiveResource_PassiveResourceResult)); |
105 | } |
106 | } |
107 | return passiveResource_PassiveResourceResult; |
108 | } |
109 | |
110 | /** |
111 | * <!-- begin-user-doc --> |
112 | * <!-- end-user-doc --> |
113 | * @generated |
114 | */ |
115 | public PassiveResource basicGetPassiveResource_PassiveResourceResult() { |
116 | return passiveResource_PassiveResourceResult; |
117 | } |
118 | |
119 | /** |
120 | * <!-- begin-user-doc --> |
121 | * <!-- end-user-doc --> |
122 | * @generated |
123 | */ |
124 | public void setPassiveResource_PassiveResourceResult(PassiveResource newPassiveResource_PassiveResourceResult) { |
125 | PassiveResource oldPassiveResource_PassiveResourceResult = passiveResource_PassiveResourceResult; |
126 | passiveResource_PassiveResourceResult = newPassiveResource_PassiveResourceResult; |
127 | if (eNotificationRequired()) |
128 | eNotify(new ENotificationImpl(this, Notification.SET, ResourceenvironmentdecoratorPackage.PASSIVE_RESOURCE_RESULT__PASSIVE_RESOURCE_PASSIVE_RESOURCE_RESULT, oldPassiveResource_PassiveResourceResult, passiveResource_PassiveResourceResult)); |
129 | } |
130 | |
131 | /** |
132 | * <!-- begin-user-doc --> |
133 | * <!-- end-user-doc --> |
134 | * @generated |
135 | */ |
136 | public AssemblyContext getAssemblyContext_PassiveResourceResult() { |
137 | if (assemblyContext_PassiveResourceResult != null && assemblyContext_PassiveResourceResult.eIsProxy()) { |
138 | InternalEObject oldAssemblyContext_PassiveResourceResult = (InternalEObject)assemblyContext_PassiveResourceResult; |
139 | assemblyContext_PassiveResourceResult = (AssemblyContext)eResolveProxy(oldAssemblyContext_PassiveResourceResult); |
140 | if (assemblyContext_PassiveResourceResult != oldAssemblyContext_PassiveResourceResult) { |
141 | if (eNotificationRequired()) |
142 | eNotify(new ENotificationImpl(this, Notification.RESOLVE, ResourceenvironmentdecoratorPackage.PASSIVE_RESOURCE_RESULT__ASSEMBLY_CONTEXT_PASSIVE_RESOURCE_RESULT, oldAssemblyContext_PassiveResourceResult, assemblyContext_PassiveResourceResult)); |
143 | } |
144 | } |
145 | return assemblyContext_PassiveResourceResult; |
146 | } |
147 | |
148 | /** |
149 | * <!-- begin-user-doc --> |
150 | * <!-- end-user-doc --> |
151 | * @generated |
152 | */ |
153 | public AssemblyContext basicGetAssemblyContext_PassiveResourceResult() { |
154 | return assemblyContext_PassiveResourceResult; |
155 | } |
156 | |
157 | /** |
158 | * <!-- begin-user-doc --> |
159 | * <!-- end-user-doc --> |
160 | * @generated |
161 | */ |
162 | public void setAssemblyContext_PassiveResourceResult(AssemblyContext newAssemblyContext_PassiveResourceResult) { |
163 | AssemblyContext oldAssemblyContext_PassiveResourceResult = assemblyContext_PassiveResourceResult; |
164 | assemblyContext_PassiveResourceResult = newAssemblyContext_PassiveResourceResult; |
165 | if (eNotificationRequired()) |
166 | eNotify(new ENotificationImpl(this, Notification.SET, ResourceenvironmentdecoratorPackage.PASSIVE_RESOURCE_RESULT__ASSEMBLY_CONTEXT_PASSIVE_RESOURCE_RESULT, oldAssemblyContext_PassiveResourceResult, assemblyContext_PassiveResourceResult)); |
167 | } |
168 | |
169 | /** |
170 | * <!-- begin-user-doc --> |
171 | * <!-- end-user-doc --> |
172 | * @generated |
173 | */ |
174 | public double getAverageHoldingTime() { |
175 | return averageHoldingTime; |
176 | } |
177 | |
178 | /** |
179 | * <!-- begin-user-doc --> |
180 | * <!-- end-user-doc --> |
181 | * @generated |
182 | */ |
183 | public void setAverageHoldingTime(double newAverageHoldingTime) { |
184 | double oldAverageHoldingTime = averageHoldingTime; |
185 | averageHoldingTime = newAverageHoldingTime; |
186 | if (eNotificationRequired()) |
187 | eNotify(new ENotificationImpl(this, Notification.SET, ResourceenvironmentdecoratorPackage.PASSIVE_RESOURCE_RESULT__AVERAGE_HOLDING_TIME, oldAverageHoldingTime, averageHoldingTime)); |
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 ResourceenvironmentdecoratorPackage.PASSIVE_RESOURCE_RESULT__PASSIVE_RESOURCE_PASSIVE_RESOURCE_RESULT: |
199 | if (resolve) return getPassiveResource_PassiveResourceResult(); |
200 | return basicGetPassiveResource_PassiveResourceResult(); |
201 | case ResourceenvironmentdecoratorPackage.PASSIVE_RESOURCE_RESULT__ASSEMBLY_CONTEXT_PASSIVE_RESOURCE_RESULT: |
202 | if (resolve) return getAssemblyContext_PassiveResourceResult(); |
203 | return basicGetAssemblyContext_PassiveResourceResult(); |
204 | case ResourceenvironmentdecoratorPackage.PASSIVE_RESOURCE_RESULT__AVERAGE_HOLDING_TIME: |
205 | return getAverageHoldingTime(); |
206 | } |
207 | return super.eGet(featureID, resolve, coreType); |
208 | } |
209 | |
210 | /** |
211 | * <!-- begin-user-doc --> |
212 | * <!-- end-user-doc --> |
213 | * @generated |
214 | */ |
215 | @Override |
216 | public void eSet(int featureID, Object newValue) { |
217 | switch (featureID) { |
218 | case ResourceenvironmentdecoratorPackage.PASSIVE_RESOURCE_RESULT__PASSIVE_RESOURCE_PASSIVE_RESOURCE_RESULT: |
219 | setPassiveResource_PassiveResourceResult((PassiveResource)newValue); |
220 | return; |
221 | case ResourceenvironmentdecoratorPackage.PASSIVE_RESOURCE_RESULT__ASSEMBLY_CONTEXT_PASSIVE_RESOURCE_RESULT: |
222 | setAssemblyContext_PassiveResourceResult((AssemblyContext)newValue); |
223 | return; |
224 | case ResourceenvironmentdecoratorPackage.PASSIVE_RESOURCE_RESULT__AVERAGE_HOLDING_TIME: |
225 | setAverageHoldingTime((Double)newValue); |
226 | return; |
227 | } |
228 | super.eSet(featureID, newValue); |
229 | } |
230 | |
231 | /** |
232 | * <!-- begin-user-doc --> |
233 | * <!-- end-user-doc --> |
234 | * @generated |
235 | */ |
236 | @Override |
237 | public void eUnset(int featureID) { |
238 | switch (featureID) { |
239 | case ResourceenvironmentdecoratorPackage.PASSIVE_RESOURCE_RESULT__PASSIVE_RESOURCE_PASSIVE_RESOURCE_RESULT: |
240 | setPassiveResource_PassiveResourceResult((PassiveResource)null); |
241 | return; |
242 | case ResourceenvironmentdecoratorPackage.PASSIVE_RESOURCE_RESULT__ASSEMBLY_CONTEXT_PASSIVE_RESOURCE_RESULT: |
243 | setAssemblyContext_PassiveResourceResult((AssemblyContext)null); |
244 | return; |
245 | case ResourceenvironmentdecoratorPackage.PASSIVE_RESOURCE_RESULT__AVERAGE_HOLDING_TIME: |
246 | setAverageHoldingTime(AVERAGE_HOLDING_TIME_EDEFAULT); |
247 | return; |
248 | } |
249 | super.eUnset(featureID); |
250 | } |
251 | |
252 | /** |
253 | * <!-- begin-user-doc --> |
254 | * <!-- end-user-doc --> |
255 | * @generated |
256 | */ |
257 | @Override |
258 | public boolean eIsSet(int featureID) { |
259 | switch (featureID) { |
260 | case ResourceenvironmentdecoratorPackage.PASSIVE_RESOURCE_RESULT__PASSIVE_RESOURCE_PASSIVE_RESOURCE_RESULT: |
261 | return passiveResource_PassiveResourceResult != null; |
262 | case ResourceenvironmentdecoratorPackage.PASSIVE_RESOURCE_RESULT__ASSEMBLY_CONTEXT_PASSIVE_RESOURCE_RESULT: |
263 | return assemblyContext_PassiveResourceResult != null; |
264 | case ResourceenvironmentdecoratorPackage.PASSIVE_RESOURCE_RESULT__AVERAGE_HOLDING_TIME: |
265 | return averageHoldingTime != AVERAGE_HOLDING_TIME_EDEFAULT; |
266 | } |
267 | return super.eIsSet(featureID); |
268 | } |
269 | |
270 | /** |
271 | * <!-- begin-user-doc --> |
272 | * <!-- end-user-doc --> |
273 | * @generated |
274 | */ |
275 | @Override |
276 | public String toString() { |
277 | if (eIsProxy()) return super.toString(); |
278 | |
279 | StringBuffer result = new StringBuffer(super.toString()); |
280 | result.append(" (averageHoldingTime: "); |
281 | result.append(averageHoldingTime); |
282 | result.append(')'); |
283 | return result.toString(); |
284 | } |
285 | |
286 | } //PassiveResourceResultImpl |