diff options
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/AssertionImpl.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/AssertionImpl.java | 272 |
1 files changed, 272 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/AssertionImpl.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/AssertionImpl.java new file mode 100644 index 00000000..5856a276 --- /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/AssertionImpl.java | |||
@@ -0,0 +1,272 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package org.eclipse.viatra.solver.language.model.problem.impl; | ||
4 | |||
5 | import java.util.Collection; | ||
6 | |||
7 | import org.eclipse.emf.common.notify.Notification; | ||
8 | |||
9 | import org.eclipse.emf.common.util.EList; | ||
10 | |||
11 | import org.eclipse.emf.ecore.EClass; | ||
12 | import org.eclipse.emf.ecore.InternalEObject; | ||
13 | |||
14 | import org.eclipse.emf.ecore.impl.ENotificationImpl; | ||
15 | import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; | ||
16 | |||
17 | import org.eclipse.emf.ecore.util.EObjectResolvingEList; | ||
18 | |||
19 | import org.eclipse.viatra.solver.language.model.problem.Assertion; | ||
20 | import org.eclipse.viatra.solver.language.model.problem.LogicValue; | ||
21 | import org.eclipse.viatra.solver.language.model.problem.Node; | ||
22 | import org.eclipse.viatra.solver.language.model.problem.ProblemPackage; | ||
23 | import org.eclipse.viatra.solver.language.model.problem.Relation; | ||
24 | |||
25 | /** | ||
26 | * <!-- begin-user-doc --> | ||
27 | * An implementation of the model object '<em><b>Assertion</b></em>'. | ||
28 | * <!-- end-user-doc --> | ||
29 | * <p> | ||
30 | * The following features are implemented: | ||
31 | * </p> | ||
32 | * <ul> | ||
33 | * <li>{@link org.eclipse.viatra.solver.language.model.problem.impl.AssertionImpl#getRelation <em>Relation</em>}</li> | ||
34 | * <li>{@link org.eclipse.viatra.solver.language.model.problem.impl.AssertionImpl#getArguments <em>Arguments</em>}</li> | ||
35 | * <li>{@link org.eclipse.viatra.solver.language.model.problem.impl.AssertionImpl#getValue <em>Value</em>}</li> | ||
36 | * </ul> | ||
37 | * | ||
38 | * @generated | ||
39 | */ | ||
40 | public class AssertionImpl extends MinimalEObjectImpl.Container implements Assertion { | ||
41 | /** | ||
42 | * The cached value of the '{@link #getRelation() <em>Relation</em>}' reference. | ||
43 | * <!-- begin-user-doc --> | ||
44 | * <!-- end-user-doc --> | ||
45 | * @see #getRelation() | ||
46 | * @generated | ||
47 | * @ordered | ||
48 | */ | ||
49 | protected Relation relation; | ||
50 | |||
51 | /** | ||
52 | * The cached value of the '{@link #getArguments() <em>Arguments</em>}' reference list. | ||
53 | * <!-- begin-user-doc --> | ||
54 | * <!-- end-user-doc --> | ||
55 | * @see #getArguments() | ||
56 | * @generated | ||
57 | * @ordered | ||
58 | */ | ||
59 | protected EList<Node> arguments; | ||
60 | |||
61 | /** | ||
62 | * The default value of the '{@link #getValue() <em>Value</em>}' attribute. | ||
63 | * <!-- begin-user-doc --> | ||
64 | * <!-- end-user-doc --> | ||
65 | * @see #getValue() | ||
66 | * @generated | ||
67 | * @ordered | ||
68 | */ | ||
69 | protected static final LogicValue VALUE_EDEFAULT = LogicValue.TRUE; | ||
70 | |||
71 | /** | ||
72 | * The cached value of the '{@link #getValue() <em>Value</em>}' attribute. | ||
73 | * <!-- begin-user-doc --> | ||
74 | * <!-- end-user-doc --> | ||
75 | * @see #getValue() | ||
76 | * @generated | ||
77 | * @ordered | ||
78 | */ | ||
79 | protected LogicValue value = VALUE_EDEFAULT; | ||
80 | |||
81 | /** | ||
82 | * <!-- begin-user-doc --> | ||
83 | * <!-- end-user-doc --> | ||
84 | * @generated | ||
85 | */ | ||
86 | protected AssertionImpl() { | ||
87 | super(); | ||
88 | } | ||
89 | |||
90 | /** | ||
91 | * <!-- begin-user-doc --> | ||
92 | * <!-- end-user-doc --> | ||
93 | * @generated | ||
94 | */ | ||
95 | @Override | ||
96 | protected EClass eStaticClass() { | ||
97 | return ProblemPackage.Literals.ASSERTION; | ||
98 | } | ||
99 | |||
100 | /** | ||
101 | * <!-- begin-user-doc --> | ||
102 | * <!-- end-user-doc --> | ||
103 | * @generated | ||
104 | */ | ||
105 | public Relation getRelation() { | ||
106 | if (relation != null && relation.eIsProxy()) { | ||
107 | InternalEObject oldRelation = (InternalEObject) relation; | ||
108 | relation = (Relation) eResolveProxy(oldRelation); | ||
109 | if (relation != oldRelation) { | ||
110 | if (eNotificationRequired()) | ||
111 | eNotify(new ENotificationImpl(this, Notification.RESOLVE, ProblemPackage.ASSERTION__RELATION, | ||
112 | oldRelation, relation)); | ||
113 | } | ||
114 | } | ||
115 | return relation; | ||
116 | } | ||
117 | |||
118 | /** | ||
119 | * <!-- begin-user-doc --> | ||
120 | * <!-- end-user-doc --> | ||
121 | * @generated | ||
122 | */ | ||
123 | public Relation basicGetRelation() { | ||
124 | return relation; | ||
125 | } | ||
126 | |||
127 | /** | ||
128 | * <!-- begin-user-doc --> | ||
129 | * <!-- end-user-doc --> | ||
130 | * @generated | ||
131 | */ | ||
132 | public void setRelation(Relation newRelation) { | ||
133 | Relation oldRelation = relation; | ||
134 | relation = newRelation; | ||
135 | if (eNotificationRequired()) | ||
136 | eNotify(new ENotificationImpl(this, Notification.SET, ProblemPackage.ASSERTION__RELATION, oldRelation, | ||
137 | relation)); | ||
138 | } | ||
139 | |||
140 | /** | ||
141 | * <!-- begin-user-doc --> | ||
142 | * <!-- end-user-doc --> | ||
143 | * @generated | ||
144 | */ | ||
145 | public EList<Node> getArguments() { | ||
146 | if (arguments == null) { | ||
147 | arguments = new EObjectResolvingEList<Node>(Node.class, this, ProblemPackage.ASSERTION__ARGUMENTS); | ||
148 | } | ||
149 | return arguments; | ||
150 | } | ||
151 | |||
152 | /** | ||
153 | * <!-- begin-user-doc --> | ||
154 | * <!-- end-user-doc --> | ||
155 | * @generated | ||
156 | */ | ||
157 | public LogicValue getValue() { | ||
158 | return value; | ||
159 | } | ||
160 | |||
161 | /** | ||
162 | * <!-- begin-user-doc --> | ||
163 | * <!-- end-user-doc --> | ||
164 | * @generated | ||
165 | */ | ||
166 | public void setValue(LogicValue newValue) { | ||
167 | LogicValue oldValue = value; | ||
168 | value = newValue == null ? VALUE_EDEFAULT : newValue; | ||
169 | if (eNotificationRequired()) | ||
170 | eNotify(new ENotificationImpl(this, Notification.SET, ProblemPackage.ASSERTION__VALUE, oldValue, value)); | ||
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 ProblemPackage.ASSERTION__RELATION: | ||
182 | if (resolve) | ||
183 | return getRelation(); | ||
184 | return basicGetRelation(); | ||
185 | case ProblemPackage.ASSERTION__ARGUMENTS: | ||
186 | return getArguments(); | ||
187 | case ProblemPackage.ASSERTION__VALUE: | ||
188 | return getValue(); | ||
189 | } | ||
190 | return super.eGet(featureID, resolve, coreType); | ||
191 | } | ||
192 | |||
193 | /** | ||
194 | * <!-- begin-user-doc --> | ||
195 | * <!-- end-user-doc --> | ||
196 | * @generated | ||
197 | */ | ||
198 | @SuppressWarnings("unchecked") | ||
199 | @Override | ||
200 | public void eSet(int featureID, Object newValue) { | ||
201 | switch (featureID) { | ||
202 | case ProblemPackage.ASSERTION__RELATION: | ||
203 | setRelation((Relation) newValue); | ||
204 | return; | ||
205 | case ProblemPackage.ASSERTION__ARGUMENTS: | ||
206 | getArguments().clear(); | ||
207 | getArguments().addAll((Collection<? extends Node>) newValue); | ||
208 | return; | ||
209 | case ProblemPackage.ASSERTION__VALUE: | ||
210 | setValue((LogicValue) newValue); | ||
211 | return; | ||
212 | } | ||
213 | super.eSet(featureID, newValue); | ||
214 | } | ||
215 | |||
216 | /** | ||
217 | * <!-- begin-user-doc --> | ||
218 | * <!-- end-user-doc --> | ||
219 | * @generated | ||
220 | */ | ||
221 | @Override | ||
222 | public void eUnset(int featureID) { | ||
223 | switch (featureID) { | ||
224 | case ProblemPackage.ASSERTION__RELATION: | ||
225 | setRelation((Relation) null); | ||
226 | return; | ||
227 | case ProblemPackage.ASSERTION__ARGUMENTS: | ||
228 | getArguments().clear(); | ||
229 | return; | ||
230 | case ProblemPackage.ASSERTION__VALUE: | ||
231 | setValue(VALUE_EDEFAULT); | ||
232 | return; | ||
233 | } | ||
234 | super.eUnset(featureID); | ||
235 | } | ||
236 | |||
237 | /** | ||
238 | * <!-- begin-user-doc --> | ||
239 | * <!-- end-user-doc --> | ||
240 | * @generated | ||
241 | */ | ||
242 | @Override | ||
243 | public boolean eIsSet(int featureID) { | ||
244 | switch (featureID) { | ||
245 | case ProblemPackage.ASSERTION__RELATION: | ||
246 | return relation != null; | ||
247 | case ProblemPackage.ASSERTION__ARGUMENTS: | ||
248 | return arguments != null && !arguments.isEmpty(); | ||
249 | case ProblemPackage.ASSERTION__VALUE: | ||
250 | return value != VALUE_EDEFAULT; | ||
251 | } | ||
252 | return super.eIsSet(featureID); | ||
253 | } | ||
254 | |||
255 | /** | ||
256 | * <!-- begin-user-doc --> | ||
257 | * <!-- end-user-doc --> | ||
258 | * @generated | ||
259 | */ | ||
260 | @Override | ||
261 | public String toString() { | ||
262 | if (eIsProxy()) | ||
263 | return super.toString(); | ||
264 | |||
265 | StringBuilder result = new StringBuilder(super.toString()); | ||
266 | result.append(" (value: "); | ||
267 | result.append(value); | ||
268 | result.append(')'); | ||
269 | return result.toString(); | ||
270 | } | ||
271 | |||
272 | } //AssertionImpl | ||