1 | /**
|
---|
2 | */
|
---|
3 | package de.ugoe.cs.swe.bnftools.ebnf.impl;
|
---|
4 |
|
---|
5 | import de.ugoe.cs.swe.bnftools.ebnf.Atom;
|
---|
6 | import de.ugoe.cs.swe.bnftools.ebnf.EbnfPackage;
|
---|
7 | import de.ugoe.cs.swe.bnftools.ebnf.GroupedSequence;
|
---|
8 | import de.ugoe.cs.swe.bnftools.ebnf.OptionalSequence;
|
---|
9 | import de.ugoe.cs.swe.bnftools.ebnf.RepeatedSequence;
|
---|
10 | import de.ugoe.cs.swe.bnftools.ebnf.Term;
|
---|
11 |
|
---|
12 | import org.eclipse.emf.common.notify.Notification;
|
---|
13 | import org.eclipse.emf.common.notify.NotificationChain;
|
---|
14 |
|
---|
15 | import org.eclipse.emf.ecore.EClass;
|
---|
16 | import org.eclipse.emf.ecore.InternalEObject;
|
---|
17 |
|
---|
18 | import org.eclipse.emf.ecore.impl.ENotificationImpl;
|
---|
19 | import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
|
---|
20 |
|
---|
21 | /**
|
---|
22 | * <!-- begin-user-doc -->
|
---|
23 | * An implementation of the model object '<em><b>Term</b></em>'.
|
---|
24 | * <!-- end-user-doc -->
|
---|
25 | * <p>
|
---|
26 | * The following features are implemented:
|
---|
27 | * <ul>
|
---|
28 | * <li>{@link de.ugoe.cs.swe.bnftools.ebnf.impl.TermImpl#getTermAtom <em>Term Atom</em>}</li>
|
---|
29 | * <li>{@link de.ugoe.cs.swe.bnftools.ebnf.impl.TermImpl#getTermGroupedSequence <em>Term Grouped Sequence</em>}</li>
|
---|
30 | * <li>{@link de.ugoe.cs.swe.bnftools.ebnf.impl.TermImpl#getTermOptionalSequence <em>Term Optional Sequence</em>}</li>
|
---|
31 | * <li>{@link de.ugoe.cs.swe.bnftools.ebnf.impl.TermImpl#getTermRepeatedSequence <em>Term Repeated Sequence</em>}</li>
|
---|
32 | * </ul>
|
---|
33 | * </p>
|
---|
34 | *
|
---|
35 | * @generated
|
---|
36 | */
|
---|
37 | public class TermImpl extends MinimalEObjectImpl.Container implements Term
|
---|
38 | {
|
---|
39 | /**
|
---|
40 | * The cached value of the '{@link #getTermAtom() <em>Term Atom</em>}' containment reference.
|
---|
41 | * <!-- begin-user-doc -->
|
---|
42 | * <!-- end-user-doc -->
|
---|
43 | * @see #getTermAtom()
|
---|
44 | * @generated
|
---|
45 | * @ordered
|
---|
46 | */
|
---|
47 | protected Atom termAtom;
|
---|
48 |
|
---|
49 | /**
|
---|
50 | * The cached value of the '{@link #getTermGroupedSequence() <em>Term Grouped Sequence</em>}' containment reference.
|
---|
51 | * <!-- begin-user-doc -->
|
---|
52 | * <!-- end-user-doc -->
|
---|
53 | * @see #getTermGroupedSequence()
|
---|
54 | * @generated
|
---|
55 | * @ordered
|
---|
56 | */
|
---|
57 | protected GroupedSequence termGroupedSequence;
|
---|
58 |
|
---|
59 | /**
|
---|
60 | * The cached value of the '{@link #getTermOptionalSequence() <em>Term Optional Sequence</em>}' containment reference.
|
---|
61 | * <!-- begin-user-doc -->
|
---|
62 | * <!-- end-user-doc -->
|
---|
63 | * @see #getTermOptionalSequence()
|
---|
64 | * @generated
|
---|
65 | * @ordered
|
---|
66 | */
|
---|
67 | protected OptionalSequence termOptionalSequence;
|
---|
68 |
|
---|
69 | /**
|
---|
70 | * The cached value of the '{@link #getTermRepeatedSequence() <em>Term Repeated Sequence</em>}' containment reference.
|
---|
71 | * <!-- begin-user-doc -->
|
---|
72 | * <!-- end-user-doc -->
|
---|
73 | * @see #getTermRepeatedSequence()
|
---|
74 | * @generated
|
---|
75 | * @ordered
|
---|
76 | */
|
---|
77 | protected RepeatedSequence termRepeatedSequence;
|
---|
78 |
|
---|
79 | /**
|
---|
80 | * <!-- begin-user-doc -->
|
---|
81 | * <!-- end-user-doc -->
|
---|
82 | * @generated
|
---|
83 | */
|
---|
84 | protected TermImpl()
|
---|
85 | {
|
---|
86 | super();
|
---|
87 | }
|
---|
88 |
|
---|
89 | /**
|
---|
90 | * <!-- begin-user-doc -->
|
---|
91 | * <!-- end-user-doc -->
|
---|
92 | * @generated
|
---|
93 | */
|
---|
94 | @Override
|
---|
95 | protected EClass eStaticClass()
|
---|
96 | {
|
---|
97 | return EbnfPackage.Literals.TERM;
|
---|
98 | }
|
---|
99 |
|
---|
100 | /**
|
---|
101 | * <!-- begin-user-doc -->
|
---|
102 | * <!-- end-user-doc -->
|
---|
103 | * @generated
|
---|
104 | */
|
---|
105 | public Atom getTermAtom()
|
---|
106 | {
|
---|
107 | return termAtom;
|
---|
108 | }
|
---|
109 |
|
---|
110 | /**
|
---|
111 | * <!-- begin-user-doc -->
|
---|
112 | * <!-- end-user-doc -->
|
---|
113 | * @generated
|
---|
114 | */
|
---|
115 | public NotificationChain basicSetTermAtom(Atom newTermAtom, NotificationChain msgs)
|
---|
116 | {
|
---|
117 | Atom oldTermAtom = termAtom;
|
---|
118 | termAtom = newTermAtom;
|
---|
119 | if (eNotificationRequired())
|
---|
120 | {
|
---|
121 | ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EbnfPackage.TERM__TERM_ATOM, oldTermAtom, newTermAtom);
|
---|
122 | if (msgs == null) msgs = notification; else msgs.add(notification);
|
---|
123 | }
|
---|
124 | return msgs;
|
---|
125 | }
|
---|
126 |
|
---|
127 | /**
|
---|
128 | * <!-- begin-user-doc -->
|
---|
129 | * <!-- end-user-doc -->
|
---|
130 | * @generated
|
---|
131 | */
|
---|
132 | public void setTermAtom(Atom newTermAtom)
|
---|
133 | {
|
---|
134 | if (newTermAtom != termAtom)
|
---|
135 | {
|
---|
136 | NotificationChain msgs = null;
|
---|
137 | if (termAtom != null)
|
---|
138 | msgs = ((InternalEObject)termAtom).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EbnfPackage.TERM__TERM_ATOM, null, msgs);
|
---|
139 | if (newTermAtom != null)
|
---|
140 | msgs = ((InternalEObject)newTermAtom).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EbnfPackage.TERM__TERM_ATOM, null, msgs);
|
---|
141 | msgs = basicSetTermAtom(newTermAtom, msgs);
|
---|
142 | if (msgs != null) msgs.dispatch();
|
---|
143 | }
|
---|
144 | else if (eNotificationRequired())
|
---|
145 | eNotify(new ENotificationImpl(this, Notification.SET, EbnfPackage.TERM__TERM_ATOM, newTermAtom, newTermAtom));
|
---|
146 | }
|
---|
147 |
|
---|
148 | /**
|
---|
149 | * <!-- begin-user-doc -->
|
---|
150 | * <!-- end-user-doc -->
|
---|
151 | * @generated
|
---|
152 | */
|
---|
153 | public GroupedSequence getTermGroupedSequence()
|
---|
154 | {
|
---|
155 | return termGroupedSequence;
|
---|
156 | }
|
---|
157 |
|
---|
158 | /**
|
---|
159 | * <!-- begin-user-doc -->
|
---|
160 | * <!-- end-user-doc -->
|
---|
161 | * @generated
|
---|
162 | */
|
---|
163 | public NotificationChain basicSetTermGroupedSequence(GroupedSequence newTermGroupedSequence, NotificationChain msgs)
|
---|
164 | {
|
---|
165 | GroupedSequence oldTermGroupedSequence = termGroupedSequence;
|
---|
166 | termGroupedSequence = newTermGroupedSequence;
|
---|
167 | if (eNotificationRequired())
|
---|
168 | {
|
---|
169 | ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EbnfPackage.TERM__TERM_GROUPED_SEQUENCE, oldTermGroupedSequence, newTermGroupedSequence);
|
---|
170 | if (msgs == null) msgs = notification; else msgs.add(notification);
|
---|
171 | }
|
---|
172 | return msgs;
|
---|
173 | }
|
---|
174 |
|
---|
175 | /**
|
---|
176 | * <!-- begin-user-doc -->
|
---|
177 | * <!-- end-user-doc -->
|
---|
178 | * @generated
|
---|
179 | */
|
---|
180 | public void setTermGroupedSequence(GroupedSequence newTermGroupedSequence)
|
---|
181 | {
|
---|
182 | if (newTermGroupedSequence != termGroupedSequence)
|
---|
183 | {
|
---|
184 | NotificationChain msgs = null;
|
---|
185 | if (termGroupedSequence != null)
|
---|
186 | msgs = ((InternalEObject)termGroupedSequence).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EbnfPackage.TERM__TERM_GROUPED_SEQUENCE, null, msgs);
|
---|
187 | if (newTermGroupedSequence != null)
|
---|
188 | msgs = ((InternalEObject)newTermGroupedSequence).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EbnfPackage.TERM__TERM_GROUPED_SEQUENCE, null, msgs);
|
---|
189 | msgs = basicSetTermGroupedSequence(newTermGroupedSequence, msgs);
|
---|
190 | if (msgs != null) msgs.dispatch();
|
---|
191 | }
|
---|
192 | else if (eNotificationRequired())
|
---|
193 | eNotify(new ENotificationImpl(this, Notification.SET, EbnfPackage.TERM__TERM_GROUPED_SEQUENCE, newTermGroupedSequence, newTermGroupedSequence));
|
---|
194 | }
|
---|
195 |
|
---|
196 | /**
|
---|
197 | * <!-- begin-user-doc -->
|
---|
198 | * <!-- end-user-doc -->
|
---|
199 | * @generated
|
---|
200 | */
|
---|
201 | public OptionalSequence getTermOptionalSequence()
|
---|
202 | {
|
---|
203 | return termOptionalSequence;
|
---|
204 | }
|
---|
205 |
|
---|
206 | /**
|
---|
207 | * <!-- begin-user-doc -->
|
---|
208 | * <!-- end-user-doc -->
|
---|
209 | * @generated
|
---|
210 | */
|
---|
211 | public NotificationChain basicSetTermOptionalSequence(OptionalSequence newTermOptionalSequence, NotificationChain msgs)
|
---|
212 | {
|
---|
213 | OptionalSequence oldTermOptionalSequence = termOptionalSequence;
|
---|
214 | termOptionalSequence = newTermOptionalSequence;
|
---|
215 | if (eNotificationRequired())
|
---|
216 | {
|
---|
217 | ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EbnfPackage.TERM__TERM_OPTIONAL_SEQUENCE, oldTermOptionalSequence, newTermOptionalSequence);
|
---|
218 | if (msgs == null) msgs = notification; else msgs.add(notification);
|
---|
219 | }
|
---|
220 | return msgs;
|
---|
221 | }
|
---|
222 |
|
---|
223 | /**
|
---|
224 | * <!-- begin-user-doc -->
|
---|
225 | * <!-- end-user-doc -->
|
---|
226 | * @generated
|
---|
227 | */
|
---|
228 | public void setTermOptionalSequence(OptionalSequence newTermOptionalSequence)
|
---|
229 | {
|
---|
230 | if (newTermOptionalSequence != termOptionalSequence)
|
---|
231 | {
|
---|
232 | NotificationChain msgs = null;
|
---|
233 | if (termOptionalSequence != null)
|
---|
234 | msgs = ((InternalEObject)termOptionalSequence).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EbnfPackage.TERM__TERM_OPTIONAL_SEQUENCE, null, msgs);
|
---|
235 | if (newTermOptionalSequence != null)
|
---|
236 | msgs = ((InternalEObject)newTermOptionalSequence).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EbnfPackage.TERM__TERM_OPTIONAL_SEQUENCE, null, msgs);
|
---|
237 | msgs = basicSetTermOptionalSequence(newTermOptionalSequence, msgs);
|
---|
238 | if (msgs != null) msgs.dispatch();
|
---|
239 | }
|
---|
240 | else if (eNotificationRequired())
|
---|
241 | eNotify(new ENotificationImpl(this, Notification.SET, EbnfPackage.TERM__TERM_OPTIONAL_SEQUENCE, newTermOptionalSequence, newTermOptionalSequence));
|
---|
242 | }
|
---|
243 |
|
---|
244 | /**
|
---|
245 | * <!-- begin-user-doc -->
|
---|
246 | * <!-- end-user-doc -->
|
---|
247 | * @generated
|
---|
248 | */
|
---|
249 | public RepeatedSequence getTermRepeatedSequence()
|
---|
250 | {
|
---|
251 | return termRepeatedSequence;
|
---|
252 | }
|
---|
253 |
|
---|
254 | /**
|
---|
255 | * <!-- begin-user-doc -->
|
---|
256 | * <!-- end-user-doc -->
|
---|
257 | * @generated
|
---|
258 | */
|
---|
259 | public NotificationChain basicSetTermRepeatedSequence(RepeatedSequence newTermRepeatedSequence, NotificationChain msgs)
|
---|
260 | {
|
---|
261 | RepeatedSequence oldTermRepeatedSequence = termRepeatedSequence;
|
---|
262 | termRepeatedSequence = newTermRepeatedSequence;
|
---|
263 | if (eNotificationRequired())
|
---|
264 | {
|
---|
265 | ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EbnfPackage.TERM__TERM_REPEATED_SEQUENCE, oldTermRepeatedSequence, newTermRepeatedSequence);
|
---|
266 | if (msgs == null) msgs = notification; else msgs.add(notification);
|
---|
267 | }
|
---|
268 | return msgs;
|
---|
269 | }
|
---|
270 |
|
---|
271 | /**
|
---|
272 | * <!-- begin-user-doc -->
|
---|
273 | * <!-- end-user-doc -->
|
---|
274 | * @generated
|
---|
275 | */
|
---|
276 | public void setTermRepeatedSequence(RepeatedSequence newTermRepeatedSequence)
|
---|
277 | {
|
---|
278 | if (newTermRepeatedSequence != termRepeatedSequence)
|
---|
279 | {
|
---|
280 | NotificationChain msgs = null;
|
---|
281 | if (termRepeatedSequence != null)
|
---|
282 | msgs = ((InternalEObject)termRepeatedSequence).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EbnfPackage.TERM__TERM_REPEATED_SEQUENCE, null, msgs);
|
---|
283 | if (newTermRepeatedSequence != null)
|
---|
284 | msgs = ((InternalEObject)newTermRepeatedSequence).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EbnfPackage.TERM__TERM_REPEATED_SEQUENCE, null, msgs);
|
---|
285 | msgs = basicSetTermRepeatedSequence(newTermRepeatedSequence, msgs);
|
---|
286 | if (msgs != null) msgs.dispatch();
|
---|
287 | }
|
---|
288 | else if (eNotificationRequired())
|
---|
289 | eNotify(new ENotificationImpl(this, Notification.SET, EbnfPackage.TERM__TERM_REPEATED_SEQUENCE, newTermRepeatedSequence, newTermRepeatedSequence));
|
---|
290 | }
|
---|
291 |
|
---|
292 | /**
|
---|
293 | * <!-- begin-user-doc -->
|
---|
294 | * <!-- end-user-doc -->
|
---|
295 | * @generated
|
---|
296 | */
|
---|
297 | @Override
|
---|
298 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
|
---|
299 | {
|
---|
300 | switch (featureID)
|
---|
301 | {
|
---|
302 | case EbnfPackage.TERM__TERM_ATOM:
|
---|
303 | return basicSetTermAtom(null, msgs);
|
---|
304 | case EbnfPackage.TERM__TERM_GROUPED_SEQUENCE:
|
---|
305 | return basicSetTermGroupedSequence(null, msgs);
|
---|
306 | case EbnfPackage.TERM__TERM_OPTIONAL_SEQUENCE:
|
---|
307 | return basicSetTermOptionalSequence(null, msgs);
|
---|
308 | case EbnfPackage.TERM__TERM_REPEATED_SEQUENCE:
|
---|
309 | return basicSetTermRepeatedSequence(null, msgs);
|
---|
310 | }
|
---|
311 | return super.eInverseRemove(otherEnd, featureID, msgs);
|
---|
312 | }
|
---|
313 |
|
---|
314 | /**
|
---|
315 | * <!-- begin-user-doc -->
|
---|
316 | * <!-- end-user-doc -->
|
---|
317 | * @generated
|
---|
318 | */
|
---|
319 | @Override
|
---|
320 | public Object eGet(int featureID, boolean resolve, boolean coreType)
|
---|
321 | {
|
---|
322 | switch (featureID)
|
---|
323 | {
|
---|
324 | case EbnfPackage.TERM__TERM_ATOM:
|
---|
325 | return getTermAtom();
|
---|
326 | case EbnfPackage.TERM__TERM_GROUPED_SEQUENCE:
|
---|
327 | return getTermGroupedSequence();
|
---|
328 | case EbnfPackage.TERM__TERM_OPTIONAL_SEQUENCE:
|
---|
329 | return getTermOptionalSequence();
|
---|
330 | case EbnfPackage.TERM__TERM_REPEATED_SEQUENCE:
|
---|
331 | return getTermRepeatedSequence();
|
---|
332 | }
|
---|
333 | return super.eGet(featureID, resolve, coreType);
|
---|
334 | }
|
---|
335 |
|
---|
336 | /**
|
---|
337 | * <!-- begin-user-doc -->
|
---|
338 | * <!-- end-user-doc -->
|
---|
339 | * @generated
|
---|
340 | */
|
---|
341 | @Override
|
---|
342 | public void eSet(int featureID, Object newValue)
|
---|
343 | {
|
---|
344 | switch (featureID)
|
---|
345 | {
|
---|
346 | case EbnfPackage.TERM__TERM_ATOM:
|
---|
347 | setTermAtom((Atom)newValue);
|
---|
348 | return;
|
---|
349 | case EbnfPackage.TERM__TERM_GROUPED_SEQUENCE:
|
---|
350 | setTermGroupedSequence((GroupedSequence)newValue);
|
---|
351 | return;
|
---|
352 | case EbnfPackage.TERM__TERM_OPTIONAL_SEQUENCE:
|
---|
353 | setTermOptionalSequence((OptionalSequence)newValue);
|
---|
354 | return;
|
---|
355 | case EbnfPackage.TERM__TERM_REPEATED_SEQUENCE:
|
---|
356 | setTermRepeatedSequence((RepeatedSequence)newValue);
|
---|
357 | return;
|
---|
358 | }
|
---|
359 | super.eSet(featureID, newValue);
|
---|
360 | }
|
---|
361 |
|
---|
362 | /**
|
---|
363 | * <!-- begin-user-doc -->
|
---|
364 | * <!-- end-user-doc -->
|
---|
365 | * @generated
|
---|
366 | */
|
---|
367 | @Override
|
---|
368 | public void eUnset(int featureID)
|
---|
369 | {
|
---|
370 | switch (featureID)
|
---|
371 | {
|
---|
372 | case EbnfPackage.TERM__TERM_ATOM:
|
---|
373 | setTermAtom((Atom)null);
|
---|
374 | return;
|
---|
375 | case EbnfPackage.TERM__TERM_GROUPED_SEQUENCE:
|
---|
376 | setTermGroupedSequence((GroupedSequence)null);
|
---|
377 | return;
|
---|
378 | case EbnfPackage.TERM__TERM_OPTIONAL_SEQUENCE:
|
---|
379 | setTermOptionalSequence((OptionalSequence)null);
|
---|
380 | return;
|
---|
381 | case EbnfPackage.TERM__TERM_REPEATED_SEQUENCE:
|
---|
382 | setTermRepeatedSequence((RepeatedSequence)null);
|
---|
383 | return;
|
---|
384 | }
|
---|
385 | super.eUnset(featureID);
|
---|
386 | }
|
---|
387 |
|
---|
388 | /**
|
---|
389 | * <!-- begin-user-doc -->
|
---|
390 | * <!-- end-user-doc -->
|
---|
391 | * @generated
|
---|
392 | */
|
---|
393 | @Override
|
---|
394 | public boolean eIsSet(int featureID)
|
---|
395 | {
|
---|
396 | switch (featureID)
|
---|
397 | {
|
---|
398 | case EbnfPackage.TERM__TERM_ATOM:
|
---|
399 | return termAtom != null;
|
---|
400 | case EbnfPackage.TERM__TERM_GROUPED_SEQUENCE:
|
---|
401 | return termGroupedSequence != null;
|
---|
402 | case EbnfPackage.TERM__TERM_OPTIONAL_SEQUENCE:
|
---|
403 | return termOptionalSequence != null;
|
---|
404 | case EbnfPackage.TERM__TERM_REPEATED_SEQUENCE:
|
---|
405 | return termRepeatedSequence != null;
|
---|
406 | }
|
---|
407 | return super.eIsSet(featureID);
|
---|
408 | }
|
---|
409 |
|
---|
410 | } //TermImpl
|
---|