aboutsummaryrefslogtreecommitdiffstats
path: root/Tests/MODELS2020-CaseStudies/models20.diversity-calculator/src/TaxationWithRoot/impl/FromLawImpl.java
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/MODELS2020-CaseStudies/models20.diversity-calculator/src/TaxationWithRoot/impl/FromLawImpl.java')
-rw-r--r--Tests/MODELS2020-CaseStudies/models20.diversity-calculator/src/TaxationWithRoot/impl/FromLawImpl.java268
1 files changed, 268 insertions, 0 deletions
diff --git a/Tests/MODELS2020-CaseStudies/models20.diversity-calculator/src/TaxationWithRoot/impl/FromLawImpl.java b/Tests/MODELS2020-CaseStudies/models20.diversity-calculator/src/TaxationWithRoot/impl/FromLawImpl.java
new file mode 100644
index 00000000..6244e60f
--- /dev/null
+++ b/Tests/MODELS2020-CaseStudies/models20.diversity-calculator/src/TaxationWithRoot/impl/FromLawImpl.java
@@ -0,0 +1,268 @@
1/**
2 */
3package TaxationWithRoot.impl;
4
5import TaxationWithRoot.FromLaw;
6import TaxationWithRoot.Tax_Payer;
7import TaxationWithRoot.TaxationWithRootPackage;
8
9import org.eclipse.emf.common.notify.Notification;
10import org.eclipse.emf.common.notify.NotificationChain;
11
12import org.eclipse.emf.ecore.EClass;
13import org.eclipse.emf.ecore.InternalEObject;
14
15import org.eclipse.emf.ecore.impl.ENotificationImpl;
16import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
17
18import org.eclipse.emf.ecore.util.EcoreUtil;
19
20/**
21 * <!-- begin-user-doc -->
22 * An implementation of the model object '<em><b>From Law</b></em>'.
23 * <!-- end-user-doc -->
24 * <p>
25 * The following features are implemented:
26 * </p>
27 * <ul>
28 * <li>{@link TaxationWithRoot.impl.FromLawImpl#getId <em>Id</em>}</li>
29 * <li>{@link TaxationWithRoot.impl.FromLawImpl#getTaxPayer <em>Tax Payer</em>}</li>
30 * </ul>
31 *
32 * @generated
33 */
34public class FromLawImpl extends MinimalEObjectImpl.Container implements FromLaw {
35 /**
36 * The default value of the '{@link #getId() <em>Id</em>}' attribute.
37 * <!-- begin-user-doc -->
38 * <!-- end-user-doc -->
39 * @see #getId()
40 * @generated
41 * @ordered
42 */
43 protected static final String ID_EDEFAULT = null;
44
45 /**
46 * The cached value of the '{@link #getId() <em>Id</em>}' attribute.
47 * <!-- begin-user-doc -->
48 * <!-- end-user-doc -->
49 * @see #getId()
50 * @generated
51 * @ordered
52 */
53 protected String id = ID_EDEFAULT;
54
55 /**
56 * <!-- begin-user-doc -->
57 * <!-- end-user-doc -->
58 * @generated
59 */
60 protected FromLawImpl() {
61 super();
62 }
63
64 /**
65 * <!-- begin-user-doc -->
66 * <!-- end-user-doc -->
67 * @generated
68 */
69 @Override
70 protected EClass eStaticClass() {
71 return TaxationWithRootPackage.Literals.FROM_LAW;
72 }
73
74 /**
75 * <!-- begin-user-doc -->
76 * <!-- end-user-doc -->
77 * @generated
78 */
79 @Override
80 public String getId() {
81 return id;
82 }
83
84 /**
85 * <!-- begin-user-doc -->
86 * <!-- end-user-doc -->
87 * @generated
88 */
89 @Override
90 public void setId(String newId) {
91 String oldId = id;
92 id = newId;
93 if (eNotificationRequired())
94 eNotify(new ENotificationImpl(this, Notification.SET, TaxationWithRootPackage.FROM_LAW__ID, oldId, id));
95 }
96
97 /**
98 * <!-- begin-user-doc -->
99 * <!-- end-user-doc -->
100 * @generated
101 */
102 @Override
103 public Tax_Payer getTaxPayer() {
104 if (eContainerFeatureID() != TaxationWithRootPackage.FROM_LAW__TAX_PAYER) return null;
105 return (Tax_Payer)eInternalContainer();
106 }
107
108 /**
109 * <!-- begin-user-doc -->
110 * <!-- end-user-doc -->
111 * @generated
112 */
113 public NotificationChain basicSetTaxPayer(Tax_Payer newTaxPayer, NotificationChain msgs) {
114 msgs = eBasicSetContainer((InternalEObject)newTaxPayer, TaxationWithRootPackage.FROM_LAW__TAX_PAYER, msgs);
115 return msgs;
116 }
117
118 /**
119 * <!-- begin-user-doc -->
120 * <!-- end-user-doc -->
121 * @generated
122 */
123 @Override
124 public void setTaxPayer(Tax_Payer newTaxPayer) {
125 if (newTaxPayer != eInternalContainer() || (eContainerFeatureID() != TaxationWithRootPackage.FROM_LAW__TAX_PAYER && newTaxPayer != null)) {
126 if (EcoreUtil.isAncestor(this, newTaxPayer))
127 throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
128 NotificationChain msgs = null;
129 if (eInternalContainer() != null)
130 msgs = eBasicRemoveFromContainer(msgs);
131 if (newTaxPayer != null)
132 msgs = ((InternalEObject)newTaxPayer).eInverseAdd(this, TaxationWithRootPackage.TAX_PAYER__FROM_LAW, Tax_Payer.class, msgs);
133 msgs = basicSetTaxPayer(newTaxPayer, msgs);
134 if (msgs != null) msgs.dispatch();
135 }
136 else if (eNotificationRequired())
137 eNotify(new ENotificationImpl(this, Notification.SET, TaxationWithRootPackage.FROM_LAW__TAX_PAYER, newTaxPayer, newTaxPayer));
138 }
139
140 /**
141 * <!-- begin-user-doc -->
142 * <!-- end-user-doc -->
143 * @generated
144 */
145 @Override
146 public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
147 switch (featureID) {
148 case TaxationWithRootPackage.FROM_LAW__TAX_PAYER:
149 if (eInternalContainer() != null)
150 msgs = eBasicRemoveFromContainer(msgs);
151 return basicSetTaxPayer((Tax_Payer)otherEnd, msgs);
152 }
153 return super.eInverseAdd(otherEnd, featureID, msgs);
154 }
155
156 /**
157 * <!-- begin-user-doc -->
158 * <!-- end-user-doc -->
159 * @generated
160 */
161 @Override
162 public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
163 switch (featureID) {
164 case TaxationWithRootPackage.FROM_LAW__TAX_PAYER:
165 return basicSetTaxPayer(null, msgs);
166 }
167 return super.eInverseRemove(otherEnd, featureID, msgs);
168 }
169
170 /**
171 * <!-- begin-user-doc -->
172 * <!-- end-user-doc -->
173 * @generated
174 */
175 @Override
176 public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) {
177 switch (eContainerFeatureID()) {
178 case TaxationWithRootPackage.FROM_LAW__TAX_PAYER:
179 return eInternalContainer().eInverseRemove(this, TaxationWithRootPackage.TAX_PAYER__FROM_LAW, Tax_Payer.class, msgs);
180 }
181 return super.eBasicRemoveFromContainerFeature(msgs);
182 }
183
184 /**
185 * <!-- begin-user-doc -->
186 * <!-- end-user-doc -->
187 * @generated
188 */
189 @Override
190 public Object eGet(int featureID, boolean resolve, boolean coreType) {
191 switch (featureID) {
192 case TaxationWithRootPackage.FROM_LAW__ID:
193 return getId();
194 case TaxationWithRootPackage.FROM_LAW__TAX_PAYER:
195 return getTaxPayer();
196 }
197 return super.eGet(featureID, resolve, coreType);
198 }
199
200 /**
201 * <!-- begin-user-doc -->
202 * <!-- end-user-doc -->
203 * @generated
204 */
205 @Override
206 public void eSet(int featureID, Object newValue) {
207 switch (featureID) {
208 case TaxationWithRootPackage.FROM_LAW__ID:
209 setId((String)newValue);
210 return;
211 case TaxationWithRootPackage.FROM_LAW__TAX_PAYER:
212 setTaxPayer((Tax_Payer)newValue);
213 return;
214 }
215 super.eSet(featureID, newValue);
216 }
217
218 /**
219 * <!-- begin-user-doc -->
220 * <!-- end-user-doc -->
221 * @generated
222 */
223 @Override
224 public void eUnset(int featureID) {
225 switch (featureID) {
226 case TaxationWithRootPackage.FROM_LAW__ID:
227 setId(ID_EDEFAULT);
228 return;
229 case TaxationWithRootPackage.FROM_LAW__TAX_PAYER:
230 setTaxPayer((Tax_Payer)null);
231 return;
232 }
233 super.eUnset(featureID);
234 }
235
236 /**
237 * <!-- begin-user-doc -->
238 * <!-- end-user-doc -->
239 * @generated
240 */
241 @Override
242 public boolean eIsSet(int featureID) {
243 switch (featureID) {
244 case TaxationWithRootPackage.FROM_LAW__ID:
245 return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id);
246 case TaxationWithRootPackage.FROM_LAW__TAX_PAYER:
247 return getTaxPayer() != null;
248 }
249 return super.eIsSet(featureID);
250 }
251
252 /**
253 * <!-- begin-user-doc -->
254 * <!-- end-user-doc -->
255 * @generated
256 */
257 @Override
258 public String toString() {
259 if (eIsProxy()) return super.toString();
260
261 StringBuilder result = new StringBuilder(super.toString());
262 result.append(" (id: ");
263 result.append(id);
264 result.append(')');
265 return result.toString();
266 }
267
268} //FromLawImpl