aboutsummaryrefslogtreecommitdiffstats
path: root/Tests/MODELS2020-CaseStudies/case.study.pledge.model/src/TaxationWithRoot/impl/HouseholdImpl.java
diff options
context:
space:
mode:
authorLibravatar ArenBabikian <aren.babikian@mail.mcgill.ca>2020-05-13 00:16:27 -0400
committerLibravatar ArenBabikian <aren.babikian@mail.mcgill.ca>2020-05-13 00:16:27 -0400
commit5fd28fe3201ad6e316fea3688bd89130bc29bc13 (patch)
treef8cc7181b1eadec0f2e1d69d4cdac9e4938e07df /Tests/MODELS2020-CaseStudies/case.study.pledge.model/src/TaxationWithRoot/impl/HouseholdImpl.java
parentmemory cleaning message between tasks (diff)
downloadVIATRA-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/HouseholdImpl.java')
-rw-r--r--Tests/MODELS2020-CaseStudies/case.study.pledge.model/src/TaxationWithRoot/impl/HouseholdImpl.java311
1 files changed, 311 insertions, 0 deletions
diff --git a/Tests/MODELS2020-CaseStudies/case.study.pledge.model/src/TaxationWithRoot/impl/HouseholdImpl.java b/Tests/MODELS2020-CaseStudies/case.study.pledge.model/src/TaxationWithRoot/impl/HouseholdImpl.java
new file mode 100644
index 00000000..770bb5e0
--- /dev/null
+++ b/Tests/MODELS2020-CaseStudies/case.study.pledge.model/src/TaxationWithRoot/impl/HouseholdImpl.java
@@ -0,0 +1,311 @@
1/**
2 */
3package TaxationWithRoot.impl;
4
5import TaxationWithRoot.Dependent;
6import TaxationWithRoot.Household;
7import TaxationWithRoot.Legal_Union_Record;
8import TaxationWithRoot.TaxationPackage;
9
10import java.util.Collection;
11
12import org.eclipse.emf.common.notify.Notification;
13import org.eclipse.emf.common.notify.NotificationChain;
14
15import org.eclipse.emf.common.util.EList;
16
17import org.eclipse.emf.ecore.EClass;
18import org.eclipse.emf.ecore.InternalEObject;
19
20import org.eclipse.emf.ecore.impl.ENotificationImpl;
21import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
22import org.eclipse.emf.ecore.util.InternalEList;
23
24/**
25 * <!-- begin-user-doc -->
26 * An implementation of the model object '<em><b>Household</b></em>'.
27 * <!-- end-user-doc -->
28 * <p>
29 * The following features are implemented:
30 * </p>
31 * <ul>
32 * <li>{@link TaxationWithRoot.impl.HouseholdImpl#getParents <em>Parents</em>}</li>
33 * <li>{@link TaxationWithRoot.impl.HouseholdImpl#getId1 <em>Id1</em>}</li>
34 * <li>{@link TaxationWithRoot.impl.HouseholdImpl#getChildren <em>Children</em>}</li>
35 * </ul>
36 *
37 * @generated
38 */
39public class HouseholdImpl extends RootImpl implements Household {
40 /**
41 * The cached value of the '{@link #getParents() <em>Parents</em>}' containment reference.
42 * <!-- begin-user-doc -->
43 * <!-- end-user-doc -->
44 * @see #getParents()
45 * @generated
46 * @ordered
47 */
48 protected Legal_Union_Record parents;
49
50 /**
51 * The default value of the '{@link #getId1() <em>Id1</em>}' attribute.
52 * <!-- begin-user-doc -->
53 * <!-- end-user-doc -->
54 * @see #getId1()
55 * @generated
56 * @ordered
57 */
58 protected static final String ID1_EDEFAULT = null;
59
60 /**
61 * The cached value of the '{@link #getId1() <em>Id1</em>}' attribute.
62 * <!-- begin-user-doc -->
63 * <!-- end-user-doc -->
64 * @see #getId1()
65 * @generated
66 * @ordered
67 */
68 protected String id1 = ID1_EDEFAULT;
69
70 /**
71 * The cached value of the '{@link #getChildren() <em>Children</em>}' containment reference list.
72 * <!-- begin-user-doc -->
73 * <!-- end-user-doc -->
74 * @see #getChildren()
75 * @generated
76 * @ordered
77 */
78 protected EList<Dependent> children;
79
80 /**
81 * <!-- begin-user-doc -->
82 * <!-- end-user-doc -->
83 * @generated
84 */
85 protected HouseholdImpl() {
86 super();
87 }
88
89 /**
90 * <!-- begin-user-doc -->
91 * <!-- end-user-doc -->
92 * @generated
93 */
94 @Override
95 protected EClass eStaticClass() {
96 return TaxationPackage.Literals.HOUSEHOLD;
97 }
98
99 /**
100 * <!-- begin-user-doc -->
101 * <!-- end-user-doc -->
102 * @generated
103 */
104 @Override
105 public Legal_Union_Record getParents() {
106 return parents;
107 }
108
109 /**
110 * <!-- begin-user-doc -->
111 * <!-- end-user-doc -->
112 * @generated
113 */
114 public NotificationChain basicSetParents(Legal_Union_Record newParents, NotificationChain msgs) {
115 Legal_Union_Record oldParents = parents;
116 parents = newParents;
117 if (eNotificationRequired()) {
118 ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, TaxationPackage.HOUSEHOLD__PARENTS, oldParents, newParents);
119 if (msgs == null) msgs = notification; else msgs.add(notification);
120 }
121 return msgs;
122 }
123
124 /**
125 * <!-- begin-user-doc -->
126 * <!-- end-user-doc -->
127 * @generated
128 */
129 @Override
130 public void setParents(Legal_Union_Record newParents) {
131 if (newParents != parents) {
132 NotificationChain msgs = null;
133 if (parents != null)
134 msgs = ((InternalEObject)parents).eInverseRemove(this, TaxationPackage.LEGAL_UNION_RECORD__HOUSEHOLD, Legal_Union_Record.class, msgs);
135 if (newParents != null)
136 msgs = ((InternalEObject)newParents).eInverseAdd(this, TaxationPackage.LEGAL_UNION_RECORD__HOUSEHOLD, Legal_Union_Record.class, msgs);
137 msgs = basicSetParents(newParents, msgs);
138 if (msgs != null) msgs.dispatch();
139 }
140 else if (eNotificationRequired())
141 eNotify(new ENotificationImpl(this, Notification.SET, TaxationPackage.HOUSEHOLD__PARENTS, newParents, newParents));
142 }
143
144 /**
145 * <!-- begin-user-doc -->
146 * <!-- end-user-doc -->
147 * @generated
148 */
149 @Override
150 public String getId1() {
151 return id1;
152 }
153
154 /**
155 * <!-- begin-user-doc -->
156 * <!-- end-user-doc -->
157 * @generated
158 */
159 @Override
160 public void setId1(String newId1) {
161 String oldId1 = id1;
162 id1 = newId1;
163 if (eNotificationRequired())
164 eNotify(new ENotificationImpl(this, Notification.SET, TaxationPackage.HOUSEHOLD__ID1, oldId1, id1));
165 }
166
167 /**
168 * <!-- begin-user-doc -->
169 * <!-- end-user-doc -->
170 * @generated
171 */
172 @Override
173 public EList<Dependent> getChildren() {
174 if (children == null) {
175 children = new EObjectContainmentWithInverseEList<Dependent>(Dependent.class, this, TaxationPackage.HOUSEHOLD__CHILDREN, TaxationPackage.DEPENDENT__HOUSEHOLD);
176 }
177 return children;
178 }
179
180 /**
181 * <!-- begin-user-doc -->
182 * <!-- end-user-doc -->
183 * @generated
184 */
185 @SuppressWarnings("unchecked")
186 @Override
187 public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
188 switch (featureID) {
189 case TaxationPackage.HOUSEHOLD__PARENTS:
190 if (parents != null)
191 msgs = ((InternalEObject)parents).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - TaxationPackage.HOUSEHOLD__PARENTS, null, msgs);
192 return basicSetParents((Legal_Union_Record)otherEnd, msgs);
193 case TaxationPackage.HOUSEHOLD__CHILDREN:
194 return ((InternalEList<InternalEObject>)(InternalEList<?>)getChildren()).basicAdd(otherEnd, msgs);
195 }
196 return super.eInverseAdd(otherEnd, featureID, msgs);
197 }
198
199 /**
200 * <!-- begin-user-doc -->
201 * <!-- end-user-doc -->
202 * @generated
203 */
204 @Override
205 public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
206 switch (featureID) {
207 case TaxationPackage.HOUSEHOLD__PARENTS:
208 return basicSetParents(null, msgs);
209 case TaxationPackage.HOUSEHOLD__CHILDREN:
210 return ((InternalEList<?>)getChildren()).basicRemove(otherEnd, msgs);
211 }
212 return super.eInverseRemove(otherEnd, featureID, msgs);
213 }
214
215 /**
216 * <!-- begin-user-doc -->
217 * <!-- end-user-doc -->
218 * @generated
219 */
220 @Override
221 public Object eGet(int featureID, boolean resolve, boolean coreType) {
222 switch (featureID) {
223 case TaxationPackage.HOUSEHOLD__PARENTS:
224 return getParents();
225 case TaxationPackage.HOUSEHOLD__ID1:
226 return getId1();
227 case TaxationPackage.HOUSEHOLD__CHILDREN:
228 return getChildren();
229 }
230 return super.eGet(featureID, resolve, coreType);
231 }
232
233 /**
234 * <!-- begin-user-doc -->
235 * <!-- end-user-doc -->
236 * @generated
237 */
238 @SuppressWarnings("unchecked")
239 @Override
240 public void eSet(int featureID, Object newValue) {
241 switch (featureID) {
242 case TaxationPackage.HOUSEHOLD__PARENTS:
243 setParents((Legal_Union_Record)newValue);
244 return;
245 case TaxationPackage.HOUSEHOLD__ID1:
246 setId1((String)newValue);
247 return;
248 case TaxationPackage.HOUSEHOLD__CHILDREN:
249 getChildren().clear();
250 getChildren().addAll((Collection<? extends Dependent>)newValue);
251 return;
252 }
253 super.eSet(featureID, newValue);
254 }
255
256 /**
257 * <!-- begin-user-doc -->
258 * <!-- end-user-doc -->
259 * @generated
260 */
261 @Override
262 public void eUnset(int featureID) {
263 switch (featureID) {
264 case TaxationPackage.HOUSEHOLD__PARENTS:
265 setParents((Legal_Union_Record)null);
266 return;
267 case TaxationPackage.HOUSEHOLD__ID1:
268 setId1(ID1_EDEFAULT);
269 return;
270 case TaxationPackage.HOUSEHOLD__CHILDREN:
271 getChildren().clear();
272 return;
273 }
274 super.eUnset(featureID);
275 }
276
277 /**
278 * <!-- begin-user-doc -->
279 * <!-- end-user-doc -->
280 * @generated
281 */
282 @Override
283 public boolean eIsSet(int featureID) {
284 switch (featureID) {
285 case TaxationPackage.HOUSEHOLD__PARENTS:
286 return parents != null;
287 case TaxationPackage.HOUSEHOLD__ID1:
288 return ID1_EDEFAULT == null ? id1 != null : !ID1_EDEFAULT.equals(id1);
289 case TaxationPackage.HOUSEHOLD__CHILDREN:
290 return children != null && !children.isEmpty();
291 }
292 return super.eIsSet(featureID);
293 }
294
295 /**
296 * <!-- begin-user-doc -->
297 * <!-- end-user-doc -->
298 * @generated
299 */
300 @Override
301 public String toString() {
302 if (eIsProxy()) return super.toString();
303
304 StringBuilder result = new StringBuilder(super.toString());
305 result.append(" (id1: ");
306 result.append(id1);
307 result.append(')');
308 return result.toString();
309 }
310
311} //HouseholdImpl