aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language.model/src/main/emf-gen/org/eclipse/viatra/solver/language/model/problem/impl/ReferenceDeclarationImpl.java
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language.model/src/main/emf-gen/org/eclipse/viatra/solver/language/model/problem/impl/ReferenceDeclarationImpl.java')
-rw-r--r--org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language.model/src/main/emf-gen/org/eclipse/viatra/solver/language/model/problem/impl/ReferenceDeclarationImpl.java379
1 files changed, 379 insertions, 0 deletions
diff --git a/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language.model/src/main/emf-gen/org/eclipse/viatra/solver/language/model/problem/impl/ReferenceDeclarationImpl.java b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language.model/src/main/emf-gen/org/eclipse/viatra/solver/language/model/problem/impl/ReferenceDeclarationImpl.java
new file mode 100644
index 00000000..424db23d
--- /dev/null
+++ b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language.model/src/main/emf-gen/org/eclipse/viatra/solver/language/model/problem/impl/ReferenceDeclarationImpl.java
@@ -0,0 +1,379 @@
1/**
2 */
3package org.eclipse.viatra.solver.language.model.problem.impl;
4
5import org.eclipse.emf.common.notify.Notification;
6import org.eclipse.emf.common.notify.NotificationChain;
7
8import org.eclipse.emf.ecore.EClass;
9import org.eclipse.emf.ecore.InternalEObject;
10
11import org.eclipse.emf.ecore.impl.ENotificationImpl;
12
13import org.eclipse.viatra.solver.language.model.problem.ClassDeclaration;
14import org.eclipse.viatra.solver.language.model.problem.Multiplicity;
15import org.eclipse.viatra.solver.language.model.problem.ProblemPackage;
16import org.eclipse.viatra.solver.language.model.problem.ReferenceDeclaration;
17
18/**
19 * <!-- begin-user-doc -->
20 * An implementation of the model object '<em><b>Reference Declaration</b></em>'.
21 * <!-- end-user-doc -->
22 * <p>
23 * The following features are implemented:
24 * </p>
25 * <ul>
26 * <li>{@link org.eclipse.viatra.solver.language.model.problem.impl.ReferenceDeclarationImpl#getReferenceType <em>Reference Type</em>}</li>
27 * <li>{@link org.eclipse.viatra.solver.language.model.problem.impl.ReferenceDeclarationImpl#getOpposite <em>Opposite</em>}</li>
28 * <li>{@link org.eclipse.viatra.solver.language.model.problem.impl.ReferenceDeclarationImpl#isContainment <em>Containment</em>}</li>
29 * <li>{@link org.eclipse.viatra.solver.language.model.problem.impl.ReferenceDeclarationImpl#getMultiplicity <em>Multiplicity</em>}</li>
30 * </ul>
31 *
32 * @generated
33 */
34public class ReferenceDeclarationImpl extends RelationImpl implements ReferenceDeclaration {
35 /**
36 * The cached value of the '{@link #getReferenceType() <em>Reference Type</em>}' reference.
37 * <!-- begin-user-doc -->
38 * <!-- end-user-doc -->
39 * @see #getReferenceType()
40 * @generated
41 * @ordered
42 */
43 protected ClassDeclaration referenceType;
44
45 /**
46 * The cached value of the '{@link #getOpposite() <em>Opposite</em>}' reference.
47 * <!-- begin-user-doc -->
48 * <!-- end-user-doc -->
49 * @see #getOpposite()
50 * @generated
51 * @ordered
52 */
53 protected ReferenceDeclaration opposite;
54
55 /**
56 * The default value of the '{@link #isContainment() <em>Containment</em>}' attribute.
57 * <!-- begin-user-doc -->
58 * <!-- end-user-doc -->
59 * @see #isContainment()
60 * @generated
61 * @ordered
62 */
63 protected static final boolean CONTAINMENT_EDEFAULT = false;
64
65 /**
66 * The cached value of the '{@link #isContainment() <em>Containment</em>}' attribute.
67 * <!-- begin-user-doc -->
68 * <!-- end-user-doc -->
69 * @see #isContainment()
70 * @generated
71 * @ordered
72 */
73 protected boolean containment = CONTAINMENT_EDEFAULT;
74
75 /**
76 * The cached value of the '{@link #getMultiplicity() <em>Multiplicity</em>}' containment reference.
77 * <!-- begin-user-doc -->
78 * <!-- end-user-doc -->
79 * @see #getMultiplicity()
80 * @generated
81 * @ordered
82 */
83 protected Multiplicity multiplicity;
84
85 /**
86 * <!-- begin-user-doc -->
87 * <!-- end-user-doc -->
88 * @generated
89 */
90 protected ReferenceDeclarationImpl() {
91 super();
92 }
93
94 /**
95 * <!-- begin-user-doc -->
96 * <!-- end-user-doc -->
97 * @generated
98 */
99 @Override
100 protected EClass eStaticClass() {
101 return ProblemPackage.Literals.REFERENCE_DECLARATION;
102 }
103
104 /**
105 * <!-- begin-user-doc -->
106 * <!-- end-user-doc -->
107 * @generated
108 */
109 public ClassDeclaration getReferenceType() {
110 if (referenceType != null && referenceType.eIsProxy()) {
111 InternalEObject oldReferenceType = (InternalEObject) referenceType;
112 referenceType = (ClassDeclaration) eResolveProxy(oldReferenceType);
113 if (referenceType != oldReferenceType) {
114 if (eNotificationRequired())
115 eNotify(new ENotificationImpl(this, Notification.RESOLVE,
116 ProblemPackage.REFERENCE_DECLARATION__REFERENCE_TYPE, oldReferenceType, referenceType));
117 }
118 }
119 return referenceType;
120 }
121
122 /**
123 * <!-- begin-user-doc -->
124 * <!-- end-user-doc -->
125 * @generated
126 */
127 public ClassDeclaration basicGetReferenceType() {
128 return referenceType;
129 }
130
131 /**
132 * <!-- begin-user-doc -->
133 * <!-- end-user-doc -->
134 * @generated
135 */
136 public void setReferenceType(ClassDeclaration newReferenceType) {
137 ClassDeclaration oldReferenceType = referenceType;
138 referenceType = newReferenceType;
139 if (eNotificationRequired())
140 eNotify(new ENotificationImpl(this, Notification.SET, ProblemPackage.REFERENCE_DECLARATION__REFERENCE_TYPE,
141 oldReferenceType, referenceType));
142 }
143
144 /**
145 * <!-- begin-user-doc -->
146 * <!-- end-user-doc -->
147 * @generated
148 */
149 public ReferenceDeclaration getOpposite() {
150 if (opposite != null && opposite.eIsProxy()) {
151 InternalEObject oldOpposite = (InternalEObject) opposite;
152 opposite = (ReferenceDeclaration) eResolveProxy(oldOpposite);
153 if (opposite != oldOpposite) {
154 if (eNotificationRequired())
155 eNotify(new ENotificationImpl(this, Notification.RESOLVE,
156 ProblemPackage.REFERENCE_DECLARATION__OPPOSITE, oldOpposite, opposite));
157 }
158 }
159 return opposite;
160 }
161
162 /**
163 * <!-- begin-user-doc -->
164 * <!-- end-user-doc -->
165 * @generated
166 */
167 public ReferenceDeclaration basicGetOpposite() {
168 return opposite;
169 }
170
171 /**
172 * <!-- begin-user-doc -->
173 * <!-- end-user-doc -->
174 * @generated
175 */
176 public void setOpposite(ReferenceDeclaration newOpposite) {
177 ReferenceDeclaration oldOpposite = opposite;
178 opposite = newOpposite;
179 if (eNotificationRequired())
180 eNotify(new ENotificationImpl(this, Notification.SET, ProblemPackage.REFERENCE_DECLARATION__OPPOSITE,
181 oldOpposite, opposite));
182 }
183
184 /**
185 * <!-- begin-user-doc -->
186 * <!-- end-user-doc -->
187 * @generated
188 */
189 public boolean isContainment() {
190 return containment;
191 }
192
193 /**
194 * <!-- begin-user-doc -->
195 * <!-- end-user-doc -->
196 * @generated
197 */
198 public void setContainment(boolean newContainment) {
199 boolean oldContainment = containment;
200 containment = newContainment;
201 if (eNotificationRequired())
202 eNotify(new ENotificationImpl(this, Notification.SET, ProblemPackage.REFERENCE_DECLARATION__CONTAINMENT,
203 oldContainment, containment));
204 }
205
206 /**
207 * <!-- begin-user-doc -->
208 * <!-- end-user-doc -->
209 * @generated
210 */
211 public Multiplicity getMultiplicity() {
212 return multiplicity;
213 }
214
215 /**
216 * <!-- begin-user-doc -->
217 * <!-- end-user-doc -->
218 * @generated
219 */
220 public NotificationChain basicSetMultiplicity(Multiplicity newMultiplicity, NotificationChain msgs) {
221 Multiplicity oldMultiplicity = multiplicity;
222 multiplicity = newMultiplicity;
223 if (eNotificationRequired()) {
224 ENotificationImpl notification = new ENotificationImpl(this, Notification.SET,
225 ProblemPackage.REFERENCE_DECLARATION__MULTIPLICITY, oldMultiplicity, newMultiplicity);
226 if (msgs == null)
227 msgs = notification;
228 else
229 msgs.add(notification);
230 }
231 return msgs;
232 }
233
234 /**
235 * <!-- begin-user-doc -->
236 * <!-- end-user-doc -->
237 * @generated
238 */
239 public void setMultiplicity(Multiplicity newMultiplicity) {
240 if (newMultiplicity != multiplicity) {
241 NotificationChain msgs = null;
242 if (multiplicity != null)
243 msgs = ((InternalEObject) multiplicity).eInverseRemove(this,
244 EOPPOSITE_FEATURE_BASE - ProblemPackage.REFERENCE_DECLARATION__MULTIPLICITY, null, msgs);
245 if (newMultiplicity != null)
246 msgs = ((InternalEObject) newMultiplicity).eInverseAdd(this,
247 EOPPOSITE_FEATURE_BASE - ProblemPackage.REFERENCE_DECLARATION__MULTIPLICITY, null, msgs);
248 msgs = basicSetMultiplicity(newMultiplicity, msgs);
249 if (msgs != null)
250 msgs.dispatch();
251 } else if (eNotificationRequired())
252 eNotify(new ENotificationImpl(this, Notification.SET, ProblemPackage.REFERENCE_DECLARATION__MULTIPLICITY,
253 newMultiplicity, newMultiplicity));
254 }
255
256 /**
257 * <!-- begin-user-doc -->
258 * <!-- end-user-doc -->
259 * @generated
260 */
261 @Override
262 public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
263 switch (featureID) {
264 case ProblemPackage.REFERENCE_DECLARATION__MULTIPLICITY:
265 return basicSetMultiplicity(null, msgs);
266 }
267 return super.eInverseRemove(otherEnd, featureID, msgs);
268 }
269
270 /**
271 * <!-- begin-user-doc -->
272 * <!-- end-user-doc -->
273 * @generated
274 */
275 @Override
276 public Object eGet(int featureID, boolean resolve, boolean coreType) {
277 switch (featureID) {
278 case ProblemPackage.REFERENCE_DECLARATION__REFERENCE_TYPE:
279 if (resolve)
280 return getReferenceType();
281 return basicGetReferenceType();
282 case ProblemPackage.REFERENCE_DECLARATION__OPPOSITE:
283 if (resolve)
284 return getOpposite();
285 return basicGetOpposite();
286 case ProblemPackage.REFERENCE_DECLARATION__CONTAINMENT:
287 return isContainment();
288 case ProblemPackage.REFERENCE_DECLARATION__MULTIPLICITY:
289 return getMultiplicity();
290 }
291 return super.eGet(featureID, resolve, coreType);
292 }
293
294 /**
295 * <!-- begin-user-doc -->
296 * <!-- end-user-doc -->
297 * @generated
298 */
299 @Override
300 public void eSet(int featureID, Object newValue) {
301 switch (featureID) {
302 case ProblemPackage.REFERENCE_DECLARATION__REFERENCE_TYPE:
303 setReferenceType((ClassDeclaration) newValue);
304 return;
305 case ProblemPackage.REFERENCE_DECLARATION__OPPOSITE:
306 setOpposite((ReferenceDeclaration) newValue);
307 return;
308 case ProblemPackage.REFERENCE_DECLARATION__CONTAINMENT:
309 setContainment((Boolean) newValue);
310 return;
311 case ProblemPackage.REFERENCE_DECLARATION__MULTIPLICITY:
312 setMultiplicity((Multiplicity) newValue);
313 return;
314 }
315 super.eSet(featureID, newValue);
316 }
317
318 /**
319 * <!-- begin-user-doc -->
320 * <!-- end-user-doc -->
321 * @generated
322 */
323 @Override
324 public void eUnset(int featureID) {
325 switch (featureID) {
326 case ProblemPackage.REFERENCE_DECLARATION__REFERENCE_TYPE:
327 setReferenceType((ClassDeclaration) null);
328 return;
329 case ProblemPackage.REFERENCE_DECLARATION__OPPOSITE:
330 setOpposite((ReferenceDeclaration) null);
331 return;
332 case ProblemPackage.REFERENCE_DECLARATION__CONTAINMENT:
333 setContainment(CONTAINMENT_EDEFAULT);
334 return;
335 case ProblemPackage.REFERENCE_DECLARATION__MULTIPLICITY:
336 setMultiplicity((Multiplicity) null);
337 return;
338 }
339 super.eUnset(featureID);
340 }
341
342 /**
343 * <!-- begin-user-doc -->
344 * <!-- end-user-doc -->
345 * @generated
346 */
347 @Override
348 public boolean eIsSet(int featureID) {
349 switch (featureID) {
350 case ProblemPackage.REFERENCE_DECLARATION__REFERENCE_TYPE:
351 return referenceType != null;
352 case ProblemPackage.REFERENCE_DECLARATION__OPPOSITE:
353 return opposite != null;
354 case ProblemPackage.REFERENCE_DECLARATION__CONTAINMENT:
355 return containment != CONTAINMENT_EDEFAULT;
356 case ProblemPackage.REFERENCE_DECLARATION__MULTIPLICITY:
357 return multiplicity != null;
358 }
359 return super.eIsSet(featureID);
360 }
361
362 /**
363 * <!-- begin-user-doc -->
364 * <!-- end-user-doc -->
365 * @generated
366 */
367 @Override
368 public String toString() {
369 if (eIsProxy())
370 return super.toString();
371
372 StringBuilder result = new StringBuilder(super.toString());
373 result.append(" (containment: ");
374 result.append(containment);
375 result.append(')');
376 return result.toString();
377 }
378
379} //ReferenceDeclarationImpl