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