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