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