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.RuleReference;
|
---|
8 | import de.ugoe.cs.swe.bnftools.ebnf.StringRule;
|
---|
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>Atom</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.AtomImpl#getAtomStringRule <em>Atom String Rule</em>}</li>
|
---|
27 | * <li>{@link de.ugoe.cs.swe.bnftools.ebnf.impl.AtomImpl#getAtomRuleReference <em>Atom Rule Reference</em>}</li>
|
---|
28 | * </ul>
|
---|
29 | * </p>
|
---|
30 | *
|
---|
31 | * @generated
|
---|
32 | */
|
---|
33 | public class AtomImpl extends MinimalEObjectImpl.Container implements Atom
|
---|
34 | {
|
---|
35 | /**
|
---|
36 | * The cached value of the '{@link #getAtomStringRule() <em>Atom String Rule</em>}' containment reference.
|
---|
37 | * <!-- begin-user-doc -->
|
---|
38 | * <!-- end-user-doc -->
|
---|
39 | * @see #getAtomStringRule()
|
---|
40 | * @generated
|
---|
41 | * @ordered
|
---|
42 | */
|
---|
43 | protected StringRule atomStringRule;
|
---|
44 |
|
---|
45 | /**
|
---|
46 | * The cached value of the '{@link #getAtomRuleReference() <em>Atom Rule Reference</em>}' containment reference.
|
---|
47 | * <!-- begin-user-doc -->
|
---|
48 | * <!-- end-user-doc -->
|
---|
49 | * @see #getAtomRuleReference()
|
---|
50 | * @generated
|
---|
51 | * @ordered
|
---|
52 | */
|
---|
53 | protected RuleReference atomRuleReference;
|
---|
54 |
|
---|
55 | /**
|
---|
56 | * <!-- begin-user-doc -->
|
---|
57 | * <!-- end-user-doc -->
|
---|
58 | * @generated
|
---|
59 | */
|
---|
60 | protected AtomImpl()
|
---|
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.ATOM;
|
---|
74 | }
|
---|
75 |
|
---|
76 | /**
|
---|
77 | * <!-- begin-user-doc -->
|
---|
78 | * <!-- end-user-doc -->
|
---|
79 | * @generated
|
---|
80 | */
|
---|
81 | public StringRule getAtomStringRule()
|
---|
82 | {
|
---|
83 | return atomStringRule;
|
---|
84 | }
|
---|
85 |
|
---|
86 | /**
|
---|
87 | * <!-- begin-user-doc -->
|
---|
88 | * <!-- end-user-doc -->
|
---|
89 | * @generated
|
---|
90 | */
|
---|
91 | public NotificationChain basicSetAtomStringRule(StringRule newAtomStringRule, NotificationChain msgs)
|
---|
92 | {
|
---|
93 | StringRule oldAtomStringRule = atomStringRule;
|
---|
94 | atomStringRule = newAtomStringRule;
|
---|
95 | if (eNotificationRequired())
|
---|
96 | {
|
---|
97 | ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EbnfPackage.ATOM__ATOM_STRING_RULE, oldAtomStringRule, newAtomStringRule);
|
---|
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 setAtomStringRule(StringRule newAtomStringRule)
|
---|
109 | {
|
---|
110 | if (newAtomStringRule != atomStringRule)
|
---|
111 | {
|
---|
112 | NotificationChain msgs = null;
|
---|
113 | if (atomStringRule != null)
|
---|
114 | msgs = ((InternalEObject)atomStringRule).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EbnfPackage.ATOM__ATOM_STRING_RULE, null, msgs);
|
---|
115 | if (newAtomStringRule != null)
|
---|
116 | msgs = ((InternalEObject)newAtomStringRule).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EbnfPackage.ATOM__ATOM_STRING_RULE, null, msgs);
|
---|
117 | msgs = basicSetAtomStringRule(newAtomStringRule, msgs);
|
---|
118 | if (msgs != null) msgs.dispatch();
|
---|
119 | }
|
---|
120 | else if (eNotificationRequired())
|
---|
121 | eNotify(new ENotificationImpl(this, Notification.SET, EbnfPackage.ATOM__ATOM_STRING_RULE, newAtomStringRule, newAtomStringRule));
|
---|
122 | }
|
---|
123 |
|
---|
124 | /**
|
---|
125 | * <!-- begin-user-doc -->
|
---|
126 | * <!-- end-user-doc -->
|
---|
127 | * @generated
|
---|
128 | */
|
---|
129 | public RuleReference getAtomRuleReference()
|
---|
130 | {
|
---|
131 | return atomRuleReference;
|
---|
132 | }
|
---|
133 |
|
---|
134 | /**
|
---|
135 | * <!-- begin-user-doc -->
|
---|
136 | * <!-- end-user-doc -->
|
---|
137 | * @generated
|
---|
138 | */
|
---|
139 | public NotificationChain basicSetAtomRuleReference(RuleReference newAtomRuleReference, NotificationChain msgs)
|
---|
140 | {
|
---|
141 | RuleReference oldAtomRuleReference = atomRuleReference;
|
---|
142 | atomRuleReference = newAtomRuleReference;
|
---|
143 | if (eNotificationRequired())
|
---|
144 | {
|
---|
145 | ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EbnfPackage.ATOM__ATOM_RULE_REFERENCE, oldAtomRuleReference, newAtomRuleReference);
|
---|
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 setAtomRuleReference(RuleReference newAtomRuleReference)
|
---|
157 | {
|
---|
158 | if (newAtomRuleReference != atomRuleReference)
|
---|
159 | {
|
---|
160 | NotificationChain msgs = null;
|
---|
161 | if (atomRuleReference != null)
|
---|
162 | msgs = ((InternalEObject)atomRuleReference).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EbnfPackage.ATOM__ATOM_RULE_REFERENCE, null, msgs);
|
---|
163 | if (newAtomRuleReference != null)
|
---|
164 | msgs = ((InternalEObject)newAtomRuleReference).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EbnfPackage.ATOM__ATOM_RULE_REFERENCE, null, msgs);
|
---|
165 | msgs = basicSetAtomRuleReference(newAtomRuleReference, msgs);
|
---|
166 | if (msgs != null) msgs.dispatch();
|
---|
167 | }
|
---|
168 | else if (eNotificationRequired())
|
---|
169 | eNotify(new ENotificationImpl(this, Notification.SET, EbnfPackage.ATOM__ATOM_RULE_REFERENCE, newAtomRuleReference, newAtomRuleReference));
|
---|
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.ATOM__ATOM_STRING_RULE:
|
---|
183 | return basicSetAtomStringRule(null, msgs);
|
---|
184 | case EbnfPackage.ATOM__ATOM_RULE_REFERENCE:
|
---|
185 | return basicSetAtomRuleReference(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.ATOM__ATOM_STRING_RULE:
|
---|
201 | return getAtomStringRule();
|
---|
202 | case EbnfPackage.ATOM__ATOM_RULE_REFERENCE:
|
---|
203 | return getAtomRuleReference();
|
---|
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.ATOM__ATOM_STRING_RULE:
|
---|
219 | setAtomStringRule((StringRule)newValue);
|
---|
220 | return;
|
---|
221 | case EbnfPackage.ATOM__ATOM_RULE_REFERENCE:
|
---|
222 | setAtomRuleReference((RuleReference)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.ATOM__ATOM_STRING_RULE:
|
---|
239 | setAtomStringRule((StringRule)null);
|
---|
240 | return;
|
---|
241 | case EbnfPackage.ATOM__ATOM_RULE_REFERENCE:
|
---|
242 | setAtomRuleReference((RuleReference)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.ATOM__ATOM_STRING_RULE:
|
---|
259 | return atomStringRule != null;
|
---|
260 | case EbnfPackage.ATOM__ATOM_RULE_REFERENCE:
|
---|
261 | return atomRuleReference != null;
|
---|
262 | }
|
---|
263 | return super.eIsSet(featureID);
|
---|
264 | }
|
---|
265 |
|
---|
266 | } //AtomImpl
|
---|