[88] | 1 | /** |
---|
| 2 | */ |
---|
| 3 | package de.ugoe.cs.swe.bnftools.ebnf.impl; |
---|
| 4 | |
---|
| 5 | import de.ugoe.cs.swe.bnftools.ebnf.BnfEntry; |
---|
[100] | 6 | import de.ugoe.cs.swe.bnftools.ebnf.Comment; |
---|
[88] | 7 | import de.ugoe.cs.swe.bnftools.ebnf.EbnfPackage; |
---|
| 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>Bnf 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.BnfEntryImpl#getSectionheader <em>Sectionheader</em>}</li> |
---|
| 28 | * <li>{@link de.ugoe.cs.swe.bnftools.ebnf.impl.BnfEntryImpl#getRule <em>Rule</em>}</li> |
---|
[100] | 29 | * <li>{@link de.ugoe.cs.swe.bnftools.ebnf.impl.BnfEntryImpl#getComment <em>Comment</em>}</li> |
---|
[88] | 30 | * </ul> |
---|
| 31 | * </p> |
---|
| 32 | * |
---|
| 33 | * @generated |
---|
| 34 | */ |
---|
| 35 | public class BnfEntryImpl extends MinimalEObjectImpl.Container implements BnfEntry |
---|
| 36 | { |
---|
| 37 | /** |
---|
| 38 | * The cached value of the '{@link #getSectionheader() <em>Sectionheader</em>}' containment reference. |
---|
| 39 | * <!-- begin-user-doc --> |
---|
| 40 | * <!-- end-user-doc --> |
---|
| 41 | * @see #getSectionheader() |
---|
| 42 | * @generated |
---|
| 43 | * @ordered |
---|
| 44 | */ |
---|
| 45 | protected SectionHeading sectionheader; |
---|
| 46 | |
---|
| 47 | /** |
---|
| 48 | * The cached value of the '{@link #getRule() <em>Rule</em>}' containment reference. |
---|
| 49 | * <!-- begin-user-doc --> |
---|
| 50 | * <!-- end-user-doc --> |
---|
| 51 | * @see #getRule() |
---|
| 52 | * @generated |
---|
| 53 | * @ordered |
---|
| 54 | */ |
---|
| 55 | protected Rule rule; |
---|
| 56 | |
---|
| 57 | /** |
---|
[100] | 58 | * The cached value of the '{@link #getComment() <em>Comment</em>}' containment reference. |
---|
[88] | 59 | * <!-- begin-user-doc --> |
---|
| 60 | * <!-- end-user-doc --> |
---|
[100] | 61 | * @see #getComment() |
---|
[88] | 62 | * @generated |
---|
[100] | 63 | * @ordered |
---|
[88] | 64 | */ |
---|
[100] | 65 | protected Comment comment; |
---|
| 66 | |
---|
| 67 | /** |
---|
| 68 | * <!-- begin-user-doc --> |
---|
| 69 | * <!-- end-user-doc --> |
---|
| 70 | * @generated |
---|
| 71 | */ |
---|
[88] | 72 | protected BnfEntryImpl() |
---|
| 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.BNF_ENTRY; |
---|
| 86 | } |
---|
| 87 | |
---|
| 88 | /** |
---|
| 89 | * <!-- begin-user-doc --> |
---|
| 90 | * <!-- end-user-doc --> |
---|
| 91 | * @generated |
---|
| 92 | */ |
---|
| 93 | public SectionHeading getSectionheader() |
---|
| 94 | { |
---|
| 95 | return sectionheader; |
---|
| 96 | } |
---|
| 97 | |
---|
| 98 | /** |
---|
| 99 | * <!-- begin-user-doc --> |
---|
| 100 | * <!-- end-user-doc --> |
---|
| 101 | * @generated |
---|
| 102 | */ |
---|
| 103 | public NotificationChain basicSetSectionheader(SectionHeading newSectionheader, NotificationChain msgs) |
---|
| 104 | { |
---|
| 105 | SectionHeading oldSectionheader = sectionheader; |
---|
| 106 | sectionheader = newSectionheader; |
---|
| 107 | if (eNotificationRequired()) |
---|
| 108 | { |
---|
| 109 | ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EbnfPackage.BNF_ENTRY__SECTIONHEADER, oldSectionheader, newSectionheader); |
---|
| 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 setSectionheader(SectionHeading newSectionheader) |
---|
| 121 | { |
---|
| 122 | if (newSectionheader != sectionheader) |
---|
| 123 | { |
---|
| 124 | NotificationChain msgs = null; |
---|
| 125 | if (sectionheader != null) |
---|
| 126 | msgs = ((InternalEObject)sectionheader).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EbnfPackage.BNF_ENTRY__SECTIONHEADER, null, msgs); |
---|
| 127 | if (newSectionheader != null) |
---|
| 128 | msgs = ((InternalEObject)newSectionheader).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EbnfPackage.BNF_ENTRY__SECTIONHEADER, null, msgs); |
---|
| 129 | msgs = basicSetSectionheader(newSectionheader, msgs); |
---|
| 130 | if (msgs != null) msgs.dispatch(); |
---|
| 131 | } |
---|
| 132 | else if (eNotificationRequired()) |
---|
| 133 | eNotify(new ENotificationImpl(this, Notification.SET, EbnfPackage.BNF_ENTRY__SECTIONHEADER, newSectionheader, newSectionheader)); |
---|
| 134 | } |
---|
| 135 | |
---|
| 136 | /** |
---|
| 137 | * <!-- begin-user-doc --> |
---|
| 138 | * <!-- end-user-doc --> |
---|
| 139 | * @generated |
---|
| 140 | */ |
---|
| 141 | public Rule getRule() |
---|
| 142 | { |
---|
| 143 | return rule; |
---|
| 144 | } |
---|
| 145 | |
---|
| 146 | /** |
---|
| 147 | * <!-- begin-user-doc --> |
---|
| 148 | * <!-- end-user-doc --> |
---|
| 149 | * @generated |
---|
| 150 | */ |
---|
| 151 | public NotificationChain basicSetRule(Rule newRule, NotificationChain msgs) |
---|
| 152 | { |
---|
| 153 | Rule oldRule = rule; |
---|
| 154 | rule = newRule; |
---|
| 155 | if (eNotificationRequired()) |
---|
| 156 | { |
---|
| 157 | ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EbnfPackage.BNF_ENTRY__RULE, oldRule, newRule); |
---|
| 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 setRule(Rule newRule) |
---|
| 169 | { |
---|
| 170 | if (newRule != rule) |
---|
| 171 | { |
---|
| 172 | NotificationChain msgs = null; |
---|
| 173 | if (rule != null) |
---|
| 174 | msgs = ((InternalEObject)rule).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EbnfPackage.BNF_ENTRY__RULE, null, msgs); |
---|
| 175 | if (newRule != null) |
---|
| 176 | msgs = ((InternalEObject)newRule).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EbnfPackage.BNF_ENTRY__RULE, null, msgs); |
---|
| 177 | msgs = basicSetRule(newRule, msgs); |
---|
| 178 | if (msgs != null) msgs.dispatch(); |
---|
| 179 | } |
---|
| 180 | else if (eNotificationRequired()) |
---|
| 181 | eNotify(new ENotificationImpl(this, Notification.SET, EbnfPackage.BNF_ENTRY__RULE, newRule, newRule)); |
---|
| 182 | } |
---|
| 183 | |
---|
| 184 | /** |
---|
| 185 | * <!-- begin-user-doc --> |
---|
| 186 | * <!-- end-user-doc --> |
---|
| 187 | * @generated |
---|
| 188 | */ |
---|
[100] | 189 | public Comment getComment() |
---|
| 190 | { |
---|
| 191 | return comment; |
---|
| 192 | } |
---|
| 193 | |
---|
| 194 | /** |
---|
| 195 | * <!-- begin-user-doc --> |
---|
| 196 | * <!-- end-user-doc --> |
---|
| 197 | * @generated |
---|
| 198 | */ |
---|
| 199 | public NotificationChain basicSetComment(Comment newComment, NotificationChain msgs) |
---|
| 200 | { |
---|
| 201 | Comment oldComment = comment; |
---|
| 202 | comment = newComment; |
---|
| 203 | if (eNotificationRequired()) |
---|
| 204 | { |
---|
| 205 | ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EbnfPackage.BNF_ENTRY__COMMENT, oldComment, newComment); |
---|
| 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 setComment(Comment newComment) |
---|
| 217 | { |
---|
| 218 | if (newComment != comment) |
---|
| 219 | { |
---|
| 220 | NotificationChain msgs = null; |
---|
| 221 | if (comment != null) |
---|
| 222 | msgs = ((InternalEObject)comment).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EbnfPackage.BNF_ENTRY__COMMENT, null, msgs); |
---|
| 223 | if (newComment != null) |
---|
| 224 | msgs = ((InternalEObject)newComment).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EbnfPackage.BNF_ENTRY__COMMENT, null, msgs); |
---|
| 225 | msgs = basicSetComment(newComment, msgs); |
---|
| 226 | if (msgs != null) msgs.dispatch(); |
---|
| 227 | } |
---|
| 228 | else if (eNotificationRequired()) |
---|
| 229 | eNotify(new ENotificationImpl(this, Notification.SET, EbnfPackage.BNF_ENTRY__COMMENT, newComment, newComment)); |
---|
| 230 | } |
---|
| 231 | |
---|
| 232 | /** |
---|
| 233 | * <!-- begin-user-doc --> |
---|
| 234 | * <!-- end-user-doc --> |
---|
| 235 | * @generated |
---|
| 236 | */ |
---|
[88] | 237 | @Override |
---|
| 238 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) |
---|
| 239 | { |
---|
| 240 | switch (featureID) |
---|
| 241 | { |
---|
| 242 | case EbnfPackage.BNF_ENTRY__SECTIONHEADER: |
---|
| 243 | return basicSetSectionheader(null, msgs); |
---|
| 244 | case EbnfPackage.BNF_ENTRY__RULE: |
---|
| 245 | return basicSetRule(null, msgs); |
---|
[100] | 246 | case EbnfPackage.BNF_ENTRY__COMMENT: |
---|
| 247 | return basicSetComment(null, msgs); |
---|
[88] | 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.BNF_ENTRY__SECTIONHEADER: |
---|
| 263 | return getSectionheader(); |
---|
| 264 | case EbnfPackage.BNF_ENTRY__RULE: |
---|
| 265 | return getRule(); |
---|
[100] | 266 | case EbnfPackage.BNF_ENTRY__COMMENT: |
---|
| 267 | return getComment(); |
---|
[88] | 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.BNF_ENTRY__SECTIONHEADER: |
---|
| 283 | setSectionheader((SectionHeading)newValue); |
---|
| 284 | return; |
---|
| 285 | case EbnfPackage.BNF_ENTRY__RULE: |
---|
| 286 | setRule((Rule)newValue); |
---|
| 287 | return; |
---|
[100] | 288 | case EbnfPackage.BNF_ENTRY__COMMENT: |
---|
| 289 | setComment((Comment)newValue); |
---|
| 290 | return; |
---|
[88] | 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.BNF_ENTRY__SECTIONHEADER: |
---|
| 306 | setSectionheader((SectionHeading)null); |
---|
| 307 | return; |
---|
| 308 | case EbnfPackage.BNF_ENTRY__RULE: |
---|
| 309 | setRule((Rule)null); |
---|
| 310 | return; |
---|
[100] | 311 | case EbnfPackage.BNF_ENTRY__COMMENT: |
---|
| 312 | setComment((Comment)null); |
---|
| 313 | return; |
---|
[88] | 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.BNF_ENTRY__SECTIONHEADER: |
---|
| 329 | return sectionheader != null; |
---|
| 330 | case EbnfPackage.BNF_ENTRY__RULE: |
---|
| 331 | return rule != null; |
---|
[100] | 332 | case EbnfPackage.BNF_ENTRY__COMMENT: |
---|
| 333 | return comment != null; |
---|
[88] | 334 | } |
---|
| 335 | return super.eIsSet(featureID); |
---|
| 336 | } |
---|
| 337 | |
---|
| 338 | } //BnfEntryImpl |
---|