1 | /** |
2 | * <copyright> |
3 | * </copyright> |
4 | * |
5 | * $Id$ |
6 | */ |
7 | package de.uka.ipd.sdq.pcm.designdecision.QualityProperties.impl; |
8 | |
9 | import de.uka.ipd.sdq.pcm.designdecision.QualityProperties.ConfidenceInterval; |
10 | import de.uka.ipd.sdq.pcm.designdecision.QualityProperties.QualityPropertiesPackage; |
11 | |
12 | import org.eclipse.emf.common.notify.Notification; |
13 | |
14 | import org.eclipse.emf.ecore.EClass; |
15 | |
16 | import org.eclipse.emf.ecore.impl.ENotificationImpl; |
17 | import org.eclipse.emf.ecore.impl.EObjectImpl; |
18 | |
19 | /** |
20 | * <!-- begin-user-doc --> |
21 | * An implementation of the model object '<em><b>Confidence Interval</b></em>'. |
22 | * <!-- end-user-doc --> |
23 | * <p> |
24 | * The following features are implemented: |
25 | * <ul> |
26 | * <li>{@link de.uka.ipd.sdq.pcm.designdecision.QualityProperties.impl.ConfidenceIntervalImpl#getConfidenceLevel <em>Confidence Level</em>}</li> |
27 | * <li>{@link de.uka.ipd.sdq.pcm.designdecision.QualityProperties.impl.ConfidenceIntervalImpl#getMean <em>Mean</em>}</li> |
28 | * <li>{@link de.uka.ipd.sdq.pcm.designdecision.QualityProperties.impl.ConfidenceIntervalImpl#getUpperBound <em>Upper Bound</em>}</li> |
29 | * <li>{@link de.uka.ipd.sdq.pcm.designdecision.QualityProperties.impl.ConfidenceIntervalImpl#getLowerBound <em>Lower Bound</em>}</li> |
30 | * </ul> |
31 | * </p> |
32 | * |
33 | * @generated |
34 | */ |
35 | public class ConfidenceIntervalImpl extends EObjectImpl implements ConfidenceInterval { |
36 | /** |
37 | * The default value of the '{@link #getConfidenceLevel() <em>Confidence Level</em>}' attribute. |
38 | * <!-- begin-user-doc --> |
39 | * <!-- end-user-doc --> |
40 | * @see #getConfidenceLevel() |
41 | * @generated |
42 | * @ordered |
43 | */ |
44 | protected static final double CONFIDENCE_LEVEL_EDEFAULT = 0.0; |
45 | |
46 | /** |
47 | * The cached value of the '{@link #getConfidenceLevel() <em>Confidence Level</em>}' attribute. |
48 | * <!-- begin-user-doc --> |
49 | * <!-- end-user-doc --> |
50 | * @see #getConfidenceLevel() |
51 | * @generated |
52 | * @ordered |
53 | */ |
54 | protected double confidenceLevel = CONFIDENCE_LEVEL_EDEFAULT; |
55 | |
56 | /** |
57 | * The default value of the '{@link #getMean() <em>Mean</em>}' attribute. |
58 | * <!-- begin-user-doc --> |
59 | * <!-- end-user-doc --> |
60 | * @see #getMean() |
61 | * @generated |
62 | * @ordered |
63 | */ |
64 | protected static final double MEAN_EDEFAULT = 0.0; |
65 | |
66 | /** |
67 | * The cached value of the '{@link #getMean() <em>Mean</em>}' attribute. |
68 | * <!-- begin-user-doc --> |
69 | * <!-- end-user-doc --> |
70 | * @see #getMean() |
71 | * @generated |
72 | * @ordered |
73 | */ |
74 | protected double mean = MEAN_EDEFAULT; |
75 | |
76 | /** |
77 | * The default value of the '{@link #getUpperBound() <em>Upper Bound</em>}' attribute. |
78 | * <!-- begin-user-doc --> |
79 | * <!-- end-user-doc --> |
80 | * @see #getUpperBound() |
81 | * @generated |
82 | * @ordered |
83 | */ |
84 | protected static final double UPPER_BOUND_EDEFAULT = 0.0; |
85 | |
86 | /** |
87 | * The cached value of the '{@link #getUpperBound() <em>Upper Bound</em>}' attribute. |
88 | * <!-- begin-user-doc --> |
89 | * <!-- end-user-doc --> |
90 | * @see #getUpperBound() |
91 | * @generated |
92 | * @ordered |
93 | */ |
94 | protected double upperBound = UPPER_BOUND_EDEFAULT; |
95 | |
96 | /** |
97 | * The default value of the '{@link #getLowerBound() <em>Lower Bound</em>}' attribute. |
98 | * <!-- begin-user-doc --> |
99 | * <!-- end-user-doc --> |
100 | * @see #getLowerBound() |
101 | * @generated |
102 | * @ordered |
103 | */ |
104 | protected static final double LOWER_BOUND_EDEFAULT = 0.0; |
105 | |
106 | /** |
107 | * The cached value of the '{@link #getLowerBound() <em>Lower Bound</em>}' attribute. |
108 | * <!-- begin-user-doc --> |
109 | * <!-- end-user-doc --> |
110 | * @see #getLowerBound() |
111 | * @generated |
112 | * @ordered |
113 | */ |
114 | protected double lowerBound = LOWER_BOUND_EDEFAULT; |
115 | |
116 | /** |
117 | * <!-- begin-user-doc --> |
118 | * <!-- end-user-doc --> |
119 | * @generated |
120 | */ |
121 | protected ConfidenceIntervalImpl() { |
122 | super(); |
123 | } |
124 | |
125 | /** |
126 | * <!-- begin-user-doc --> |
127 | * <!-- end-user-doc --> |
128 | * @generated |
129 | */ |
130 | @Override |
131 | protected EClass eStaticClass() { |
132 | return QualityPropertiesPackage.Literals.CONFIDENCE_INTERVAL; |
133 | } |
134 | |
135 | /** |
136 | * <!-- begin-user-doc --> |
137 | * <!-- end-user-doc --> |
138 | * @generated |
139 | */ |
140 | public double getConfidenceLevel() { |
141 | return confidenceLevel; |
142 | } |
143 | |
144 | /** |
145 | * <!-- begin-user-doc --> |
146 | * <!-- end-user-doc --> |
147 | * @generated |
148 | */ |
149 | public void setConfidenceLevel(double newConfidenceLevel) { |
150 | double oldConfidenceLevel = confidenceLevel; |
151 | confidenceLevel = newConfidenceLevel; |
152 | if (eNotificationRequired()) |
153 | eNotify(new ENotificationImpl(this, Notification.SET, QualityPropertiesPackage.CONFIDENCE_INTERVAL__CONFIDENCE_LEVEL, oldConfidenceLevel, confidenceLevel)); |
154 | } |
155 | |
156 | /** |
157 | * <!-- begin-user-doc --> |
158 | * <!-- end-user-doc --> |
159 | * @generated |
160 | */ |
161 | public double getMean() { |
162 | return mean; |
163 | } |
164 | |
165 | /** |
166 | * <!-- begin-user-doc --> |
167 | * <!-- end-user-doc --> |
168 | * @generated |
169 | */ |
170 | public void setMean(double newMean) { |
171 | double oldMean = mean; |
172 | mean = newMean; |
173 | if (eNotificationRequired()) |
174 | eNotify(new ENotificationImpl(this, Notification.SET, QualityPropertiesPackage.CONFIDENCE_INTERVAL__MEAN, oldMean, mean)); |
175 | } |
176 | |
177 | /** |
178 | * <!-- begin-user-doc --> |
179 | * <!-- end-user-doc --> |
180 | * @generated |
181 | */ |
182 | public double getUpperBound() { |
183 | return upperBound; |
184 | } |
185 | |
186 | /** |
187 | * <!-- begin-user-doc --> |
188 | * <!-- end-user-doc --> |
189 | * @generated |
190 | */ |
191 | public void setUpperBound(double newUpperBound) { |
192 | double oldUpperBound = upperBound; |
193 | upperBound = newUpperBound; |
194 | if (eNotificationRequired()) |
195 | eNotify(new ENotificationImpl(this, Notification.SET, QualityPropertiesPackage.CONFIDENCE_INTERVAL__UPPER_BOUND, oldUpperBound, upperBound)); |
196 | } |
197 | |
198 | /** |
199 | * <!-- begin-user-doc --> |
200 | * <!-- end-user-doc --> |
201 | * @generated |
202 | */ |
203 | public double getLowerBound() { |
204 | return lowerBound; |
205 | } |
206 | |
207 | /** |
208 | * <!-- begin-user-doc --> |
209 | * <!-- end-user-doc --> |
210 | * @generated |
211 | */ |
212 | public void setLowerBound(double newLowerBound) { |
213 | double oldLowerBound = lowerBound; |
214 | lowerBound = newLowerBound; |
215 | if (eNotificationRequired()) |
216 | eNotify(new ENotificationImpl(this, Notification.SET, QualityPropertiesPackage.CONFIDENCE_INTERVAL__LOWER_BOUND, oldLowerBound, lowerBound)); |
217 | } |
218 | |
219 | /** |
220 | * <!-- begin-user-doc --> |
221 | * <!-- end-user-doc --> |
222 | * @generated |
223 | */ |
224 | @Override |
225 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
226 | switch (featureID) { |
227 | case QualityPropertiesPackage.CONFIDENCE_INTERVAL__CONFIDENCE_LEVEL: |
228 | return getConfidenceLevel(); |
229 | case QualityPropertiesPackage.CONFIDENCE_INTERVAL__MEAN: |
230 | return getMean(); |
231 | case QualityPropertiesPackage.CONFIDENCE_INTERVAL__UPPER_BOUND: |
232 | return getUpperBound(); |
233 | case QualityPropertiesPackage.CONFIDENCE_INTERVAL__LOWER_BOUND: |
234 | return getLowerBound(); |
235 | } |
236 | return super.eGet(featureID, resolve, coreType); |
237 | } |
238 | |
239 | /** |
240 | * <!-- begin-user-doc --> |
241 | * <!-- end-user-doc --> |
242 | * @generated |
243 | */ |
244 | @Override |
245 | public void eSet(int featureID, Object newValue) { |
246 | switch (featureID) { |
247 | case QualityPropertiesPackage.CONFIDENCE_INTERVAL__CONFIDENCE_LEVEL: |
248 | setConfidenceLevel((Double)newValue); |
249 | return; |
250 | case QualityPropertiesPackage.CONFIDENCE_INTERVAL__MEAN: |
251 | setMean((Double)newValue); |
252 | return; |
253 | case QualityPropertiesPackage.CONFIDENCE_INTERVAL__UPPER_BOUND: |
254 | setUpperBound((Double)newValue); |
255 | return; |
256 | case QualityPropertiesPackage.CONFIDENCE_INTERVAL__LOWER_BOUND: |
257 | setLowerBound((Double)newValue); |
258 | return; |
259 | } |
260 | super.eSet(featureID, newValue); |
261 | } |
262 | |
263 | /** |
264 | * <!-- begin-user-doc --> |
265 | * <!-- end-user-doc --> |
266 | * @generated |
267 | */ |
268 | @Override |
269 | public void eUnset(int featureID) { |
270 | switch (featureID) { |
271 | case QualityPropertiesPackage.CONFIDENCE_INTERVAL__CONFIDENCE_LEVEL: |
272 | setConfidenceLevel(CONFIDENCE_LEVEL_EDEFAULT); |
273 | return; |
274 | case QualityPropertiesPackage.CONFIDENCE_INTERVAL__MEAN: |
275 | setMean(MEAN_EDEFAULT); |
276 | return; |
277 | case QualityPropertiesPackage.CONFIDENCE_INTERVAL__UPPER_BOUND: |
278 | setUpperBound(UPPER_BOUND_EDEFAULT); |
279 | return; |
280 | case QualityPropertiesPackage.CONFIDENCE_INTERVAL__LOWER_BOUND: |
281 | setLowerBound(LOWER_BOUND_EDEFAULT); |
282 | return; |
283 | } |
284 | super.eUnset(featureID); |
285 | } |
286 | |
287 | /** |
288 | * <!-- begin-user-doc --> |
289 | * <!-- end-user-doc --> |
290 | * @generated |
291 | */ |
292 | @Override |
293 | public boolean eIsSet(int featureID) { |
294 | switch (featureID) { |
295 | case QualityPropertiesPackage.CONFIDENCE_INTERVAL__CONFIDENCE_LEVEL: |
296 | return confidenceLevel != CONFIDENCE_LEVEL_EDEFAULT; |
297 | case QualityPropertiesPackage.CONFIDENCE_INTERVAL__MEAN: |
298 | return mean != MEAN_EDEFAULT; |
299 | case QualityPropertiesPackage.CONFIDENCE_INTERVAL__UPPER_BOUND: |
300 | return upperBound != UPPER_BOUND_EDEFAULT; |
301 | case QualityPropertiesPackage.CONFIDENCE_INTERVAL__LOWER_BOUND: |
302 | return lowerBound != LOWER_BOUND_EDEFAULT; |
303 | } |
304 | return super.eIsSet(featureID); |
305 | } |
306 | |
307 | /** |
308 | * <!-- begin-user-doc --> |
309 | * <!-- end-user-doc --> |
310 | * @generated |
311 | */ |
312 | @Override |
313 | public String toString() { |
314 | if (eIsProxy()) return super.toString(); |
315 | |
316 | StringBuffer result = new StringBuffer(super.toString()); |
317 | result.append(" (confidenceLevel: "); |
318 | result.append(confidenceLevel); |
319 | result.append(", mean: "); |
320 | result.append(mean); |
321 | result.append(", upperBound: "); |
322 | result.append(upperBound); |
323 | result.append(", lowerBound: "); |
324 | result.append(lowerBound); |
325 | result.append(')'); |
326 | return result.toString(); |
327 | } |
328 | |
329 | } //ConfidenceIntervalImpl |