diff options
author | 2020-05-13 00:16:27 -0400 | |
---|---|---|
committer | 2020-05-13 00:16:27 -0400 | |
commit | 5fd28fe3201ad6e316fea3688bd89130bc29bc13 (patch) | |
tree | f8cc7181b1eadec0f2e1d69d4cdac9e4938e07df /Tests/MODELS2020-CaseStudies/case.study.pledge.model/src/TaxationWithRoot/impl/AddressImpl.java | |
parent | memory cleaning message between tasks (diff) | |
download | VIATRA-Generator-5fd28fe3201ad6e316fea3688bd89130bc29bc13.tar.gz VIATRA-Generator-5fd28fe3201ad6e316fea3688bd89130bc29bc13.tar.zst VIATRA-Generator-5fd28fe3201ad6e316fea3688bd89130bc29bc13.zip |
Adjust FamilyTree MM. Add new Taxation MM with possible Multiple Roots
Diffstat (limited to 'Tests/MODELS2020-CaseStudies/case.study.pledge.model/src/TaxationWithRoot/impl/AddressImpl.java')
-rw-r--r-- | Tests/MODELS2020-CaseStudies/case.study.pledge.model/src/TaxationWithRoot/impl/AddressImpl.java | 463 |
1 files changed, 463 insertions, 0 deletions
diff --git a/Tests/MODELS2020-CaseStudies/case.study.pledge.model/src/TaxationWithRoot/impl/AddressImpl.java b/Tests/MODELS2020-CaseStudies/case.study.pledge.model/src/TaxationWithRoot/impl/AddressImpl.java new file mode 100644 index 00000000..c6062848 --- /dev/null +++ b/Tests/MODELS2020-CaseStudies/case.study.pledge.model/src/TaxationWithRoot/impl/AddressImpl.java | |||
@@ -0,0 +1,463 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package TaxationWithRoot.impl; | ||
4 | |||
5 | import TaxationWithRoot.Address; | ||
6 | import TaxationWithRoot.Country; | ||
7 | import TaxationWithRoot.Physical_Person; | ||
8 | import TaxationWithRoot.TaxationPackage; | ||
9 | |||
10 | import java.util.Collection; | ||
11 | |||
12 | import org.eclipse.emf.common.notify.Notification; | ||
13 | import org.eclipse.emf.common.notify.NotificationChain; | ||
14 | |||
15 | import org.eclipse.emf.common.util.EList; | ||
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 | import org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList; | ||
22 | import org.eclipse.emf.ecore.util.InternalEList; | ||
23 | |||
24 | /** | ||
25 | * <!-- begin-user-doc --> | ||
26 | * An implementation of the model object '<em><b>Address</b></em>'. | ||
27 | * <!-- end-user-doc --> | ||
28 | * <p> | ||
29 | * The following features are implemented: | ||
30 | * </p> | ||
31 | * <ul> | ||
32 | * <li>{@link TaxationWithRoot.impl.AddressImpl#getCountry <em>Country</em>}</li> | ||
33 | * <li>{@link TaxationWithRoot.impl.AddressImpl#getStreet <em>Street</em>}</li> | ||
34 | * <li>{@link TaxationWithRoot.impl.AddressImpl#getZipCode <em>Zip Code</em>}</li> | ||
35 | * <li>{@link TaxationWithRoot.impl.AddressImpl#getCity <em>City</em>}</li> | ||
36 | * <li>{@link TaxationWithRoot.impl.AddressImpl#getId2 <em>Id2</em>}</li> | ||
37 | * <li>{@link TaxationWithRoot.impl.AddressImpl#getTaxPayer <em>Tax Payer</em>}</li> | ||
38 | * </ul> | ||
39 | * | ||
40 | * @generated | ||
41 | */ | ||
42 | public class AddressImpl extends RootImpl implements Address { | ||
43 | /** | ||
44 | * The default value of the '{@link #getCountry() <em>Country</em>}' attribute. | ||
45 | * <!-- begin-user-doc --> | ||
46 | * <!-- end-user-doc --> | ||
47 | * @see #getCountry() | ||
48 | * @generated | ||
49 | * @ordered | ||
50 | */ | ||
51 | protected static final Country COUNTRY_EDEFAULT = Country.ZZ; | ||
52 | |||
53 | /** | ||
54 | * The cached value of the '{@link #getCountry() <em>Country</em>}' attribute. | ||
55 | * <!-- begin-user-doc --> | ||
56 | * <!-- end-user-doc --> | ||
57 | * @see #getCountry() | ||
58 | * @generated | ||
59 | * @ordered | ||
60 | */ | ||
61 | protected Country country = COUNTRY_EDEFAULT; | ||
62 | |||
63 | /** | ||
64 | * The default value of the '{@link #getStreet() <em>Street</em>}' attribute. | ||
65 | * <!-- begin-user-doc --> | ||
66 | * <!-- end-user-doc --> | ||
67 | * @see #getStreet() | ||
68 | * @generated | ||
69 | * @ordered | ||
70 | */ | ||
71 | protected static final String STREET_EDEFAULT = null; | ||
72 | |||
73 | /** | ||
74 | * The cached value of the '{@link #getStreet() <em>Street</em>}' attribute. | ||
75 | * <!-- begin-user-doc --> | ||
76 | * <!-- end-user-doc --> | ||
77 | * @see #getStreet() | ||
78 | * @generated | ||
79 | * @ordered | ||
80 | */ | ||
81 | protected String street = STREET_EDEFAULT; | ||
82 | |||
83 | /** | ||
84 | * The default value of the '{@link #getZipCode() <em>Zip Code</em>}' attribute. | ||
85 | * <!-- begin-user-doc --> | ||
86 | * <!-- end-user-doc --> | ||
87 | * @see #getZipCode() | ||
88 | * @generated | ||
89 | * @ordered | ||
90 | */ | ||
91 | protected static final String ZIP_CODE_EDEFAULT = null; | ||
92 | |||
93 | /** | ||
94 | * The cached value of the '{@link #getZipCode() <em>Zip Code</em>}' attribute. | ||
95 | * <!-- begin-user-doc --> | ||
96 | * <!-- end-user-doc --> | ||
97 | * @see #getZipCode() | ||
98 | * @generated | ||
99 | * @ordered | ||
100 | */ | ||
101 | protected String zipCode = ZIP_CODE_EDEFAULT; | ||
102 | |||
103 | /** | ||
104 | * The default value of the '{@link #getCity() <em>City</em>}' attribute. | ||
105 | * <!-- begin-user-doc --> | ||
106 | * <!-- end-user-doc --> | ||
107 | * @see #getCity() | ||
108 | * @generated | ||
109 | * @ordered | ||
110 | */ | ||
111 | protected static final String CITY_EDEFAULT = null; | ||
112 | |||
113 | /** | ||
114 | * The cached value of the '{@link #getCity() <em>City</em>}' attribute. | ||
115 | * <!-- begin-user-doc --> | ||
116 | * <!-- end-user-doc --> | ||
117 | * @see #getCity() | ||
118 | * @generated | ||
119 | * @ordered | ||
120 | */ | ||
121 | protected String city = CITY_EDEFAULT; | ||
122 | |||
123 | /** | ||
124 | * The default value of the '{@link #getId2() <em>Id2</em>}' attribute. | ||
125 | * <!-- begin-user-doc --> | ||
126 | * <!-- end-user-doc --> | ||
127 | * @see #getId2() | ||
128 | * @generated | ||
129 | * @ordered | ||
130 | */ | ||
131 | protected static final String ID2_EDEFAULT = null; | ||
132 | |||
133 | /** | ||
134 | * The cached value of the '{@link #getId2() <em>Id2</em>}' attribute. | ||
135 | * <!-- begin-user-doc --> | ||
136 | * <!-- end-user-doc --> | ||
137 | * @see #getId2() | ||
138 | * @generated | ||
139 | * @ordered | ||
140 | */ | ||
141 | protected String id2 = ID2_EDEFAULT; | ||
142 | |||
143 | /** | ||
144 | * The cached value of the '{@link #getTaxPayer() <em>Tax Payer</em>}' reference list. | ||
145 | * <!-- begin-user-doc --> | ||
146 | * <!-- end-user-doc --> | ||
147 | * @see #getTaxPayer() | ||
148 | * @generated | ||
149 | * @ordered | ||
150 | */ | ||
151 | protected EList<Physical_Person> taxPayer; | ||
152 | |||
153 | /** | ||
154 | * <!-- begin-user-doc --> | ||
155 | * <!-- end-user-doc --> | ||
156 | * @generated | ||
157 | */ | ||
158 | protected AddressImpl() { | ||
159 | super(); | ||
160 | } | ||
161 | |||
162 | /** | ||
163 | * <!-- begin-user-doc --> | ||
164 | * <!-- end-user-doc --> | ||
165 | * @generated | ||
166 | */ | ||
167 | @Override | ||
168 | protected EClass eStaticClass() { | ||
169 | return TaxationPackage.Literals.ADDRESS; | ||
170 | } | ||
171 | |||
172 | /** | ||
173 | * <!-- begin-user-doc --> | ||
174 | * <!-- end-user-doc --> | ||
175 | * @generated | ||
176 | */ | ||
177 | @Override | ||
178 | public Country getCountry() { | ||
179 | return country; | ||
180 | } | ||
181 | |||
182 | /** | ||
183 | * <!-- begin-user-doc --> | ||
184 | * <!-- end-user-doc --> | ||
185 | * @generated | ||
186 | */ | ||
187 | @Override | ||
188 | public void setCountry(Country newCountry) { | ||
189 | Country oldCountry = country; | ||
190 | country = newCountry == null ? COUNTRY_EDEFAULT : newCountry; | ||
191 | if (eNotificationRequired()) | ||
192 | eNotify(new ENotificationImpl(this, Notification.SET, TaxationPackage.ADDRESS__COUNTRY, oldCountry, country)); | ||
193 | } | ||
194 | |||
195 | /** | ||
196 | * <!-- begin-user-doc --> | ||
197 | * <!-- end-user-doc --> | ||
198 | * @generated | ||
199 | */ | ||
200 | @Override | ||
201 | public String getStreet() { | ||
202 | return street; | ||
203 | } | ||
204 | |||
205 | /** | ||
206 | * <!-- begin-user-doc --> | ||
207 | * <!-- end-user-doc --> | ||
208 | * @generated | ||
209 | */ | ||
210 | @Override | ||
211 | public void setStreet(String newStreet) { | ||
212 | String oldStreet = street; | ||
213 | street = newStreet; | ||
214 | if (eNotificationRequired()) | ||
215 | eNotify(new ENotificationImpl(this, Notification.SET, TaxationPackage.ADDRESS__STREET, oldStreet, street)); | ||
216 | } | ||
217 | |||
218 | /** | ||
219 | * <!-- begin-user-doc --> | ||
220 | * <!-- end-user-doc --> | ||
221 | * @generated | ||
222 | */ | ||
223 | @Override | ||
224 | public String getZipCode() { | ||
225 | return zipCode; | ||
226 | } | ||
227 | |||
228 | /** | ||
229 | * <!-- begin-user-doc --> | ||
230 | * <!-- end-user-doc --> | ||
231 | * @generated | ||
232 | */ | ||
233 | @Override | ||
234 | public void setZipCode(String newZipCode) { | ||
235 | String oldZipCode = zipCode; | ||
236 | zipCode = newZipCode; | ||
237 | if (eNotificationRequired()) | ||
238 | eNotify(new ENotificationImpl(this, Notification.SET, TaxationPackage.ADDRESS__ZIP_CODE, oldZipCode, zipCode)); | ||
239 | } | ||
240 | |||
241 | /** | ||
242 | * <!-- begin-user-doc --> | ||
243 | * <!-- end-user-doc --> | ||
244 | * @generated | ||
245 | */ | ||
246 | @Override | ||
247 | public String getCity() { | ||
248 | return city; | ||
249 | } | ||
250 | |||
251 | /** | ||
252 | * <!-- begin-user-doc --> | ||
253 | * <!-- end-user-doc --> | ||
254 | * @generated | ||
255 | */ | ||
256 | @Override | ||
257 | public void setCity(String newCity) { | ||
258 | String oldCity = city; | ||
259 | city = newCity; | ||
260 | if (eNotificationRequired()) | ||
261 | eNotify(new ENotificationImpl(this, Notification.SET, TaxationPackage.ADDRESS__CITY, oldCity, city)); | ||
262 | } | ||
263 | |||
264 | /** | ||
265 | * <!-- begin-user-doc --> | ||
266 | * <!-- end-user-doc --> | ||
267 | * @generated | ||
268 | */ | ||
269 | @Override | ||
270 | public String getId2() { | ||
271 | return id2; | ||
272 | } | ||
273 | |||
274 | /** | ||
275 | * <!-- begin-user-doc --> | ||
276 | * <!-- end-user-doc --> | ||
277 | * @generated | ||
278 | */ | ||
279 | @Override | ||
280 | public void setId2(String newId2) { | ||
281 | String oldId2 = id2; | ||
282 | id2 = newId2; | ||
283 | if (eNotificationRequired()) | ||
284 | eNotify(new ENotificationImpl(this, Notification.SET, TaxationPackage.ADDRESS__ID2, oldId2, id2)); | ||
285 | } | ||
286 | |||
287 | /** | ||
288 | * <!-- begin-user-doc --> | ||
289 | * <!-- end-user-doc --> | ||
290 | * @generated | ||
291 | */ | ||
292 | @Override | ||
293 | public EList<Physical_Person> getTaxPayer() { | ||
294 | if (taxPayer == null) { | ||
295 | taxPayer = new EObjectWithInverseResolvingEList.ManyInverse<Physical_Person>(Physical_Person.class, this, TaxationPackage.ADDRESS__TAX_PAYER, TaxationPackage.PHYSICAL_PERSON__ADDRESSES); | ||
296 | } | ||
297 | return taxPayer; | ||
298 | } | ||
299 | |||
300 | /** | ||
301 | * <!-- begin-user-doc --> | ||
302 | * <!-- end-user-doc --> | ||
303 | * @generated | ||
304 | */ | ||
305 | @SuppressWarnings("unchecked") | ||
306 | @Override | ||
307 | public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | ||
308 | switch (featureID) { | ||
309 | case TaxationPackage.ADDRESS__TAX_PAYER: | ||
310 | return ((InternalEList<InternalEObject>)(InternalEList<?>)getTaxPayer()).basicAdd(otherEnd, msgs); | ||
311 | } | ||
312 | return super.eInverseAdd(otherEnd, featureID, msgs); | ||
313 | } | ||
314 | |||
315 | /** | ||
316 | * <!-- begin-user-doc --> | ||
317 | * <!-- end-user-doc --> | ||
318 | * @generated | ||
319 | */ | ||
320 | @Override | ||
321 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | ||
322 | switch (featureID) { | ||
323 | case TaxationPackage.ADDRESS__TAX_PAYER: | ||
324 | return ((InternalEList<?>)getTaxPayer()).basicRemove(otherEnd, msgs); | ||
325 | } | ||
326 | return super.eInverseRemove(otherEnd, featureID, msgs); | ||
327 | } | ||
328 | |||
329 | /** | ||
330 | * <!-- begin-user-doc --> | ||
331 | * <!-- end-user-doc --> | ||
332 | * @generated | ||
333 | */ | ||
334 | @Override | ||
335 | public Object eGet(int featureID, boolean resolve, boolean coreType) { | ||
336 | switch (featureID) { | ||
337 | case TaxationPackage.ADDRESS__COUNTRY: | ||
338 | return getCountry(); | ||
339 | case TaxationPackage.ADDRESS__STREET: | ||
340 | return getStreet(); | ||
341 | case TaxationPackage.ADDRESS__ZIP_CODE: | ||
342 | return getZipCode(); | ||
343 | case TaxationPackage.ADDRESS__CITY: | ||
344 | return getCity(); | ||
345 | case TaxationPackage.ADDRESS__ID2: | ||
346 | return getId2(); | ||
347 | case TaxationPackage.ADDRESS__TAX_PAYER: | ||
348 | return getTaxPayer(); | ||
349 | } | ||
350 | return super.eGet(featureID, resolve, coreType); | ||
351 | } | ||
352 | |||
353 | /** | ||
354 | * <!-- begin-user-doc --> | ||
355 | * <!-- end-user-doc --> | ||
356 | * @generated | ||
357 | */ | ||
358 | @SuppressWarnings("unchecked") | ||
359 | @Override | ||
360 | public void eSet(int featureID, Object newValue) { | ||
361 | switch (featureID) { | ||
362 | case TaxationPackage.ADDRESS__COUNTRY: | ||
363 | setCountry((Country)newValue); | ||
364 | return; | ||
365 | case TaxationPackage.ADDRESS__STREET: | ||
366 | setStreet((String)newValue); | ||
367 | return; | ||
368 | case TaxationPackage.ADDRESS__ZIP_CODE: | ||
369 | setZipCode((String)newValue); | ||
370 | return; | ||
371 | case TaxationPackage.ADDRESS__CITY: | ||
372 | setCity((String)newValue); | ||
373 | return; | ||
374 | case TaxationPackage.ADDRESS__ID2: | ||
375 | setId2((String)newValue); | ||
376 | return; | ||
377 | case TaxationPackage.ADDRESS__TAX_PAYER: | ||
378 | getTaxPayer().clear(); | ||
379 | getTaxPayer().addAll((Collection<? extends Physical_Person>)newValue); | ||
380 | return; | ||
381 | } | ||
382 | super.eSet(featureID, newValue); | ||
383 | } | ||
384 | |||
385 | /** | ||
386 | * <!-- begin-user-doc --> | ||
387 | * <!-- end-user-doc --> | ||
388 | * @generated | ||
389 | */ | ||
390 | @Override | ||
391 | public void eUnset(int featureID) { | ||
392 | switch (featureID) { | ||
393 | case TaxationPackage.ADDRESS__COUNTRY: | ||
394 | setCountry(COUNTRY_EDEFAULT); | ||
395 | return; | ||
396 | case TaxationPackage.ADDRESS__STREET: | ||
397 | setStreet(STREET_EDEFAULT); | ||
398 | return; | ||
399 | case TaxationPackage.ADDRESS__ZIP_CODE: | ||
400 | setZipCode(ZIP_CODE_EDEFAULT); | ||
401 | return; | ||
402 | case TaxationPackage.ADDRESS__CITY: | ||
403 | setCity(CITY_EDEFAULT); | ||
404 | return; | ||
405 | case TaxationPackage.ADDRESS__ID2: | ||
406 | setId2(ID2_EDEFAULT); | ||
407 | return; | ||
408 | case TaxationPackage.ADDRESS__TAX_PAYER: | ||
409 | getTaxPayer().clear(); | ||
410 | return; | ||
411 | } | ||
412 | super.eUnset(featureID); | ||
413 | } | ||
414 | |||
415 | /** | ||
416 | * <!-- begin-user-doc --> | ||
417 | * <!-- end-user-doc --> | ||
418 | * @generated | ||
419 | */ | ||
420 | @Override | ||
421 | public boolean eIsSet(int featureID) { | ||
422 | switch (featureID) { | ||
423 | case TaxationPackage.ADDRESS__COUNTRY: | ||
424 | return country != COUNTRY_EDEFAULT; | ||
425 | case TaxationPackage.ADDRESS__STREET: | ||
426 | return STREET_EDEFAULT == null ? street != null : !STREET_EDEFAULT.equals(street); | ||
427 | case TaxationPackage.ADDRESS__ZIP_CODE: | ||
428 | return ZIP_CODE_EDEFAULT == null ? zipCode != null : !ZIP_CODE_EDEFAULT.equals(zipCode); | ||
429 | case TaxationPackage.ADDRESS__CITY: | ||
430 | return CITY_EDEFAULT == null ? city != null : !CITY_EDEFAULT.equals(city); | ||
431 | case TaxationPackage.ADDRESS__ID2: | ||
432 | return ID2_EDEFAULT == null ? id2 != null : !ID2_EDEFAULT.equals(id2); | ||
433 | case TaxationPackage.ADDRESS__TAX_PAYER: | ||
434 | return taxPayer != null && !taxPayer.isEmpty(); | ||
435 | } | ||
436 | return super.eIsSet(featureID); | ||
437 | } | ||
438 | |||
439 | /** | ||
440 | * <!-- begin-user-doc --> | ||
441 | * <!-- end-user-doc --> | ||
442 | * @generated | ||
443 | */ | ||
444 | @Override | ||
445 | public String toString() { | ||
446 | if (eIsProxy()) return super.toString(); | ||
447 | |||
448 | StringBuilder result = new StringBuilder(super.toString()); | ||
449 | result.append(" (country: "); | ||
450 | result.append(country); | ||
451 | result.append(", street: "); | ||
452 | result.append(street); | ||
453 | result.append(", zipCode: "); | ||
454 | result.append(zipCode); | ||
455 | result.append(", city: "); | ||
456 | result.append(city); | ||
457 | result.append(", id2: "); | ||
458 | result.append(id2); | ||
459 | result.append(')'); | ||
460 | return result.toString(); | ||
461 | } | ||
462 | |||
463 | } //AddressImpl | ||