diff options
Diffstat (limited to 'Application/org.eclipse.viatra.solver.language/ecore-gen/org/eclipse/viatra/solver/language/solverLanguage/impl/UnaryExpressionImpl.java')
-rw-r--r-- | Application/org.eclipse.viatra.solver.language/ecore-gen/org/eclipse/viatra/solver/language/solverLanguage/impl/UnaryExpressionImpl.java | 249 |
1 files changed, 249 insertions, 0 deletions
diff --git a/Application/org.eclipse.viatra.solver.language/ecore-gen/org/eclipse/viatra/solver/language/solverLanguage/impl/UnaryExpressionImpl.java b/Application/org.eclipse.viatra.solver.language/ecore-gen/org/eclipse/viatra/solver/language/solverLanguage/impl/UnaryExpressionImpl.java new file mode 100644 index 00000000..a3a7b1dc --- /dev/null +++ b/Application/org.eclipse.viatra.solver.language/ecore-gen/org/eclipse/viatra/solver/language/solverLanguage/impl/UnaryExpressionImpl.java | |||
@@ -0,0 +1,249 @@ | |||
1 | /** | ||
2 | * generated by Xtext 2.21.0 | ||
3 | */ | ||
4 | package org.eclipse.viatra.solver.language.solverLanguage.impl; | ||
5 | |||
6 | import org.eclipse.emf.common.notify.Notification; | ||
7 | import org.eclipse.emf.common.notify.NotificationChain; | ||
8 | |||
9 | import org.eclipse.emf.ecore.EClass; | ||
10 | import org.eclipse.emf.ecore.InternalEObject; | ||
11 | |||
12 | import org.eclipse.emf.ecore.impl.ENotificationImpl; | ||
13 | |||
14 | import org.eclipse.viatra.solver.language.solverLanguage.Expression; | ||
15 | import org.eclipse.viatra.solver.language.solverLanguage.SolverLanguagePackage; | ||
16 | import org.eclipse.viatra.solver.language.solverLanguage.UnaryExpression; | ||
17 | import org.eclipse.viatra.solver.language.solverLanguage.UnaryOp; | ||
18 | |||
19 | /** | ||
20 | * <!-- begin-user-doc --> | ||
21 | * An implementation of the model object '<em><b>Unary Expression</b></em>'. | ||
22 | * <!-- end-user-doc --> | ||
23 | * <p> | ||
24 | * The following features are implemented: | ||
25 | * </p> | ||
26 | * <ul> | ||
27 | * <li>{@link org.eclipse.viatra.solver.language.solverLanguage.impl.UnaryExpressionImpl#getOp <em>Op</em>}</li> | ||
28 | * <li>{@link org.eclipse.viatra.solver.language.solverLanguage.impl.UnaryExpressionImpl#getBody <em>Body</em>}</li> | ||
29 | * </ul> | ||
30 | * | ||
31 | * @generated | ||
32 | */ | ||
33 | public class UnaryExpressionImpl extends ExpressionImpl implements UnaryExpression { | ||
34 | /** | ||
35 | * The default value of the '{@link #getOp() <em>Op</em>}' attribute. | ||
36 | * <!-- begin-user-doc --> | ||
37 | * <!-- end-user-doc --> | ||
38 | * @see #getOp() | ||
39 | * @generated | ||
40 | * @ordered | ||
41 | */ | ||
42 | protected static final UnaryOp OP_EDEFAULT = UnaryOp.NEG; | ||
43 | |||
44 | /** | ||
45 | * The cached value of the '{@link #getOp() <em>Op</em>}' attribute. | ||
46 | * <!-- begin-user-doc --> | ||
47 | * <!-- end-user-doc --> | ||
48 | * @see #getOp() | ||
49 | * @generated | ||
50 | * @ordered | ||
51 | */ | ||
52 | protected UnaryOp op = OP_EDEFAULT; | ||
53 | |||
54 | /** | ||
55 | * The cached value of the '{@link #getBody() <em>Body</em>}' containment reference. | ||
56 | * <!-- begin-user-doc --> | ||
57 | * <!-- end-user-doc --> | ||
58 | * @see #getBody() | ||
59 | * @generated | ||
60 | * @ordered | ||
61 | */ | ||
62 | protected Expression body; | ||
63 | |||
64 | /** | ||
65 | * <!-- begin-user-doc --> | ||
66 | * <!-- end-user-doc --> | ||
67 | * @generated | ||
68 | */ | ||
69 | protected UnaryExpressionImpl() { | ||
70 | super(); | ||
71 | } | ||
72 | |||
73 | /** | ||
74 | * <!-- begin-user-doc --> | ||
75 | * <!-- end-user-doc --> | ||
76 | * @generated | ||
77 | */ | ||
78 | @Override | ||
79 | protected EClass eStaticClass() { | ||
80 | return SolverLanguagePackage.Literals.UNARY_EXPRESSION; | ||
81 | } | ||
82 | |||
83 | /** | ||
84 | * <!-- begin-user-doc --> | ||
85 | * <!-- end-user-doc --> | ||
86 | * @generated | ||
87 | */ | ||
88 | @Override | ||
89 | public UnaryOp getOp() { | ||
90 | return op; | ||
91 | } | ||
92 | |||
93 | /** | ||
94 | * <!-- begin-user-doc --> | ||
95 | * <!-- end-user-doc --> | ||
96 | * @generated | ||
97 | */ | ||
98 | @Override | ||
99 | public void setOp(UnaryOp newOp) { | ||
100 | UnaryOp oldOp = op; | ||
101 | op = newOp == null ? OP_EDEFAULT : newOp; | ||
102 | if (eNotificationRequired()) | ||
103 | eNotify(new ENotificationImpl(this, Notification.SET, SolverLanguagePackage.UNARY_EXPRESSION__OP, oldOp, op)); | ||
104 | } | ||
105 | |||
106 | /** | ||
107 | * <!-- begin-user-doc --> | ||
108 | * <!-- end-user-doc --> | ||
109 | * @generated | ||
110 | */ | ||
111 | @Override | ||
112 | public Expression getBody() { | ||
113 | return body; | ||
114 | } | ||
115 | |||
116 | /** | ||
117 | * <!-- begin-user-doc --> | ||
118 | * <!-- end-user-doc --> | ||
119 | * @generated | ||
120 | */ | ||
121 | public NotificationChain basicSetBody(Expression newBody, NotificationChain msgs) { | ||
122 | Expression oldBody = body; | ||
123 | body = newBody; | ||
124 | if (eNotificationRequired()) { | ||
125 | ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SolverLanguagePackage.UNARY_EXPRESSION__BODY, oldBody, newBody); | ||
126 | if (msgs == null) msgs = notification; else msgs.add(notification); | ||
127 | } | ||
128 | return msgs; | ||
129 | } | ||
130 | |||
131 | /** | ||
132 | * <!-- begin-user-doc --> | ||
133 | * <!-- end-user-doc --> | ||
134 | * @generated | ||
135 | */ | ||
136 | @Override | ||
137 | public void setBody(Expression newBody) { | ||
138 | if (newBody != body) { | ||
139 | NotificationChain msgs = null; | ||
140 | if (body != null) | ||
141 | msgs = ((InternalEObject)body).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - SolverLanguagePackage.UNARY_EXPRESSION__BODY, null, msgs); | ||
142 | if (newBody != null) | ||
143 | msgs = ((InternalEObject)newBody).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - SolverLanguagePackage.UNARY_EXPRESSION__BODY, null, msgs); | ||
144 | msgs = basicSetBody(newBody, msgs); | ||
145 | if (msgs != null) msgs.dispatch(); | ||
146 | } | ||
147 | else if (eNotificationRequired()) | ||
148 | eNotify(new ENotificationImpl(this, Notification.SET, SolverLanguagePackage.UNARY_EXPRESSION__BODY, newBody, newBody)); | ||
149 | } | ||
150 | |||
151 | /** | ||
152 | * <!-- begin-user-doc --> | ||
153 | * <!-- end-user-doc --> | ||
154 | * @generated | ||
155 | */ | ||
156 | @Override | ||
157 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | ||
158 | switch (featureID) { | ||
159 | case SolverLanguagePackage.UNARY_EXPRESSION__BODY: | ||
160 | return basicSetBody(null, msgs); | ||
161 | } | ||
162 | return super.eInverseRemove(otherEnd, featureID, msgs); | ||
163 | } | ||
164 | |||
165 | /** | ||
166 | * <!-- begin-user-doc --> | ||
167 | * <!-- end-user-doc --> | ||
168 | * @generated | ||
169 | */ | ||
170 | @Override | ||
171 | public Object eGet(int featureID, boolean resolve, boolean coreType) { | ||
172 | switch (featureID) { | ||
173 | case SolverLanguagePackage.UNARY_EXPRESSION__OP: | ||
174 | return getOp(); | ||
175 | case SolverLanguagePackage.UNARY_EXPRESSION__BODY: | ||
176 | return getBody(); | ||
177 | } | ||
178 | return super.eGet(featureID, resolve, coreType); | ||
179 | } | ||
180 | |||
181 | /** | ||
182 | * <!-- begin-user-doc --> | ||
183 | * <!-- end-user-doc --> | ||
184 | * @generated | ||
185 | */ | ||
186 | @Override | ||
187 | public void eSet(int featureID, Object newValue) { | ||
188 | switch (featureID) { | ||
189 | case SolverLanguagePackage.UNARY_EXPRESSION__OP: | ||
190 | setOp((UnaryOp)newValue); | ||
191 | return; | ||
192 | case SolverLanguagePackage.UNARY_EXPRESSION__BODY: | ||
193 | setBody((Expression)newValue); | ||
194 | return; | ||
195 | } | ||
196 | super.eSet(featureID, newValue); | ||
197 | } | ||
198 | |||
199 | /** | ||
200 | * <!-- begin-user-doc --> | ||
201 | * <!-- end-user-doc --> | ||
202 | * @generated | ||
203 | */ | ||
204 | @Override | ||
205 | public void eUnset(int featureID) { | ||
206 | switch (featureID) { | ||
207 | case SolverLanguagePackage.UNARY_EXPRESSION__OP: | ||
208 | setOp(OP_EDEFAULT); | ||
209 | return; | ||
210 | case SolverLanguagePackage.UNARY_EXPRESSION__BODY: | ||
211 | setBody((Expression)null); | ||
212 | return; | ||
213 | } | ||
214 | super.eUnset(featureID); | ||
215 | } | ||
216 | |||
217 | /** | ||
218 | * <!-- begin-user-doc --> | ||
219 | * <!-- end-user-doc --> | ||
220 | * @generated | ||
221 | */ | ||
222 | @Override | ||
223 | public boolean eIsSet(int featureID) { | ||
224 | switch (featureID) { | ||
225 | case SolverLanguagePackage.UNARY_EXPRESSION__OP: | ||
226 | return op != OP_EDEFAULT; | ||
227 | case SolverLanguagePackage.UNARY_EXPRESSION__BODY: | ||
228 | return body != null; | ||
229 | } | ||
230 | return super.eIsSet(featureID); | ||
231 | } | ||
232 | |||
233 | /** | ||
234 | * <!-- begin-user-doc --> | ||
235 | * <!-- end-user-doc --> | ||
236 | * @generated | ||
237 | */ | ||
238 | @Override | ||
239 | public String toString() { | ||
240 | if (eIsProxy()) return super.toString(); | ||
241 | |||
242 | StringBuilder result = new StringBuilder(super.toString()); | ||
243 | result.append(" (op: "); | ||
244 | result.append(op); | ||
245 | result.append(')'); | ||
246 | return result.toString(); | ||
247 | } | ||
248 | |||
249 | } //UnaryExpressionImpl | ||