diff options
author | ArenBabikian <aren.babikian@mail.mcgill.ca> | 2020-04-26 18:23:13 -0400 |
---|---|---|
committer | ArenBabikian <aren.babikian@mail.mcgill.ca> | 2020-04-26 18:23:13 -0400 |
commit | c0a758eedd457a5d8eb9f1a6c17fc24143aabb3e (patch) | |
tree | 0c2e212e4e95c1d2311629128641d5cd561210f3 /Tests/MODELS2020-CaseStudies/case.study.pledge.model/src/Taxation/impl/Tax_PayerImpl.java | |
parent | Merge branch 'Attribute-Solver' (diff) | |
download | VIATRA-Generator-c0a758eedd457a5d8eb9f1a6c17fc24143aabb3e.tar.gz VIATRA-Generator-c0a758eedd457a5d8eb9f1a6c17fc24143aabb3e.tar.zst VIATRA-Generator-c0a758eedd457a5d8eb9f1a6c17fc24143aabb3e.zip |
Add PLEDGE case study files
Diffstat (limited to 'Tests/MODELS2020-CaseStudies/case.study.pledge.model/src/Taxation/impl/Tax_PayerImpl.java')
-rw-r--r-- | Tests/MODELS2020-CaseStudies/case.study.pledge.model/src/Taxation/impl/Tax_PayerImpl.java | 425 |
1 files changed, 425 insertions, 0 deletions
diff --git a/Tests/MODELS2020-CaseStudies/case.study.pledge.model/src/Taxation/impl/Tax_PayerImpl.java b/Tests/MODELS2020-CaseStudies/case.study.pledge.model/src/Taxation/impl/Tax_PayerImpl.java new file mode 100644 index 00000000..7e382d7f --- /dev/null +++ b/Tests/MODELS2020-CaseStudies/case.study.pledge.model/src/Taxation/impl/Tax_PayerImpl.java | |||
@@ -0,0 +1,425 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package Taxation.impl; | ||
4 | |||
5 | import Taxation.Dependent; | ||
6 | import Taxation.FromAgent; | ||
7 | import Taxation.FromLaw; | ||
8 | import Taxation.Income; | ||
9 | import Taxation.Tax_Payer; | ||
10 | import Taxation.TaxationPackage; | ||
11 | |||
12 | import java.util.Collection; | ||
13 | |||
14 | import org.eclipse.emf.common.notify.Notification; | ||
15 | import org.eclipse.emf.common.notify.NotificationChain; | ||
16 | |||
17 | import org.eclipse.emf.common.util.EList; | ||
18 | |||
19 | import org.eclipse.emf.ecore.EClass; | ||
20 | import org.eclipse.emf.ecore.InternalEObject; | ||
21 | |||
22 | import org.eclipse.emf.ecore.impl.ENotificationImpl; | ||
23 | |||
24 | import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList; | ||
25 | import org.eclipse.emf.ecore.util.InternalEList; | ||
26 | |||
27 | /** | ||
28 | * <!-- begin-user-doc --> | ||
29 | * An implementation of the model object '<em><b>Tax Payer</b></em>'. | ||
30 | * <!-- end-user-doc --> | ||
31 | * <p> | ||
32 | * The following features are implemented: | ||
33 | * </p> | ||
34 | * <ul> | ||
35 | * <li>{@link Taxation.impl.Tax_PayerImpl#getDependents <em>Dependents</em>}</li> | ||
36 | * <li>{@link Taxation.impl.Tax_PayerImpl#getFrom_agent <em>From agent</em>}</li> | ||
37 | * <li>{@link Taxation.impl.Tax_PayerImpl#getIncomes <em>Incomes</em>}</li> | ||
38 | * <li>{@link Taxation.impl.Tax_PayerImpl#getFrom_law <em>From law</em>}</li> | ||
39 | * <li>{@link Taxation.impl.Tax_PayerImpl#getTaxesDue <em>Taxes Due</em>}</li> | ||
40 | * </ul> | ||
41 | * | ||
42 | * @generated | ||
43 | */ | ||
44 | public abstract class Tax_PayerImpl extends Physical_PersonImpl implements Tax_Payer { | ||
45 | /** | ||
46 | * The cached value of the '{@link #getDependents() <em>Dependents</em>}' containment reference list. | ||
47 | * <!-- begin-user-doc --> | ||
48 | * <!-- end-user-doc --> | ||
49 | * @see #getDependents() | ||
50 | * @generated | ||
51 | * @ordered | ||
52 | */ | ||
53 | protected EList<Dependent> dependents; | ||
54 | |||
55 | /** | ||
56 | * The cached value of the '{@link #getFrom_agent() <em>From agent</em>}' containment reference. | ||
57 | * <!-- begin-user-doc --> | ||
58 | * <!-- end-user-doc --> | ||
59 | * @see #getFrom_agent() | ||
60 | * @generated | ||
61 | * @ordered | ||
62 | */ | ||
63 | protected FromAgent from_agent; | ||
64 | |||
65 | /** | ||
66 | * The cached value of the '{@link #getIncomes() <em>Incomes</em>}' containment reference list. | ||
67 | * <!-- begin-user-doc --> | ||
68 | * <!-- end-user-doc --> | ||
69 | * @see #getIncomes() | ||
70 | * @generated | ||
71 | * @ordered | ||
72 | */ | ||
73 | protected EList<Income> incomes; | ||
74 | |||
75 | /** | ||
76 | * The cached value of the '{@link #getFrom_law() <em>From law</em>}' containment reference. | ||
77 | * <!-- begin-user-doc --> | ||
78 | * <!-- end-user-doc --> | ||
79 | * @see #getFrom_law() | ||
80 | * @generated | ||
81 | * @ordered | ||
82 | */ | ||
83 | protected FromLaw from_law; | ||
84 | |||
85 | /** | ||
86 | * The default value of the '{@link #getTaxesDue() <em>Taxes Due</em>}' attribute. | ||
87 | * <!-- begin-user-doc --> | ||
88 | * <!-- end-user-doc --> | ||
89 | * @see #getTaxesDue() | ||
90 | * @generated | ||
91 | * @ordered | ||
92 | */ | ||
93 | protected static final double TAXES_DUE_EDEFAULT = 0.0; | ||
94 | |||
95 | /** | ||
96 | * The cached value of the '{@link #getTaxesDue() <em>Taxes Due</em>}' attribute. | ||
97 | * <!-- begin-user-doc --> | ||
98 | * <!-- end-user-doc --> | ||
99 | * @see #getTaxesDue() | ||
100 | * @generated | ||
101 | * @ordered | ||
102 | */ | ||
103 | protected double taxesDue = TAXES_DUE_EDEFAULT; | ||
104 | |||
105 | /** | ||
106 | * <!-- begin-user-doc --> | ||
107 | * <!-- end-user-doc --> | ||
108 | * @generated | ||
109 | */ | ||
110 | protected Tax_PayerImpl() { | ||
111 | super(); | ||
112 | } | ||
113 | |||
114 | /** | ||
115 | * <!-- begin-user-doc --> | ||
116 | * <!-- end-user-doc --> | ||
117 | * @generated | ||
118 | */ | ||
119 | @Override | ||
120 | protected EClass eStaticClass() { | ||
121 | return TaxationPackage.Literals.TAX_PAYER; | ||
122 | } | ||
123 | |||
124 | /** | ||
125 | * <!-- begin-user-doc --> | ||
126 | * <!-- end-user-doc --> | ||
127 | * @generated | ||
128 | */ | ||
129 | @Override | ||
130 | public EList<Dependent> getDependents() { | ||
131 | if (dependents == null) { | ||
132 | dependents = new EObjectContainmentWithInverseEList<Dependent>(Dependent.class, this, TaxationPackage.TAX_PAYER__DEPENDENTS, TaxationPackage.DEPENDENT__RESPONSIBLE_PERSON); | ||
133 | } | ||
134 | return dependents; | ||
135 | } | ||
136 | |||
137 | /** | ||
138 | * <!-- begin-user-doc --> | ||
139 | * <!-- end-user-doc --> | ||
140 | * @generated | ||
141 | */ | ||
142 | @Override | ||
143 | public FromAgent getFrom_agent() { | ||
144 | return from_agent; | ||
145 | } | ||
146 | |||
147 | /** | ||
148 | * <!-- begin-user-doc --> | ||
149 | * <!-- end-user-doc --> | ||
150 | * @generated | ||
151 | */ | ||
152 | public NotificationChain basicSetFrom_agent(FromAgent newFrom_agent, NotificationChain msgs) { | ||
153 | FromAgent oldFrom_agent = from_agent; | ||
154 | from_agent = newFrom_agent; | ||
155 | if (eNotificationRequired()) { | ||
156 | ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, TaxationPackage.TAX_PAYER__FROM_AGENT, oldFrom_agent, newFrom_agent); | ||
157 | if (msgs == null) msgs = notification; else msgs.add(notification); | ||
158 | } | ||
159 | return msgs; | ||
160 | } | ||
161 | |||
162 | /** | ||
163 | * <!-- begin-user-doc --> | ||
164 | * <!-- end-user-doc --> | ||
165 | * @generated | ||
166 | */ | ||
167 | @Override | ||
168 | public void setFrom_agent(FromAgent newFrom_agent) { | ||
169 | if (newFrom_agent != from_agent) { | ||
170 | NotificationChain msgs = null; | ||
171 | if (from_agent != null) | ||
172 | msgs = ((InternalEObject)from_agent).eInverseRemove(this, TaxationPackage.FROM_AGENT__TAX_PAYER, FromAgent.class, msgs); | ||
173 | if (newFrom_agent != null) | ||
174 | msgs = ((InternalEObject)newFrom_agent).eInverseAdd(this, TaxationPackage.FROM_AGENT__TAX_PAYER, FromAgent.class, msgs); | ||
175 | msgs = basicSetFrom_agent(newFrom_agent, msgs); | ||
176 | if (msgs != null) msgs.dispatch(); | ||
177 | } | ||
178 | else if (eNotificationRequired()) | ||
179 | eNotify(new ENotificationImpl(this, Notification.SET, TaxationPackage.TAX_PAYER__FROM_AGENT, newFrom_agent, newFrom_agent)); | ||
180 | } | ||
181 | |||
182 | /** | ||
183 | * <!-- begin-user-doc --> | ||
184 | * <!-- end-user-doc --> | ||
185 | * @generated | ||
186 | */ | ||
187 | @Override | ||
188 | public EList<Income> getIncomes() { | ||
189 | if (incomes == null) { | ||
190 | incomes = new EObjectContainmentWithInverseEList<Income>(Income.class, this, TaxationPackage.TAX_PAYER__INCOMES, TaxationPackage.INCOME__TAX_PAYER); | ||
191 | } | ||
192 | return incomes; | ||
193 | } | ||
194 | |||
195 | /** | ||
196 | * <!-- begin-user-doc --> | ||
197 | * <!-- end-user-doc --> | ||
198 | * @generated | ||
199 | */ | ||
200 | @Override | ||
201 | public FromLaw getFrom_law() { | ||
202 | return from_law; | ||
203 | } | ||
204 | |||
205 | /** | ||
206 | * <!-- begin-user-doc --> | ||
207 | * <!-- end-user-doc --> | ||
208 | * @generated | ||
209 | */ | ||
210 | public NotificationChain basicSetFrom_law(FromLaw newFrom_law, NotificationChain msgs) { | ||
211 | FromLaw oldFrom_law = from_law; | ||
212 | from_law = newFrom_law; | ||
213 | if (eNotificationRequired()) { | ||
214 | ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, TaxationPackage.TAX_PAYER__FROM_LAW, oldFrom_law, newFrom_law); | ||
215 | if (msgs == null) msgs = notification; else msgs.add(notification); | ||
216 | } | ||
217 | return msgs; | ||
218 | } | ||
219 | |||
220 | /** | ||
221 | * <!-- begin-user-doc --> | ||
222 | * <!-- end-user-doc --> | ||
223 | * @generated | ||
224 | */ | ||
225 | @Override | ||
226 | public void setFrom_law(FromLaw newFrom_law) { | ||
227 | if (newFrom_law != from_law) { | ||
228 | NotificationChain msgs = null; | ||
229 | if (from_law != null) | ||
230 | msgs = ((InternalEObject)from_law).eInverseRemove(this, TaxationPackage.FROM_LAW__TAX_PAYER, FromLaw.class, msgs); | ||
231 | if (newFrom_law != null) | ||
232 | msgs = ((InternalEObject)newFrom_law).eInverseAdd(this, TaxationPackage.FROM_LAW__TAX_PAYER, FromLaw.class, msgs); | ||
233 | msgs = basicSetFrom_law(newFrom_law, msgs); | ||
234 | if (msgs != null) msgs.dispatch(); | ||
235 | } | ||
236 | else if (eNotificationRequired()) | ||
237 | eNotify(new ENotificationImpl(this, Notification.SET, TaxationPackage.TAX_PAYER__FROM_LAW, newFrom_law, newFrom_law)); | ||
238 | } | ||
239 | |||
240 | /** | ||
241 | * <!-- begin-user-doc --> | ||
242 | * <!-- end-user-doc --> | ||
243 | * @generated | ||
244 | */ | ||
245 | @Override | ||
246 | public double getTaxesDue() { | ||
247 | return taxesDue; | ||
248 | } | ||
249 | |||
250 | /** | ||
251 | * <!-- begin-user-doc --> | ||
252 | * <!-- end-user-doc --> | ||
253 | * @generated | ||
254 | */ | ||
255 | @Override | ||
256 | public void setTaxesDue(double newTaxesDue) { | ||
257 | double oldTaxesDue = taxesDue; | ||
258 | taxesDue = newTaxesDue; | ||
259 | if (eNotificationRequired()) | ||
260 | eNotify(new ENotificationImpl(this, Notification.SET, TaxationPackage.TAX_PAYER__TAXES_DUE, oldTaxesDue, taxesDue)); | ||
261 | } | ||
262 | |||
263 | /** | ||
264 | * <!-- begin-user-doc --> | ||
265 | * <!-- end-user-doc --> | ||
266 | * @generated | ||
267 | */ | ||
268 | @SuppressWarnings("unchecked") | ||
269 | @Override | ||
270 | public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | ||
271 | switch (featureID) { | ||
272 | case TaxationPackage.TAX_PAYER__DEPENDENTS: | ||
273 | return ((InternalEList<InternalEObject>)(InternalEList<?>)getDependents()).basicAdd(otherEnd, msgs); | ||
274 | case TaxationPackage.TAX_PAYER__FROM_AGENT: | ||
275 | if (from_agent != null) | ||
276 | msgs = ((InternalEObject)from_agent).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - TaxationPackage.TAX_PAYER__FROM_AGENT, null, msgs); | ||
277 | return basicSetFrom_agent((FromAgent)otherEnd, msgs); | ||
278 | case TaxationPackage.TAX_PAYER__INCOMES: | ||
279 | return ((InternalEList<InternalEObject>)(InternalEList<?>)getIncomes()).basicAdd(otherEnd, msgs); | ||
280 | case TaxationPackage.TAX_PAYER__FROM_LAW: | ||
281 | if (from_law != null) | ||
282 | msgs = ((InternalEObject)from_law).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - TaxationPackage.TAX_PAYER__FROM_LAW, null, msgs); | ||
283 | return basicSetFrom_law((FromLaw)otherEnd, msgs); | ||
284 | } | ||
285 | return super.eInverseAdd(otherEnd, featureID, msgs); | ||
286 | } | ||
287 | |||
288 | /** | ||
289 | * <!-- begin-user-doc --> | ||
290 | * <!-- end-user-doc --> | ||
291 | * @generated | ||
292 | */ | ||
293 | @Override | ||
294 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | ||
295 | switch (featureID) { | ||
296 | case TaxationPackage.TAX_PAYER__DEPENDENTS: | ||
297 | return ((InternalEList<?>)getDependents()).basicRemove(otherEnd, msgs); | ||
298 | case TaxationPackage.TAX_PAYER__FROM_AGENT: | ||
299 | return basicSetFrom_agent(null, msgs); | ||
300 | case TaxationPackage.TAX_PAYER__INCOMES: | ||
301 | return ((InternalEList<?>)getIncomes()).basicRemove(otherEnd, msgs); | ||
302 | case TaxationPackage.TAX_PAYER__FROM_LAW: | ||
303 | return basicSetFrom_law(null, msgs); | ||
304 | } | ||
305 | return super.eInverseRemove(otherEnd, featureID, msgs); | ||
306 | } | ||
307 | |||
308 | /** | ||
309 | * <!-- begin-user-doc --> | ||
310 | * <!-- end-user-doc --> | ||
311 | * @generated | ||
312 | */ | ||
313 | @Override | ||
314 | public Object eGet(int featureID, boolean resolve, boolean coreType) { | ||
315 | switch (featureID) { | ||
316 | case TaxationPackage.TAX_PAYER__DEPENDENTS: | ||
317 | return getDependents(); | ||
318 | case TaxationPackage.TAX_PAYER__FROM_AGENT: | ||
319 | return getFrom_agent(); | ||
320 | case TaxationPackage.TAX_PAYER__INCOMES: | ||
321 | return getIncomes(); | ||
322 | case TaxationPackage.TAX_PAYER__FROM_LAW: | ||
323 | return getFrom_law(); | ||
324 | case TaxationPackage.TAX_PAYER__TAXES_DUE: | ||
325 | return getTaxesDue(); | ||
326 | } | ||
327 | return super.eGet(featureID, resolve, coreType); | ||
328 | } | ||
329 | |||
330 | /** | ||
331 | * <!-- begin-user-doc --> | ||
332 | * <!-- end-user-doc --> | ||
333 | * @generated | ||
334 | */ | ||
335 | @SuppressWarnings("unchecked") | ||
336 | @Override | ||
337 | public void eSet(int featureID, Object newValue) { | ||
338 | switch (featureID) { | ||
339 | case TaxationPackage.TAX_PAYER__DEPENDENTS: | ||
340 | getDependents().clear(); | ||
341 | getDependents().addAll((Collection<? extends Dependent>)newValue); | ||
342 | return; | ||
343 | case TaxationPackage.TAX_PAYER__FROM_AGENT: | ||
344 | setFrom_agent((FromAgent)newValue); | ||
345 | return; | ||
346 | case TaxationPackage.TAX_PAYER__INCOMES: | ||
347 | getIncomes().clear(); | ||
348 | getIncomes().addAll((Collection<? extends Income>)newValue); | ||
349 | return; | ||
350 | case TaxationPackage.TAX_PAYER__FROM_LAW: | ||
351 | setFrom_law((FromLaw)newValue); | ||
352 | return; | ||
353 | case TaxationPackage.TAX_PAYER__TAXES_DUE: | ||
354 | setTaxesDue((Double)newValue); | ||
355 | return; | ||
356 | } | ||
357 | super.eSet(featureID, newValue); | ||
358 | } | ||
359 | |||
360 | /** | ||
361 | * <!-- begin-user-doc --> | ||
362 | * <!-- end-user-doc --> | ||
363 | * @generated | ||
364 | */ | ||
365 | @Override | ||
366 | public void eUnset(int featureID) { | ||
367 | switch (featureID) { | ||
368 | case TaxationPackage.TAX_PAYER__DEPENDENTS: | ||
369 | getDependents().clear(); | ||
370 | return; | ||
371 | case TaxationPackage.TAX_PAYER__FROM_AGENT: | ||
372 | setFrom_agent((FromAgent)null); | ||
373 | return; | ||
374 | case TaxationPackage.TAX_PAYER__INCOMES: | ||
375 | getIncomes().clear(); | ||
376 | return; | ||
377 | case TaxationPackage.TAX_PAYER__FROM_LAW: | ||
378 | setFrom_law((FromLaw)null); | ||
379 | return; | ||
380 | case TaxationPackage.TAX_PAYER__TAXES_DUE: | ||
381 | setTaxesDue(TAXES_DUE_EDEFAULT); | ||
382 | return; | ||
383 | } | ||
384 | super.eUnset(featureID); | ||
385 | } | ||
386 | |||
387 | /** | ||
388 | * <!-- begin-user-doc --> | ||
389 | * <!-- end-user-doc --> | ||
390 | * @generated | ||
391 | */ | ||
392 | @Override | ||
393 | public boolean eIsSet(int featureID) { | ||
394 | switch (featureID) { | ||
395 | case TaxationPackage.TAX_PAYER__DEPENDENTS: | ||
396 | return dependents != null && !dependents.isEmpty(); | ||
397 | case TaxationPackage.TAX_PAYER__FROM_AGENT: | ||
398 | return from_agent != null; | ||
399 | case TaxationPackage.TAX_PAYER__INCOMES: | ||
400 | return incomes != null && !incomes.isEmpty(); | ||
401 | case TaxationPackage.TAX_PAYER__FROM_LAW: | ||
402 | return from_law != null; | ||
403 | case TaxationPackage.TAX_PAYER__TAXES_DUE: | ||
404 | return taxesDue != TAXES_DUE_EDEFAULT; | ||
405 | } | ||
406 | return super.eIsSet(featureID); | ||
407 | } | ||
408 | |||
409 | /** | ||
410 | * <!-- begin-user-doc --> | ||
411 | * <!-- end-user-doc --> | ||
412 | * @generated | ||
413 | */ | ||
414 | @Override | ||
415 | public String toString() { | ||
416 | if (eIsProxy()) return super.toString(); | ||
417 | |||
418 | StringBuilder result = new StringBuilder(super.toString()); | ||
419 | result.append(" (taxesDue: "); | ||
420 | result.append(taxesDue); | ||
421 | result.append(')'); | ||
422 | return result.toString(); | ||
423 | } | ||
424 | |||
425 | } //Tax_PayerImpl | ||