diff options
author | 2021-06-27 14:22:40 +0200 | |
---|---|---|
committer | 2021-06-27 14:22:40 +0200 | |
commit | 07719e927f9d398765e661c84fd8778cefb39083 (patch) | |
tree | 9652080f7e580f09a0763a3e258348dea6e02684 /language-model/src/main/emf-gen/org/eclipse/viatra/solver/language/model/problem/impl/AtomImpl.java | |
parent | Add enum support (diff) | |
download | refinery-07719e927f9d398765e661c84fd8778cefb39083.tar.gz refinery-07719e927f9d398765e661c84fd8778cefb39083.tar.zst refinery-07719e927f9d398765e661c84fd8778cefb39083.zip |
Simplify project layout
Diffstat (limited to 'language-model/src/main/emf-gen/org/eclipse/viatra/solver/language/model/problem/impl/AtomImpl.java')
-rw-r--r-- | language-model/src/main/emf-gen/org/eclipse/viatra/solver/language/model/problem/impl/AtomImpl.java | 286 |
1 files changed, 286 insertions, 0 deletions
diff --git a/language-model/src/main/emf-gen/org/eclipse/viatra/solver/language/model/problem/impl/AtomImpl.java b/language-model/src/main/emf-gen/org/eclipse/viatra/solver/language/model/problem/impl/AtomImpl.java new file mode 100644 index 00000000..d70fe90b --- /dev/null +++ b/language-model/src/main/emf-gen/org/eclipse/viatra/solver/language/model/problem/impl/AtomImpl.java | |||
@@ -0,0 +1,286 @@ | |||
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.notify.NotificationChain; | ||
10 | import org.eclipse.emf.common.util.EList; | ||
11 | |||
12 | import org.eclipse.emf.ecore.EClass; | ||
13 | import org.eclipse.emf.ecore.InternalEObject; | ||
14 | |||
15 | import org.eclipse.emf.ecore.impl.ENotificationImpl; | ||
16 | |||
17 | import org.eclipse.emf.ecore.util.EObjectContainmentEList; | ||
18 | import org.eclipse.emf.ecore.util.InternalEList; | ||
19 | import org.eclipse.viatra.solver.language.model.problem.Argument; | ||
20 | import org.eclipse.viatra.solver.language.model.problem.Atom; | ||
21 | import org.eclipse.viatra.solver.language.model.problem.ProblemPackage; | ||
22 | import org.eclipse.viatra.solver.language.model.problem.Relation; | ||
23 | |||
24 | /** | ||
25 | * <!-- begin-user-doc --> | ||
26 | * An implementation of the model object '<em><b>Atom</b></em>'. | ||
27 | * <!-- end-user-doc --> | ||
28 | * <p> | ||
29 | * The following features are implemented: | ||
30 | * </p> | ||
31 | * <ul> | ||
32 | * <li>{@link org.eclipse.viatra.solver.language.model.problem.impl.AtomImpl#getRelation <em>Relation</em>}</li> | ||
33 | * <li>{@link org.eclipse.viatra.solver.language.model.problem.impl.AtomImpl#isTransitiveClosure <em>Transitive Closure</em>}</li> | ||
34 | * <li>{@link org.eclipse.viatra.solver.language.model.problem.impl.AtomImpl#getArguments <em>Arguments</em>}</li> | ||
35 | * </ul> | ||
36 | * | ||
37 | * @generated | ||
38 | */ | ||
39 | public class AtomImpl extends LiteralImpl implements Atom { | ||
40 | /** | ||
41 | * The cached value of the '{@link #getRelation() <em>Relation</em>}' reference. | ||
42 | * <!-- begin-user-doc --> | ||
43 | * <!-- end-user-doc --> | ||
44 | * @see #getRelation() | ||
45 | * @generated | ||
46 | * @ordered | ||
47 | */ | ||
48 | protected Relation relation; | ||
49 | |||
50 | /** | ||
51 | * The default value of the '{@link #isTransitiveClosure() <em>Transitive Closure</em>}' attribute. | ||
52 | * <!-- begin-user-doc --> | ||
53 | * <!-- end-user-doc --> | ||
54 | * @see #isTransitiveClosure() | ||
55 | * @generated | ||
56 | * @ordered | ||
57 | */ | ||
58 | protected static final boolean TRANSITIVE_CLOSURE_EDEFAULT = false; | ||
59 | |||
60 | /** | ||
61 | * The cached value of the '{@link #isTransitiveClosure() <em>Transitive Closure</em>}' attribute. | ||
62 | * <!-- begin-user-doc --> | ||
63 | * <!-- end-user-doc --> | ||
64 | * @see #isTransitiveClosure() | ||
65 | * @generated | ||
66 | * @ordered | ||
67 | */ | ||
68 | protected boolean transitiveClosure = TRANSITIVE_CLOSURE_EDEFAULT; | ||
69 | |||
70 | /** | ||
71 | * The cached value of the '{@link #getArguments() <em>Arguments</em>}' containment reference list. | ||
72 | * <!-- begin-user-doc --> | ||
73 | * <!-- end-user-doc --> | ||
74 | * @see #getArguments() | ||
75 | * @generated | ||
76 | * @ordered | ||
77 | */ | ||
78 | protected EList<Argument> arguments; | ||
79 | |||
80 | /** | ||
81 | * <!-- begin-user-doc --> | ||
82 | * <!-- end-user-doc --> | ||
83 | * @generated | ||
84 | */ | ||
85 | protected AtomImpl() { | ||
86 | super(); | ||
87 | } | ||
88 | |||
89 | /** | ||
90 | * <!-- begin-user-doc --> | ||
91 | * <!-- end-user-doc --> | ||
92 | * @generated | ||
93 | */ | ||
94 | @Override | ||
95 | protected EClass eStaticClass() { | ||
96 | return ProblemPackage.Literals.ATOM; | ||
97 | } | ||
98 | |||
99 | /** | ||
100 | * <!-- begin-user-doc --> | ||
101 | * <!-- end-user-doc --> | ||
102 | * @generated | ||
103 | */ | ||
104 | public Relation getRelation() { | ||
105 | if (relation != null && relation.eIsProxy()) { | ||
106 | InternalEObject oldRelation = (InternalEObject) relation; | ||
107 | relation = (Relation) eResolveProxy(oldRelation); | ||
108 | if (relation != oldRelation) { | ||
109 | if (eNotificationRequired()) | ||
110 | eNotify(new ENotificationImpl(this, Notification.RESOLVE, ProblemPackage.ATOM__RELATION, | ||
111 | oldRelation, relation)); | ||
112 | } | ||
113 | } | ||
114 | return relation; | ||
115 | } | ||
116 | |||
117 | /** | ||
118 | * <!-- begin-user-doc --> | ||
119 | * <!-- end-user-doc --> | ||
120 | * @generated | ||
121 | */ | ||
122 | public Relation basicGetRelation() { | ||
123 | return relation; | ||
124 | } | ||
125 | |||
126 | /** | ||
127 | * <!-- begin-user-doc --> | ||
128 | * <!-- end-user-doc --> | ||
129 | * @generated | ||
130 | */ | ||
131 | public void setRelation(Relation newRelation) { | ||
132 | Relation oldRelation = relation; | ||
133 | relation = newRelation; | ||
134 | if (eNotificationRequired()) | ||
135 | eNotify(new ENotificationImpl(this, Notification.SET, ProblemPackage.ATOM__RELATION, oldRelation, | ||
136 | relation)); | ||
137 | } | ||
138 | |||
139 | /** | ||
140 | * <!-- begin-user-doc --> | ||
141 | * <!-- end-user-doc --> | ||
142 | * @generated | ||
143 | */ | ||
144 | public EList<Argument> getArguments() { | ||
145 | if (arguments == null) { | ||
146 | arguments = new EObjectContainmentEList<Argument>(Argument.class, this, ProblemPackage.ATOM__ARGUMENTS); | ||
147 | } | ||
148 | return arguments; | ||
149 | } | ||
150 | |||
151 | /** | ||
152 | * <!-- begin-user-doc --> | ||
153 | * <!-- end-user-doc --> | ||
154 | * @generated | ||
155 | */ | ||
156 | public boolean isTransitiveClosure() { | ||
157 | return transitiveClosure; | ||
158 | } | ||
159 | |||
160 | /** | ||
161 | * <!-- begin-user-doc --> | ||
162 | * <!-- end-user-doc --> | ||
163 | * @generated | ||
164 | */ | ||
165 | public void setTransitiveClosure(boolean newTransitiveClosure) { | ||
166 | boolean oldTransitiveClosure = transitiveClosure; | ||
167 | transitiveClosure = newTransitiveClosure; | ||
168 | if (eNotificationRequired()) | ||
169 | eNotify(new ENotificationImpl(this, Notification.SET, ProblemPackage.ATOM__TRANSITIVE_CLOSURE, | ||
170 | oldTransitiveClosure, transitiveClosure)); | ||
171 | } | ||
172 | |||
173 | /** | ||
174 | * <!-- begin-user-doc --> | ||
175 | * <!-- end-user-doc --> | ||
176 | * @generated | ||
177 | */ | ||
178 | @Override | ||
179 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | ||
180 | switch (featureID) { | ||
181 | case ProblemPackage.ATOM__ARGUMENTS: | ||
182 | return ((InternalEList<?>) getArguments()).basicRemove(otherEnd, msgs); | ||
183 | } | ||
184 | return super.eInverseRemove(otherEnd, featureID, msgs); | ||
185 | } | ||
186 | |||
187 | /** | ||
188 | * <!-- begin-user-doc --> | ||
189 | * <!-- end-user-doc --> | ||
190 | * @generated | ||
191 | */ | ||
192 | @Override | ||
193 | public Object eGet(int featureID, boolean resolve, boolean coreType) { | ||
194 | switch (featureID) { | ||
195 | case ProblemPackage.ATOM__RELATION: | ||
196 | if (resolve) | ||
197 | return getRelation(); | ||
198 | return basicGetRelation(); | ||
199 | case ProblemPackage.ATOM__TRANSITIVE_CLOSURE: | ||
200 | return isTransitiveClosure(); | ||
201 | case ProblemPackage.ATOM__ARGUMENTS: | ||
202 | return getArguments(); | ||
203 | } | ||
204 | return super.eGet(featureID, resolve, coreType); | ||
205 | } | ||
206 | |||
207 | /** | ||
208 | * <!-- begin-user-doc --> | ||
209 | * <!-- end-user-doc --> | ||
210 | * @generated | ||
211 | */ | ||
212 | @SuppressWarnings("unchecked") | ||
213 | @Override | ||
214 | public void eSet(int featureID, Object newValue) { | ||
215 | switch (featureID) { | ||
216 | case ProblemPackage.ATOM__RELATION: | ||
217 | setRelation((Relation) newValue); | ||
218 | return; | ||
219 | case ProblemPackage.ATOM__TRANSITIVE_CLOSURE: | ||
220 | setTransitiveClosure((Boolean) newValue); | ||
221 | return; | ||
222 | case ProblemPackage.ATOM__ARGUMENTS: | ||
223 | getArguments().clear(); | ||
224 | getArguments().addAll((Collection<? extends Argument>) newValue); | ||
225 | return; | ||
226 | } | ||
227 | super.eSet(featureID, newValue); | ||
228 | } | ||
229 | |||
230 | /** | ||
231 | * <!-- begin-user-doc --> | ||
232 | * <!-- end-user-doc --> | ||
233 | * @generated | ||
234 | */ | ||
235 | @Override | ||
236 | public void eUnset(int featureID) { | ||
237 | switch (featureID) { | ||
238 | case ProblemPackage.ATOM__RELATION: | ||
239 | setRelation((Relation) null); | ||
240 | return; | ||
241 | case ProblemPackage.ATOM__TRANSITIVE_CLOSURE: | ||
242 | setTransitiveClosure(TRANSITIVE_CLOSURE_EDEFAULT); | ||
243 | return; | ||
244 | case ProblemPackage.ATOM__ARGUMENTS: | ||
245 | getArguments().clear(); | ||
246 | return; | ||
247 | } | ||
248 | super.eUnset(featureID); | ||
249 | } | ||
250 | |||
251 | /** | ||
252 | * <!-- begin-user-doc --> | ||
253 | * <!-- end-user-doc --> | ||
254 | * @generated | ||
255 | */ | ||
256 | @Override | ||
257 | public boolean eIsSet(int featureID) { | ||
258 | switch (featureID) { | ||
259 | case ProblemPackage.ATOM__RELATION: | ||
260 | return relation != null; | ||
261 | case ProblemPackage.ATOM__TRANSITIVE_CLOSURE: | ||
262 | return transitiveClosure != TRANSITIVE_CLOSURE_EDEFAULT; | ||
263 | case ProblemPackage.ATOM__ARGUMENTS: | ||
264 | return arguments != null && !arguments.isEmpty(); | ||
265 | } | ||
266 | return super.eIsSet(featureID); | ||
267 | } | ||
268 | |||
269 | /** | ||
270 | * <!-- begin-user-doc --> | ||
271 | * <!-- end-user-doc --> | ||
272 | * @generated | ||
273 | */ | ||
274 | @Override | ||
275 | public String toString() { | ||
276 | if (eIsProxy()) | ||
277 | return super.toString(); | ||
278 | |||
279 | StringBuilder result = new StringBuilder(super.toString()); | ||
280 | result.append(" (transitiveClosure: "); | ||
281 | result.append(transitiveClosure); | ||
282 | result.append(')'); | ||
283 | return result.toString(); | ||
284 | } | ||
285 | |||
286 | } //AtomImpl | ||