1 | /** |
2 | * Copyright 2006, SDQ Group, University Karlsruhe (TH) |
3 | * |
4 | * $Id$ |
5 | */ |
6 | package de.uka.ipd.sdq.context.aggregatedUsageContext.impl; |
7 | |
8 | import org.eclipse.emf.common.notify.Notification; |
9 | import org.eclipse.emf.ecore.EClass; |
10 | import org.eclipse.emf.ecore.InternalEObject; |
11 | import org.eclipse.emf.ecore.impl.ENotificationImpl; |
12 | import org.eclipse.emf.ecore.impl.EObjectImpl; |
13 | |
14 | import de.uka.ipd.sdq.context.aggregatedUsageContext.AggregatedResourceDemand; |
15 | import de.uka.ipd.sdq.context.aggregatedUsageContext.AggregatedUsageContextPackage; |
16 | import de.uka.ipd.sdq.pcm.resourcetype.ResourceType; |
17 | |
18 | /** |
19 | * <!-- begin-user-doc --> |
20 | * An implementation of the model object '<em><b>Aggregated Resource Demand</b></em>'. |
21 | * <!-- end-user-doc --> |
22 | * <p> |
23 | * The following features are implemented: |
24 | * <ul> |
25 | * <li>{@link de.uka.ipd.sdq.context.aggregatedUsageContext.impl.AggregatedResourceDemandImpl#getAggregatedResourceDemand <em>Aggregated Resource Demand</em>}</li> |
26 | * <li>{@link de.uka.ipd.sdq.context.aggregatedUsageContext.impl.AggregatedResourceDemandImpl#getResourceType_AggregatedResourceDemand <em>Resource Type Aggregated Resource Demand</em>}</li> |
27 | * </ul> |
28 | * </p> |
29 | * |
30 | * @generated |
31 | */ |
32 | public class AggregatedResourceDemandImpl extends EObjectImpl implements AggregatedResourceDemand { |
33 | /** |
34 | * <!-- begin-user-doc --> |
35 | * <!-- end-user-doc --> |
36 | * @generated |
37 | */ |
38 | public static final String copyright = "Copyright 2006, SDQ Group, University Karlsruhe (TH)"; |
39 | |
40 | /** |
41 | * The default value of the '{@link #getAggregatedResourceDemand() <em>Aggregated Resource Demand</em>}' attribute. |
42 | * <!-- begin-user-doc --> |
43 | * <!-- end-user-doc --> |
44 | * @see #getAggregatedResourceDemand() |
45 | * @generated |
46 | * @ordered |
47 | */ |
48 | protected static final double AGGREGATED_RESOURCE_DEMAND_EDEFAULT = 0.0; |
49 | |
50 | /** |
51 | * The cached value of the '{@link #getAggregatedResourceDemand() <em>Aggregated Resource Demand</em>}' attribute. |
52 | * <!-- begin-user-doc --> |
53 | * <!-- end-user-doc --> |
54 | * @see #getAggregatedResourceDemand() |
55 | * @generated |
56 | * @ordered |
57 | */ |
58 | protected double aggregatedResourceDemand = AGGREGATED_RESOURCE_DEMAND_EDEFAULT; |
59 | |
60 | /** |
61 | * The cached value of the '{@link #getResourceType_AggregatedResourceDemand() <em>Resource Type Aggregated Resource Demand</em>}' reference. |
62 | * <!-- begin-user-doc --> |
63 | * <!-- end-user-doc --> |
64 | * @see #getResourceType_AggregatedResourceDemand() |
65 | * @generated |
66 | * @ordered |
67 | */ |
68 | protected ResourceType resourceType_AggregatedResourceDemand; |
69 | |
70 | /** |
71 | * <!-- begin-user-doc --> |
72 | * <!-- end-user-doc --> |
73 | * @generated |
74 | */ |
75 | protected AggregatedResourceDemandImpl() { |
76 | super(); |
77 | } |
78 | |
79 | /** |
80 | * <!-- begin-user-doc --> |
81 | * <!-- end-user-doc --> |
82 | * @generated |
83 | */ |
84 | @Override |
85 | protected EClass eStaticClass() { |
86 | return AggregatedUsageContextPackage.Literals.AGGREGATED_RESOURCE_DEMAND; |
87 | } |
88 | |
89 | /** |
90 | * <!-- begin-user-doc --> |
91 | * <!-- end-user-doc --> |
92 | * @generated |
93 | */ |
94 | public double getAggregatedResourceDemand() { |
95 | return aggregatedResourceDemand; |
96 | } |
97 | |
98 | /** |
99 | * <!-- begin-user-doc --> |
100 | * <!-- end-user-doc --> |
101 | * @generated |
102 | */ |
103 | public void setAggregatedResourceDemand(double newAggregatedResourceDemand) { |
104 | double oldAggregatedResourceDemand = aggregatedResourceDemand; |
105 | aggregatedResourceDemand = newAggregatedResourceDemand; |
106 | if (eNotificationRequired()) |
107 | eNotify(new ENotificationImpl(this, Notification.SET, AggregatedUsageContextPackage.AGGREGATED_RESOURCE_DEMAND__AGGREGATED_RESOURCE_DEMAND, oldAggregatedResourceDemand, aggregatedResourceDemand)); |
108 | } |
109 | |
110 | /** |
111 | * <!-- begin-user-doc --> |
112 | * <!-- end-user-doc --> |
113 | * @generated |
114 | */ |
115 | public ResourceType getResourceType_AggregatedResourceDemand() { |
116 | if (resourceType_AggregatedResourceDemand != null && resourceType_AggregatedResourceDemand.eIsProxy()) { |
117 | InternalEObject oldResourceType_AggregatedResourceDemand = (InternalEObject)resourceType_AggregatedResourceDemand; |
118 | resourceType_AggregatedResourceDemand = (ResourceType)eResolveProxy(oldResourceType_AggregatedResourceDemand); |
119 | if (resourceType_AggregatedResourceDemand != oldResourceType_AggregatedResourceDemand) { |
120 | if (eNotificationRequired()) |
121 | eNotify(new ENotificationImpl(this, Notification.RESOLVE, AggregatedUsageContextPackage.AGGREGATED_RESOURCE_DEMAND__RESOURCE_TYPE_AGGREGATED_RESOURCE_DEMAND, oldResourceType_AggregatedResourceDemand, resourceType_AggregatedResourceDemand)); |
122 | } |
123 | } |
124 | return resourceType_AggregatedResourceDemand; |
125 | } |
126 | |
127 | /** |
128 | * <!-- begin-user-doc --> |
129 | * <!-- end-user-doc --> |
130 | * @generated |
131 | */ |
132 | public ResourceType basicGetResourceType_AggregatedResourceDemand() { |
133 | return resourceType_AggregatedResourceDemand; |
134 | } |
135 | |
136 | /** |
137 | * <!-- begin-user-doc --> |
138 | * <!-- end-user-doc --> |
139 | * @generated |
140 | */ |
141 | public void setResourceType_AggregatedResourceDemand(ResourceType newResourceType_AggregatedResourceDemand) { |
142 | ResourceType oldResourceType_AggregatedResourceDemand = resourceType_AggregatedResourceDemand; |
143 | resourceType_AggregatedResourceDemand = newResourceType_AggregatedResourceDemand; |
144 | if (eNotificationRequired()) |
145 | eNotify(new ENotificationImpl(this, Notification.SET, AggregatedUsageContextPackage.AGGREGATED_RESOURCE_DEMAND__RESOURCE_TYPE_AGGREGATED_RESOURCE_DEMAND, oldResourceType_AggregatedResourceDemand, resourceType_AggregatedResourceDemand)); |
146 | } |
147 | |
148 | /** |
149 | * <!-- begin-user-doc --> |
150 | * <!-- end-user-doc --> |
151 | * @generated |
152 | */ |
153 | @Override |
154 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
155 | switch (featureID) { |
156 | case AggregatedUsageContextPackage.AGGREGATED_RESOURCE_DEMAND__AGGREGATED_RESOURCE_DEMAND: |
157 | return getAggregatedResourceDemand(); |
158 | case AggregatedUsageContextPackage.AGGREGATED_RESOURCE_DEMAND__RESOURCE_TYPE_AGGREGATED_RESOURCE_DEMAND: |
159 | if (resolve) return getResourceType_AggregatedResourceDemand(); |
160 | return basicGetResourceType_AggregatedResourceDemand(); |
161 | } |
162 | return super.eGet(featureID, resolve, coreType); |
163 | } |
164 | |
165 | /** |
166 | * <!-- begin-user-doc --> |
167 | * <!-- end-user-doc --> |
168 | * @generated |
169 | */ |
170 | @Override |
171 | public void eSet(int featureID, Object newValue) { |
172 | switch (featureID) { |
173 | case AggregatedUsageContextPackage.AGGREGATED_RESOURCE_DEMAND__AGGREGATED_RESOURCE_DEMAND: |
174 | setAggregatedResourceDemand((Double)newValue); |
175 | return; |
176 | case AggregatedUsageContextPackage.AGGREGATED_RESOURCE_DEMAND__RESOURCE_TYPE_AGGREGATED_RESOURCE_DEMAND: |
177 | setResourceType_AggregatedResourceDemand((ResourceType)newValue); |
178 | return; |
179 | } |
180 | super.eSet(featureID, newValue); |
181 | } |
182 | |
183 | /** |
184 | * <!-- begin-user-doc --> |
185 | * <!-- end-user-doc --> |
186 | * @generated |
187 | */ |
188 | @Override |
189 | public void eUnset(int featureID) { |
190 | switch (featureID) { |
191 | case AggregatedUsageContextPackage.AGGREGATED_RESOURCE_DEMAND__AGGREGATED_RESOURCE_DEMAND: |
192 | setAggregatedResourceDemand(AGGREGATED_RESOURCE_DEMAND_EDEFAULT); |
193 | return; |
194 | case AggregatedUsageContextPackage.AGGREGATED_RESOURCE_DEMAND__RESOURCE_TYPE_AGGREGATED_RESOURCE_DEMAND: |
195 | setResourceType_AggregatedResourceDemand((ResourceType)null); |
196 | return; |
197 | } |
198 | super.eUnset(featureID); |
199 | } |
200 | |
201 | /** |
202 | * <!-- begin-user-doc --> |
203 | * <!-- end-user-doc --> |
204 | * @generated |
205 | */ |
206 | @Override |
207 | public boolean eIsSet(int featureID) { |
208 | switch (featureID) { |
209 | case AggregatedUsageContextPackage.AGGREGATED_RESOURCE_DEMAND__AGGREGATED_RESOURCE_DEMAND: |
210 | return aggregatedResourceDemand != AGGREGATED_RESOURCE_DEMAND_EDEFAULT; |
211 | case AggregatedUsageContextPackage.AGGREGATED_RESOURCE_DEMAND__RESOURCE_TYPE_AGGREGATED_RESOURCE_DEMAND: |
212 | return resourceType_AggregatedResourceDemand != null; |
213 | } |
214 | return super.eIsSet(featureID); |
215 | } |
216 | |
217 | /** |
218 | * <!-- begin-user-doc --> |
219 | * <!-- end-user-doc --> |
220 | * @generated |
221 | */ |
222 | @Override |
223 | public String toString() { |
224 | if (eIsProxy()) return super.toString(); |
225 | |
226 | StringBuffer result = new StringBuffer(super.toString()); |
227 | result.append(" (aggregatedResourceDemand: "); |
228 | result.append(aggregatedResourceDemand); |
229 | result.append(')'); |
230 | return result.toString(); |
231 | } |
232 | |
233 | } //AggregatedResourceDemandImpl |