1 | /**
|
---|
2 | */
|
---|
3 | package de.ugoe.cs.swe.bnftools.ebnf.impl;
|
---|
4 |
|
---|
5 | import de.ugoe.cs.swe.bnftools.ebnf.DeltaEntry;
|
---|
6 | import de.ugoe.cs.swe.bnftools.ebnf.EbnfPackage;
|
---|
7 | import de.ugoe.cs.swe.bnftools.ebnf.ExtRule;
|
---|
8 | import de.ugoe.cs.swe.bnftools.ebnf.Rule;
|
---|
9 | import de.ugoe.cs.swe.bnftools.ebnf.SectionHeading;
|
---|
10 |
|
---|
11 | import org.eclipse.emf.common.notify.Notification;
|
---|
12 | import org.eclipse.emf.common.notify.NotificationChain;
|
---|
13 |
|
---|
14 | import org.eclipse.emf.ecore.EClass;
|
---|
15 | import org.eclipse.emf.ecore.InternalEObject;
|
---|
16 |
|
---|
17 | import org.eclipse.emf.ecore.impl.ENotificationImpl;
|
---|
18 | import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
|
---|
19 |
|
---|
20 | /**
|
---|
21 | * <!-- begin-user-doc -->
|
---|
22 | * An implementation of the model object '<em><b>Delta Entry</b></em>'.
|
---|
23 | * <!-- end-user-doc -->
|
---|
24 | * <p>
|
---|
25 | * The following features are implemented:
|
---|
26 | * <ul>
|
---|
27 | * <li>{@link de.ugoe.cs.swe.bnftools.ebnf.impl.DeltaEntryImpl#getRule <em>Rule</em>}</li>
|
---|
28 | * <li>{@link de.ugoe.cs.swe.bnftools.ebnf.impl.DeltaEntryImpl#getSectionheader <em>Sectionheader</em>}</li>
|
---|
29 | * <li>{@link de.ugoe.cs.swe.bnftools.ebnf.impl.DeltaEntryImpl#getExtRule <em>Ext Rule</em>}</li>
|
---|
30 | * </ul>
|
---|
31 | * </p>
|
---|
32 | *
|
---|
33 | * @generated
|
---|
34 | */
|
---|
35 | public class DeltaEntryImpl extends MinimalEObjectImpl.Container implements DeltaEntry
|
---|
36 | {
|
---|
37 | /**
|
---|
38 | * The cached value of the '{@link #getRule() <em>Rule</em>}' containment reference.
|
---|
39 | * <!-- begin-user-doc -->
|
---|
40 | * <!-- end-user-doc -->
|
---|
41 | * @see #getRule()
|
---|
42 | * @generated
|
---|
43 | * @ordered
|
---|
44 | */
|
---|
45 | protected Rule rule;
|
---|
46 |
|
---|
47 | /**
|
---|
48 | * The cached value of the '{@link #getSectionheader() <em>Sectionheader</em>}' containment reference.
|
---|
49 | * <!-- begin-user-doc -->
|
---|
50 | * <!-- end-user-doc -->
|
---|
51 | * @see #getSectionheader()
|
---|
52 | * @generated
|
---|
53 | * @ordered
|
---|
54 | */
|
---|
55 | protected SectionHeading sectionheader;
|
---|
56 |
|
---|
57 | /**
|
---|
58 | * The cached value of the '{@link #getExtRule() <em>Ext Rule</em>}' containment reference.
|
---|
59 | * <!-- begin-user-doc -->
|
---|
60 | * <!-- end-user-doc -->
|
---|
61 | * @see #getExtRule()
|
---|
62 | * @generated
|
---|
63 | * @ordered
|
---|
64 | */
|
---|
65 | protected ExtRule extRule;
|
---|
66 |
|
---|
67 | /**
|
---|
68 | * <!-- begin-user-doc -->
|
---|
69 | * <!-- end-user-doc -->
|
---|
70 | * @generated
|
---|
71 | */
|
---|
72 | protected DeltaEntryImpl()
|
---|
73 | {
|
---|
74 | super();
|
---|
75 | }
|
---|
76 |
|
---|
77 | /**
|
---|
78 | * <!-- begin-user-doc -->
|
---|
79 | * <!-- end-user-doc -->
|
---|
80 | * @generated
|
---|
81 | */
|
---|
82 | @Override
|
---|
83 | protected EClass eStaticClass()
|
---|
84 | {
|
---|
85 | return EbnfPackage.Literals.DELTA_ENTRY;
|
---|
86 | }
|
---|
87 |
|
---|
88 | /**
|
---|
89 | * <!-- begin-user-doc -->
|
---|
90 | * <!-- end-user-doc -->
|
---|
91 | * @generated
|
---|
92 | */
|
---|
93 | public Rule getRule()
|
---|
94 | {
|
---|
95 | return rule;
|
---|
96 | }
|
---|
97 |
|
---|
98 | /**
|
---|
99 | * <!-- begin-user-doc -->
|
---|
100 | * <!-- end-user-doc -->
|
---|
101 | * @generated
|
---|
102 | */
|
---|
103 | public NotificationChain basicSetRule(Rule newRule, NotificationChain msgs)
|
---|
104 | {
|
---|
105 | Rule oldRule = rule;
|
---|
106 | rule = newRule;
|
---|
107 | if (eNotificationRequired())
|
---|
108 | {
|
---|
109 | ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EbnfPackage.DELTA_ENTRY__RULE, oldRule, newRule);
|
---|
110 | if (msgs == null) msgs = notification; else msgs.add(notification);
|
---|
111 | }
|
---|
112 | return msgs;
|
---|
113 | }
|
---|
114 |
|
---|
115 | /**
|
---|
116 | * <!-- begin-user-doc -->
|
---|
117 | * <!-- end-user-doc -->
|
---|
118 | * @generated
|
---|
119 | */
|
---|
120 | public void setRule(Rule newRule)
|
---|
121 | {
|
---|
122 | if (newRule != rule)
|
---|
123 | {
|
---|
124 | NotificationChain msgs = null;
|
---|
125 | if (rule != null)
|
---|
126 | msgs = ((InternalEObject)rule).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EbnfPackage.DELTA_ENTRY__RULE, null, msgs);
|
---|
127 | if (newRule != null)
|
---|
128 | msgs = ((InternalEObject)newRule).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EbnfPackage.DELTA_ENTRY__RULE, null, msgs);
|
---|
129 | msgs = basicSetRule(newRule, msgs);
|
---|
130 | if (msgs != null) msgs.dispatch();
|
---|
131 | }
|
---|
132 | else if (eNotificationRequired())
|
---|
133 | eNotify(new ENotificationImpl(this, Notification.SET, EbnfPackage.DELTA_ENTRY__RULE, newRule, newRule));
|
---|
134 | }
|
---|
135 |
|
---|
136 | /**
|
---|
137 | * <!-- begin-user-doc -->
|
---|
138 | * <!-- end-user-doc -->
|
---|
139 | * @generated
|
---|
140 | */
|
---|
141 | public SectionHeading getSectionheader()
|
---|
142 | {
|
---|
143 | return sectionheader;
|
---|
144 | }
|
---|
145 |
|
---|
146 | /**
|
---|
147 | * <!-- begin-user-doc -->
|
---|
148 | * <!-- end-user-doc -->
|
---|
149 | * @generated
|
---|
150 | */
|
---|
151 | public NotificationChain basicSetSectionheader(SectionHeading newSectionheader, NotificationChain msgs)
|
---|
152 | {
|
---|
153 | SectionHeading oldSectionheader = sectionheader;
|
---|
154 | sectionheader = newSectionheader;
|
---|
155 | if (eNotificationRequired())
|
---|
156 | {
|
---|
157 | ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EbnfPackage.DELTA_ENTRY__SECTIONHEADER, oldSectionheader, newSectionheader);
|
---|
158 | if (msgs == null) msgs = notification; else msgs.add(notification);
|
---|
159 | }
|
---|
160 | return msgs;
|
---|
161 | }
|
---|
162 |
|
---|
163 | /**
|
---|
164 | * <!-- begin-user-doc -->
|
---|
165 | * <!-- end-user-doc -->
|
---|
166 | * @generated
|
---|
167 | */
|
---|
168 | public void setSectionheader(SectionHeading newSectionheader)
|
---|
169 | {
|
---|
170 | if (newSectionheader != sectionheader)
|
---|
171 | {
|
---|
172 | NotificationChain msgs = null;
|
---|
173 | if (sectionheader != null)
|
---|
174 | msgs = ((InternalEObject)sectionheader).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EbnfPackage.DELTA_ENTRY__SECTIONHEADER, null, msgs);
|
---|
175 | if (newSectionheader != null)
|
---|
176 | msgs = ((InternalEObject)newSectionheader).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EbnfPackage.DELTA_ENTRY__SECTIONHEADER, null, msgs);
|
---|
177 | msgs = basicSetSectionheader(newSectionheader, msgs);
|
---|
178 | if (msgs != null) msgs.dispatch();
|
---|
179 | }
|
---|
180 | else if (eNotificationRequired())
|
---|
181 | eNotify(new ENotificationImpl(this, Notification.SET, EbnfPackage.DELTA_ENTRY__SECTIONHEADER, newSectionheader, newSectionheader));
|
---|
182 | }
|
---|
183 |
|
---|
184 | /**
|
---|
185 | * <!-- begin-user-doc -->
|
---|
186 | * <!-- end-user-doc -->
|
---|
187 | * @generated
|
---|
188 | */
|
---|
189 | public ExtRule getExtRule()
|
---|
190 | {
|
---|
191 | return extRule;
|
---|
192 | }
|
---|
193 |
|
---|
194 | /**
|
---|
195 | * <!-- begin-user-doc -->
|
---|
196 | * <!-- end-user-doc -->
|
---|
197 | * @generated
|
---|
198 | */
|
---|
199 | public NotificationChain basicSetExtRule(ExtRule newExtRule, NotificationChain msgs)
|
---|
200 | {
|
---|
201 | ExtRule oldExtRule = extRule;
|
---|
202 | extRule = newExtRule;
|
---|
203 | if (eNotificationRequired())
|
---|
204 | {
|
---|
205 | ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EbnfPackage.DELTA_ENTRY__EXT_RULE, oldExtRule, newExtRule);
|
---|
206 | if (msgs == null) msgs = notification; else msgs.add(notification);
|
---|
207 | }
|
---|
208 | return msgs;
|
---|
209 | }
|
---|
210 |
|
---|
211 | /**
|
---|
212 | * <!-- begin-user-doc -->
|
---|
213 | * <!-- end-user-doc -->
|
---|
214 | * @generated
|
---|
215 | */
|
---|
216 | public void setExtRule(ExtRule newExtRule)
|
---|
217 | {
|
---|
218 | if (newExtRule != extRule)
|
---|
219 | {
|
---|
220 | NotificationChain msgs = null;
|
---|
221 | if (extRule != null)
|
---|
222 | msgs = ((InternalEObject)extRule).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EbnfPackage.DELTA_ENTRY__EXT_RULE, null, msgs);
|
---|
223 | if (newExtRule != null)
|
---|
224 | msgs = ((InternalEObject)newExtRule).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EbnfPackage.DELTA_ENTRY__EXT_RULE, null, msgs);
|
---|
225 | msgs = basicSetExtRule(newExtRule, msgs);
|
---|
226 | if (msgs != null) msgs.dispatch();
|
---|
227 | }
|
---|
228 | else if (eNotificationRequired())
|
---|
229 | eNotify(new ENotificationImpl(this, Notification.SET, EbnfPackage.DELTA_ENTRY__EXT_RULE, newExtRule, newExtRule));
|
---|
230 | }
|
---|
231 |
|
---|
232 | /**
|
---|
233 | * <!-- begin-user-doc -->
|
---|
234 | * <!-- end-user-doc -->
|
---|
235 | * @generated
|
---|
236 | */
|
---|
237 | @Override
|
---|
238 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
|
---|
239 | {
|
---|
240 | switch (featureID)
|
---|
241 | {
|
---|
242 | case EbnfPackage.DELTA_ENTRY__RULE:
|
---|
243 | return basicSetRule(null, msgs);
|
---|
244 | case EbnfPackage.DELTA_ENTRY__SECTIONHEADER:
|
---|
245 | return basicSetSectionheader(null, msgs);
|
---|
246 | case EbnfPackage.DELTA_ENTRY__EXT_RULE:
|
---|
247 | return basicSetExtRule(null, msgs);
|
---|
248 | }
|
---|
249 | return super.eInverseRemove(otherEnd, featureID, msgs);
|
---|
250 | }
|
---|
251 |
|
---|
252 | /**
|
---|
253 | * <!-- begin-user-doc -->
|
---|
254 | * <!-- end-user-doc -->
|
---|
255 | * @generated
|
---|
256 | */
|
---|
257 | @Override
|
---|
258 | public Object eGet(int featureID, boolean resolve, boolean coreType)
|
---|
259 | {
|
---|
260 | switch (featureID)
|
---|
261 | {
|
---|
262 | case EbnfPackage.DELTA_ENTRY__RULE:
|
---|
263 | return getRule();
|
---|
264 | case EbnfPackage.DELTA_ENTRY__SECTIONHEADER:
|
---|
265 | return getSectionheader();
|
---|
266 | case EbnfPackage.DELTA_ENTRY__EXT_RULE:
|
---|
267 | return getExtRule();
|
---|
268 | }
|
---|
269 | return super.eGet(featureID, resolve, coreType);
|
---|
270 | }
|
---|
271 |
|
---|
272 | /**
|
---|
273 | * <!-- begin-user-doc -->
|
---|
274 | * <!-- end-user-doc -->
|
---|
275 | * @generated
|
---|
276 | */
|
---|
277 | @Override
|
---|
278 | public void eSet(int featureID, Object newValue)
|
---|
279 | {
|
---|
280 | switch (featureID)
|
---|
281 | {
|
---|
282 | case EbnfPackage.DELTA_ENTRY__RULE:
|
---|
283 | setRule((Rule)newValue);
|
---|
284 | return;
|
---|
285 | case EbnfPackage.DELTA_ENTRY__SECTIONHEADER:
|
---|
286 | setSectionheader((SectionHeading)newValue);
|
---|
287 | return;
|
---|
288 | case EbnfPackage.DELTA_ENTRY__EXT_RULE:
|
---|
289 | setExtRule((ExtRule)newValue);
|
---|
290 | return;
|
---|
291 | }
|
---|
292 | super.eSet(featureID, newValue);
|
---|
293 | }
|
---|
294 |
|
---|
295 | /**
|
---|
296 | * <!-- begin-user-doc -->
|
---|
297 | * <!-- end-user-doc -->
|
---|
298 | * @generated
|
---|
299 | */
|
---|
300 | @Override
|
---|
301 | public void eUnset(int featureID)
|
---|
302 | {
|
---|
303 | switch (featureID)
|
---|
304 | {
|
---|
305 | case EbnfPackage.DELTA_ENTRY__RULE:
|
---|
306 | setRule((Rule)null);
|
---|
307 | return;
|
---|
308 | case EbnfPackage.DELTA_ENTRY__SECTIONHEADER:
|
---|
309 | setSectionheader((SectionHeading)null);
|
---|
310 | return;
|
---|
311 | case EbnfPackage.DELTA_ENTRY__EXT_RULE:
|
---|
312 | setExtRule((ExtRule)null);
|
---|
313 | return;
|
---|
314 | }
|
---|
315 | super.eUnset(featureID);
|
---|
316 | }
|
---|
317 |
|
---|
318 | /**
|
---|
319 | * <!-- begin-user-doc -->
|
---|
320 | * <!-- end-user-doc -->
|
---|
321 | * @generated
|
---|
322 | */
|
---|
323 | @Override
|
---|
324 | public boolean eIsSet(int featureID)
|
---|
325 | {
|
---|
326 | switch (featureID)
|
---|
327 | {
|
---|
328 | case EbnfPackage.DELTA_ENTRY__RULE:
|
---|
329 | return rule != null;
|
---|
330 | case EbnfPackage.DELTA_ENTRY__SECTIONHEADER:
|
---|
331 | return sectionheader != null;
|
---|
332 | case EbnfPackage.DELTA_ENTRY__EXT_RULE:
|
---|
333 | return extRule != null;
|
---|
334 | }
|
---|
335 | return super.eIsSet(featureID);
|
---|
336 | }
|
---|
337 |
|
---|
338 | } //DeltaEntryImpl
|
---|