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