diff options
author | Kristóf Marussy <kristof@marussy.com> | 2021-06-25 17:12:45 +0200 |
---|---|---|
committer | Kristóf Marussy <kristof@marussy.com> | 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/NegativeLiteralImpl.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/NegativeLiteralImpl.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/NegativeLiteralImpl.java | 228 |
1 files changed, 228 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/NegativeLiteralImpl.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/NegativeLiteralImpl.java new file mode 100644 index 00000000..5295406b --- /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/NegativeLiteralImpl.java | |||
@@ -0,0 +1,228 @@ | |||
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 | import org.eclipse.emf.common.notify.NotificationChain; | ||
9 | |||
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 | import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; | ||
17 | |||
18 | import org.eclipse.emf.ecore.util.EObjectContainmentEList; | ||
19 | import org.eclipse.emf.ecore.util.InternalEList; | ||
20 | |||
21 | import org.eclipse.viatra.solver.language.model.problem.Atom; | ||
22 | import org.eclipse.viatra.solver.language.model.problem.ImplicitVariable; | ||
23 | import org.eclipse.viatra.solver.language.model.problem.NegativeLiteral; | ||
24 | import org.eclipse.viatra.solver.language.model.problem.ProblemPackage; | ||
25 | |||
26 | /** | ||
27 | * <!-- begin-user-doc --> | ||
28 | * An implementation of the model object '<em><b>Negative Literal</b></em>'. | ||
29 | * <!-- end-user-doc --> | ||
30 | * <p> | ||
31 | * The following features are implemented: | ||
32 | * </p> | ||
33 | * <ul> | ||
34 | * <li>{@link org.eclipse.viatra.solver.language.model.problem.impl.NegativeLiteralImpl#getImplicitVariables <em>Implicit Variables</em>}</li> | ||
35 | * <li>{@link org.eclipse.viatra.solver.language.model.problem.impl.NegativeLiteralImpl#getAtom <em>Atom</em>}</li> | ||
36 | * </ul> | ||
37 | * | ||
38 | * @generated | ||
39 | */ | ||
40 | public class NegativeLiteralImpl extends MinimalEObjectImpl.Container implements NegativeLiteral { | ||
41 | /** | ||
42 | * The cached value of the '{@link #getImplicitVariables() <em>Implicit Variables</em>}' containment reference list. | ||
43 | * <!-- begin-user-doc --> | ||
44 | * <!-- end-user-doc --> | ||
45 | * @see #getImplicitVariables() | ||
46 | * @generated | ||
47 | * @ordered | ||
48 | */ | ||
49 | protected EList<ImplicitVariable> implicitVariables; | ||
50 | /** | ||
51 | * The cached value of the '{@link #getAtom() <em>Atom</em>}' containment reference. | ||
52 | * <!-- begin-user-doc --> | ||
53 | * <!-- end-user-doc --> | ||
54 | * @see #getAtom() | ||
55 | * @generated | ||
56 | * @ordered | ||
57 | */ | ||
58 | protected Atom atom; | ||
59 | |||
60 | /** | ||
61 | * <!-- begin-user-doc --> | ||
62 | * <!-- end-user-doc --> | ||
63 | * @generated | ||
64 | */ | ||
65 | protected NegativeLiteralImpl() { | ||
66 | super(); | ||
67 | } | ||
68 | |||
69 | /** | ||
70 | * <!-- begin-user-doc --> | ||
71 | * <!-- end-user-doc --> | ||
72 | * @generated | ||
73 | */ | ||
74 | @Override | ||
75 | protected EClass eStaticClass() { | ||
76 | return ProblemPackage.Literals.NEGATIVE_LITERAL; | ||
77 | } | ||
78 | |||
79 | /** | ||
80 | * <!-- begin-user-doc --> | ||
81 | * <!-- end-user-doc --> | ||
82 | * @generated | ||
83 | */ | ||
84 | public EList<ImplicitVariable> getImplicitVariables() { | ||
85 | if (implicitVariables == null) { | ||
86 | implicitVariables = new EObjectContainmentEList<ImplicitVariable>(ImplicitVariable.class, this, | ||
87 | ProblemPackage.NEGATIVE_LITERAL__IMPLICIT_VARIABLES); | ||
88 | } | ||
89 | return implicitVariables; | ||
90 | } | ||
91 | |||
92 | /** | ||
93 | * <!-- begin-user-doc --> | ||
94 | * <!-- end-user-doc --> | ||
95 | * @generated | ||
96 | */ | ||
97 | public Atom getAtom() { | ||
98 | return atom; | ||
99 | } | ||
100 | |||
101 | /** | ||
102 | * <!-- begin-user-doc --> | ||
103 | * <!-- end-user-doc --> | ||
104 | * @generated | ||
105 | */ | ||
106 | public NotificationChain basicSetAtom(Atom newAtom, NotificationChain msgs) { | ||
107 | Atom oldAtom = atom; | ||
108 | atom = newAtom; | ||
109 | if (eNotificationRequired()) { | ||
110 | ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, | ||
111 | ProblemPackage.NEGATIVE_LITERAL__ATOM, oldAtom, newAtom); | ||
112 | if (msgs == null) | ||
113 | msgs = notification; | ||
114 | else | ||
115 | msgs.add(notification); | ||
116 | } | ||
117 | return msgs; | ||
118 | } | ||
119 | |||
120 | /** | ||
121 | * <!-- begin-user-doc --> | ||
122 | * <!-- end-user-doc --> | ||
123 | * @generated | ||
124 | */ | ||
125 | public void setAtom(Atom newAtom) { | ||
126 | if (newAtom != atom) { | ||
127 | NotificationChain msgs = null; | ||
128 | if (atom != null) | ||
129 | msgs = ((InternalEObject) atom).eInverseRemove(this, | ||
130 | EOPPOSITE_FEATURE_BASE - ProblemPackage.NEGATIVE_LITERAL__ATOM, null, msgs); | ||
131 | if (newAtom != null) | ||
132 | msgs = ((InternalEObject) newAtom).eInverseAdd(this, | ||
133 | EOPPOSITE_FEATURE_BASE - ProblemPackage.NEGATIVE_LITERAL__ATOM, null, msgs); | ||
134 | msgs = basicSetAtom(newAtom, msgs); | ||
135 | if (msgs != null) | ||
136 | msgs.dispatch(); | ||
137 | } else if (eNotificationRequired()) | ||
138 | eNotify(new ENotificationImpl(this, Notification.SET, ProblemPackage.NEGATIVE_LITERAL__ATOM, newAtom, | ||
139 | newAtom)); | ||
140 | } | ||
141 | |||
142 | /** | ||
143 | * <!-- begin-user-doc --> | ||
144 | * <!-- end-user-doc --> | ||
145 | * @generated | ||
146 | */ | ||
147 | @Override | ||
148 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | ||
149 | switch (featureID) { | ||
150 | case ProblemPackage.NEGATIVE_LITERAL__IMPLICIT_VARIABLES: | ||
151 | return ((InternalEList<?>) getImplicitVariables()).basicRemove(otherEnd, msgs); | ||
152 | case ProblemPackage.NEGATIVE_LITERAL__ATOM: | ||
153 | return basicSetAtom(null, msgs); | ||
154 | } | ||
155 | return super.eInverseRemove(otherEnd, featureID, msgs); | ||
156 | } | ||
157 | |||
158 | /** | ||
159 | * <!-- begin-user-doc --> | ||
160 | * <!-- end-user-doc --> | ||
161 | * @generated | ||
162 | */ | ||
163 | @Override | ||
164 | public Object eGet(int featureID, boolean resolve, boolean coreType) { | ||
165 | switch (featureID) { | ||
166 | case ProblemPackage.NEGATIVE_LITERAL__IMPLICIT_VARIABLES: | ||
167 | return getImplicitVariables(); | ||
168 | case ProblemPackage.NEGATIVE_LITERAL__ATOM: | ||
169 | return getAtom(); | ||
170 | } | ||
171 | return super.eGet(featureID, resolve, coreType); | ||
172 | } | ||
173 | |||
174 | /** | ||
175 | * <!-- begin-user-doc --> | ||
176 | * <!-- end-user-doc --> | ||
177 | * @generated | ||
178 | */ | ||
179 | @SuppressWarnings("unchecked") | ||
180 | @Override | ||
181 | public void eSet(int featureID, Object newValue) { | ||
182 | switch (featureID) { | ||
183 | case ProblemPackage.NEGATIVE_LITERAL__IMPLICIT_VARIABLES: | ||
184 | getImplicitVariables().clear(); | ||
185 | getImplicitVariables().addAll((Collection<? extends ImplicitVariable>) newValue); | ||
186 | return; | ||
187 | case ProblemPackage.NEGATIVE_LITERAL__ATOM: | ||
188 | setAtom((Atom) newValue); | ||
189 | return; | ||
190 | } | ||
191 | super.eSet(featureID, newValue); | ||
192 | } | ||
193 | |||
194 | /** | ||
195 | * <!-- begin-user-doc --> | ||
196 | * <!-- end-user-doc --> | ||
197 | * @generated | ||
198 | */ | ||
199 | @Override | ||
200 | public void eUnset(int featureID) { | ||
201 | switch (featureID) { | ||
202 | case ProblemPackage.NEGATIVE_LITERAL__IMPLICIT_VARIABLES: | ||
203 | getImplicitVariables().clear(); | ||
204 | return; | ||
205 | case ProblemPackage.NEGATIVE_LITERAL__ATOM: | ||
206 | setAtom((Atom) null); | ||
207 | return; | ||
208 | } | ||
209 | super.eUnset(featureID); | ||
210 | } | ||
211 | |||
212 | /** | ||
213 | * <!-- begin-user-doc --> | ||
214 | * <!-- end-user-doc --> | ||
215 | * @generated | ||
216 | */ | ||
217 | @Override | ||
218 | public boolean eIsSet(int featureID) { | ||
219 | switch (featureID) { | ||
220 | case ProblemPackage.NEGATIVE_LITERAL__IMPLICIT_VARIABLES: | ||
221 | return implicitVariables != null && !implicitVariables.isEmpty(); | ||
222 | case ProblemPackage.NEGATIVE_LITERAL__ATOM: | ||
223 | return atom != null; | ||
224 | } | ||
225 | return super.eIsSet(featureID); | ||
226 | } | ||
227 | |||
228 | } //NegativeLiteralImpl | ||