diff options
author | 2019-02-15 12:42:15 -0500 | |
---|---|---|
committer | 2020-06-07 19:06:30 -0400 | |
commit | cd87de919c733033557401e011102edc67c5f169 (patch) | |
tree | c19225558d63945cf7afea5e0dc92c738788d71a /Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src/ca/mcgill/ecse/dslreasoner/standalone/test/fam/impl/FunctionalInterfaceImpl.java | |
parent | Fix FAM Test. Begin Grammar Fix. (diff) | |
download | VIATRA-Generator-cd87de919c733033557401e011102edc67c5f169.tar.gz VIATRA-Generator-cd87de919c733033557401e011102edc67c5f169.tar.zst VIATRA-Generator-cd87de919c733033557401e011102edc67c5f169.zip |
Set up #19
Diffstat (limited to 'Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src/ca/mcgill/ecse/dslreasoner/standalone/test/fam/impl/FunctionalInterfaceImpl.java')
-rw-r--r-- | Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src/ca/mcgill/ecse/dslreasoner/standalone/test/fam/impl/FunctionalInterfaceImpl.java | 243 |
1 files changed, 243 insertions, 0 deletions
diff --git a/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src/ca/mcgill/ecse/dslreasoner/standalone/test/fam/impl/FunctionalInterfaceImpl.java b/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src/ca/mcgill/ecse/dslreasoner/standalone/test/fam/impl/FunctionalInterfaceImpl.java new file mode 100644 index 00000000..b9417a23 --- /dev/null +++ b/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src/ca/mcgill/ecse/dslreasoner/standalone/test/fam/impl/FunctionalInterfaceImpl.java | |||
@@ -0,0 +1,243 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package ca.mcgill.ecse.dslreasoner.standalone.test.fam.impl; | ||
4 | |||
5 | import ca.mcgill.ecse.dslreasoner.standalone.test.fam.FunctionalData; | ||
6 | import ca.mcgill.ecse.dslreasoner.standalone.test.fam.FunctionalElement; | ||
7 | import ca.mcgill.ecse.dslreasoner.standalone.test.fam.FunctionalInterface; | ||
8 | import ca.mcgill.ecse.dslreasoner.standalone.test.fam.famPackage; | ||
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.impl.MinimalEObjectImpl; | ||
22 | |||
23 | import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList; | ||
24 | import org.eclipse.emf.ecore.util.EcoreUtil; | ||
25 | import org.eclipse.emf.ecore.util.InternalEList; | ||
26 | |||
27 | /** | ||
28 | * <!-- begin-user-doc --> | ||
29 | * An implementation of the model object '<em><b>Functional Interface</b></em>'. | ||
30 | * <!-- end-user-doc --> | ||
31 | * <p> | ||
32 | * The following features are implemented: | ||
33 | * </p> | ||
34 | * <ul> | ||
35 | * <li>{@link ca.mcgill.ecse.dslreasoner.standalone.test.fam.impl.FunctionalInterfaceImpl#getData <em>Data</em>}</li> | ||
36 | * <li>{@link ca.mcgill.ecse.dslreasoner.standalone.test.fam.impl.FunctionalInterfaceImpl#getElement <em>Element</em>}</li> | ||
37 | * </ul> | ||
38 | * | ||
39 | * @generated | ||
40 | */ | ||
41 | public class FunctionalInterfaceImpl extends MinimalEObjectImpl.Container implements FunctionalInterface { | ||
42 | /** | ||
43 | * The cached value of the '{@link #getData() <em>Data</em>}' containment reference list. | ||
44 | * <!-- begin-user-doc --> | ||
45 | * <!-- end-user-doc --> | ||
46 | * @see #getData() | ||
47 | * @generated | ||
48 | * @ordered | ||
49 | */ | ||
50 | protected EList<FunctionalData> data; | ||
51 | |||
52 | /** | ||
53 | * <!-- begin-user-doc --> | ||
54 | * <!-- end-user-doc --> | ||
55 | * @generated | ||
56 | */ | ||
57 | protected FunctionalInterfaceImpl() { | ||
58 | super(); | ||
59 | } | ||
60 | |||
61 | /** | ||
62 | * <!-- begin-user-doc --> | ||
63 | * <!-- end-user-doc --> | ||
64 | * @generated | ||
65 | */ | ||
66 | @Override | ||
67 | protected EClass eStaticClass() { | ||
68 | return famPackage.Literals.FUNCTIONAL_INTERFACE; | ||
69 | } | ||
70 | |||
71 | /** | ||
72 | * <!-- begin-user-doc --> | ||
73 | * <!-- end-user-doc --> | ||
74 | * @generated | ||
75 | */ | ||
76 | public EList<FunctionalData> getData() { | ||
77 | if (data == null) { | ||
78 | data = new EObjectContainmentWithInverseEList<FunctionalData>(FunctionalData.class, this, famPackage.FUNCTIONAL_INTERFACE__DATA, famPackage.FUNCTIONAL_DATA__INTERFACE); | ||
79 | } | ||
80 | return data; | ||
81 | } | ||
82 | |||
83 | /** | ||
84 | * <!-- begin-user-doc --> | ||
85 | * <!-- end-user-doc --> | ||
86 | * @generated | ||
87 | */ | ||
88 | public FunctionalElement getElement() { | ||
89 | if (eContainerFeatureID() != famPackage.FUNCTIONAL_INTERFACE__ELEMENT) return null; | ||
90 | return (FunctionalElement)eInternalContainer(); | ||
91 | } | ||
92 | |||
93 | /** | ||
94 | * <!-- begin-user-doc --> | ||
95 | * <!-- end-user-doc --> | ||
96 | * @generated | ||
97 | */ | ||
98 | public NotificationChain basicSetElement(FunctionalElement newElement, NotificationChain msgs) { | ||
99 | msgs = eBasicSetContainer((InternalEObject)newElement, famPackage.FUNCTIONAL_INTERFACE__ELEMENT, msgs); | ||
100 | return msgs; | ||
101 | } | ||
102 | |||
103 | /** | ||
104 | * <!-- begin-user-doc --> | ||
105 | * <!-- end-user-doc --> | ||
106 | * @generated | ||
107 | */ | ||
108 | public void setElement(FunctionalElement newElement) { | ||
109 | if (newElement != eInternalContainer() || (eContainerFeatureID() != famPackage.FUNCTIONAL_INTERFACE__ELEMENT && newElement != null)) { | ||
110 | if (EcoreUtil.isAncestor(this, newElement)) | ||
111 | throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); | ||
112 | NotificationChain msgs = null; | ||
113 | if (eInternalContainer() != null) | ||
114 | msgs = eBasicRemoveFromContainer(msgs); | ||
115 | if (newElement != null) | ||
116 | msgs = ((InternalEObject)newElement).eInverseAdd(this, famPackage.FUNCTIONAL_ELEMENT__INTERFACE, FunctionalElement.class, msgs); | ||
117 | msgs = basicSetElement(newElement, msgs); | ||
118 | if (msgs != null) msgs.dispatch(); | ||
119 | } | ||
120 | else if (eNotificationRequired()) | ||
121 | eNotify(new ENotificationImpl(this, Notification.SET, famPackage.FUNCTIONAL_INTERFACE__ELEMENT, newElement, newElement)); | ||
122 | } | ||
123 | |||
124 | /** | ||
125 | * <!-- begin-user-doc --> | ||
126 | * <!-- end-user-doc --> | ||
127 | * @generated | ||
128 | */ | ||
129 | @SuppressWarnings("unchecked") | ||
130 | @Override | ||
131 | public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | ||
132 | switch (featureID) { | ||
133 | case famPackage.FUNCTIONAL_INTERFACE__DATA: | ||
134 | return ((InternalEList<InternalEObject>)(InternalEList<?>)getData()).basicAdd(otherEnd, msgs); | ||
135 | case famPackage.FUNCTIONAL_INTERFACE__ELEMENT: | ||
136 | if (eInternalContainer() != null) | ||
137 | msgs = eBasicRemoveFromContainer(msgs); | ||
138 | return basicSetElement((FunctionalElement)otherEnd, msgs); | ||
139 | } | ||
140 | return super.eInverseAdd(otherEnd, featureID, msgs); | ||
141 | } | ||
142 | |||
143 | /** | ||
144 | * <!-- begin-user-doc --> | ||
145 | * <!-- end-user-doc --> | ||
146 | * @generated | ||
147 | */ | ||
148 | @Override | ||
149 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | ||
150 | switch (featureID) { | ||
151 | case famPackage.FUNCTIONAL_INTERFACE__DATA: | ||
152 | return ((InternalEList<?>)getData()).basicRemove(otherEnd, msgs); | ||
153 | case famPackage.FUNCTIONAL_INTERFACE__ELEMENT: | ||
154 | return basicSetElement(null, msgs); | ||
155 | } | ||
156 | return super.eInverseRemove(otherEnd, featureID, msgs); | ||
157 | } | ||
158 | |||
159 | /** | ||
160 | * <!-- begin-user-doc --> | ||
161 | * <!-- end-user-doc --> | ||
162 | * @generated | ||
163 | */ | ||
164 | @Override | ||
165 | public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { | ||
166 | switch (eContainerFeatureID()) { | ||
167 | case famPackage.FUNCTIONAL_INTERFACE__ELEMENT: | ||
168 | return eInternalContainer().eInverseRemove(this, famPackage.FUNCTIONAL_ELEMENT__INTERFACE, FunctionalElement.class, msgs); | ||
169 | } | ||
170 | return super.eBasicRemoveFromContainerFeature(msgs); | ||
171 | } | ||
172 | |||
173 | /** | ||
174 | * <!-- begin-user-doc --> | ||
175 | * <!-- end-user-doc --> | ||
176 | * @generated | ||
177 | */ | ||
178 | @Override | ||
179 | public Object eGet(int featureID, boolean resolve, boolean coreType) { | ||
180 | switch (featureID) { | ||
181 | case famPackage.FUNCTIONAL_INTERFACE__DATA: | ||
182 | return getData(); | ||
183 | case famPackage.FUNCTIONAL_INTERFACE__ELEMENT: | ||
184 | return getElement(); | ||
185 | } | ||
186 | return super.eGet(featureID, resolve, coreType); | ||
187 | } | ||
188 | |||
189 | /** | ||
190 | * <!-- begin-user-doc --> | ||
191 | * <!-- end-user-doc --> | ||
192 | * @generated | ||
193 | */ | ||
194 | @SuppressWarnings("unchecked") | ||
195 | @Override | ||
196 | public void eSet(int featureID, Object newValue) { | ||
197 | switch (featureID) { | ||
198 | case famPackage.FUNCTIONAL_INTERFACE__DATA: | ||
199 | getData().clear(); | ||
200 | getData().addAll((Collection<? extends FunctionalData>)newValue); | ||
201 | return; | ||
202 | case famPackage.FUNCTIONAL_INTERFACE__ELEMENT: | ||
203 | setElement((FunctionalElement)newValue); | ||
204 | return; | ||
205 | } | ||
206 | super.eSet(featureID, newValue); | ||
207 | } | ||
208 | |||
209 | /** | ||
210 | * <!-- begin-user-doc --> | ||
211 | * <!-- end-user-doc --> | ||
212 | * @generated | ||
213 | */ | ||
214 | @Override | ||
215 | public void eUnset(int featureID) { | ||
216 | switch (featureID) { | ||
217 | case famPackage.FUNCTIONAL_INTERFACE__DATA: | ||
218 | getData().clear(); | ||
219 | return; | ||
220 | case famPackage.FUNCTIONAL_INTERFACE__ELEMENT: | ||
221 | setElement((FunctionalElement)null); | ||
222 | return; | ||
223 | } | ||
224 | super.eUnset(featureID); | ||
225 | } | ||
226 | |||
227 | /** | ||
228 | * <!-- begin-user-doc --> | ||
229 | * <!-- end-user-doc --> | ||
230 | * @generated | ||
231 | */ | ||
232 | @Override | ||
233 | public boolean eIsSet(int featureID) { | ||
234 | switch (featureID) { | ||
235 | case famPackage.FUNCTIONAL_INTERFACE__DATA: | ||
236 | return data != null && !data.isEmpty(); | ||
237 | case famPackage.FUNCTIONAL_INTERFACE__ELEMENT: | ||
238 | return getElement() != null; | ||
239 | } | ||
240 | return super.eIsSet(featureID); | ||
241 | } | ||
242 | |||
243 | } //FunctionalInterfaceImpl | ||