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