1 | /** |
---|
2 | */ |
---|
3 | package de.ugoe.cs.swe.bnftools.ebnf.impl; |
---|
4 | |
---|
5 | import de.ugoe.cs.swe.bnftools.ebnf.EbnfPackage; |
---|
6 | import de.ugoe.cs.swe.bnftools.ebnf.MergeEntry; |
---|
7 | import de.ugoe.cs.swe.bnftools.ebnf.MergeRule; |
---|
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>Merge 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.MergeEntryImpl#getSectionheader <em>Sectionheader</em>}</li> |
---|
27 | * <li>{@link de.ugoe.cs.swe.bnftools.ebnf.impl.MergeEntryImpl#getMergeRule <em>Merge Rule</em>}</li> |
---|
28 | * </ul> |
---|
29 | * </p> |
---|
30 | * |
---|
31 | * @generated |
---|
32 | */ |
---|
33 | public class MergeEntryImpl extends MinimalEObjectImpl.Container implements MergeEntry |
---|
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 #getMergeRule() <em>Merge Rule</em>}' containment reference. |
---|
47 | * <!-- begin-user-doc --> |
---|
48 | * <!-- end-user-doc --> |
---|
49 | * @see #getMergeRule() |
---|
50 | * @generated |
---|
51 | * @ordered |
---|
52 | */ |
---|
53 | protected MergeRule mergeRule; |
---|
54 | |
---|
55 | /** |
---|
56 | * <!-- begin-user-doc --> |
---|
57 | * <!-- end-user-doc --> |
---|
58 | * @generated |
---|
59 | */ |
---|
60 | protected MergeEntryImpl() |
---|
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.MERGE_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.MERGE_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.MERGE_ENTRY__SECTIONHEADER, null, msgs); |
---|
115 | if (newSectionheader != null) |
---|
116 | msgs = ((InternalEObject)newSectionheader).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EbnfPackage.MERGE_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.MERGE_ENTRY__SECTIONHEADER, newSectionheader, newSectionheader)); |
---|
122 | } |
---|
123 | |
---|
124 | /** |
---|
125 | * <!-- begin-user-doc --> |
---|
126 | * <!-- end-user-doc --> |
---|
127 | * @generated |
---|
128 | */ |
---|
129 | public MergeRule getMergeRule() |
---|
130 | { |
---|
131 | return mergeRule; |
---|
132 | } |
---|
133 | |
---|
134 | /** |
---|
135 | * <!-- begin-user-doc --> |
---|
136 | * <!-- end-user-doc --> |
---|
137 | * @generated |
---|
138 | */ |
---|
139 | public NotificationChain basicSetMergeRule(MergeRule newMergeRule, NotificationChain msgs) |
---|
140 | { |
---|
141 | MergeRule oldMergeRule = mergeRule; |
---|
142 | mergeRule = newMergeRule; |
---|
143 | if (eNotificationRequired()) |
---|
144 | { |
---|
145 | ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EbnfPackage.MERGE_ENTRY__MERGE_RULE, oldMergeRule, newMergeRule); |
---|
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 setMergeRule(MergeRule newMergeRule) |
---|
157 | { |
---|
158 | if (newMergeRule != mergeRule) |
---|
159 | { |
---|
160 | NotificationChain msgs = null; |
---|
161 | if (mergeRule != null) |
---|
162 | msgs = ((InternalEObject)mergeRule).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EbnfPackage.MERGE_ENTRY__MERGE_RULE, null, msgs); |
---|
163 | if (newMergeRule != null) |
---|
164 | msgs = ((InternalEObject)newMergeRule).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EbnfPackage.MERGE_ENTRY__MERGE_RULE, null, msgs); |
---|
165 | msgs = basicSetMergeRule(newMergeRule, msgs); |
---|
166 | if (msgs != null) msgs.dispatch(); |
---|
167 | } |
---|
168 | else if (eNotificationRequired()) |
---|
169 | eNotify(new ENotificationImpl(this, Notification.SET, EbnfPackage.MERGE_ENTRY__MERGE_RULE, newMergeRule, newMergeRule)); |
---|
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.MERGE_ENTRY__SECTIONHEADER: |
---|
183 | return basicSetSectionheader(null, msgs); |
---|
184 | case EbnfPackage.MERGE_ENTRY__MERGE_RULE: |
---|
185 | return basicSetMergeRule(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.MERGE_ENTRY__SECTIONHEADER: |
---|
201 | return getSectionheader(); |
---|
202 | case EbnfPackage.MERGE_ENTRY__MERGE_RULE: |
---|
203 | return getMergeRule(); |
---|
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.MERGE_ENTRY__SECTIONHEADER: |
---|
219 | setSectionheader((SectionHeading)newValue); |
---|
220 | return; |
---|
221 | case EbnfPackage.MERGE_ENTRY__MERGE_RULE: |
---|
222 | setMergeRule((MergeRule)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.MERGE_ENTRY__SECTIONHEADER: |
---|
239 | setSectionheader((SectionHeading)null); |
---|
240 | return; |
---|
241 | case EbnfPackage.MERGE_ENTRY__MERGE_RULE: |
---|
242 | setMergeRule((MergeRule)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.MERGE_ENTRY__SECTIONHEADER: |
---|
259 | return sectionheader != null; |
---|
260 | case EbnfPackage.MERGE_ENTRY__MERGE_RULE: |
---|
261 | return mergeRule != null; |
---|
262 | } |
---|
263 | return super.eIsSet(featureID); |
---|
264 | } |
---|
265 | |
---|
266 | } //MergeEntryImpl |
---|