[61] | 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.SingleDefinition;
|
---|
| 7 | import de.ugoe.cs.swe.bnftools.ebnf.Term;
|
---|
| 8 |
|
---|
| 9 | import java.util.Collection;
|
---|
| 10 |
|
---|
| 11 | import org.eclipse.emf.common.notify.NotificationChain;
|
---|
| 12 |
|
---|
| 13 | import org.eclipse.emf.common.util.EList;
|
---|
| 14 |
|
---|
| 15 | import org.eclipse.emf.ecore.EClass;
|
---|
| 16 | import org.eclipse.emf.ecore.InternalEObject;
|
---|
| 17 |
|
---|
| 18 | import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
|
---|
| 19 |
|
---|
| 20 | import org.eclipse.emf.ecore.util.EObjectContainmentEList;
|
---|
| 21 | import org.eclipse.emf.ecore.util.InternalEList;
|
---|
| 22 |
|
---|
| 23 | /**
|
---|
| 24 | * <!-- begin-user-doc -->
|
---|
| 25 | * An implementation of the model object '<em><b>Single Definition</b></em>'.
|
---|
| 26 | * <!-- end-user-doc -->
|
---|
| 27 | * <p>
|
---|
| 28 | * The following features are implemented:
|
---|
| 29 | * <ul>
|
---|
| 30 | * <li>{@link de.ugoe.cs.swe.bnftools.ebnf.impl.SingleDefinitionImpl#getTerms <em>Terms</em>}</li>
|
---|
| 31 | * </ul>
|
---|
| 32 | * </p>
|
---|
| 33 | *
|
---|
| 34 | * @generated
|
---|
| 35 | */
|
---|
| 36 | public class SingleDefinitionImpl extends MinimalEObjectImpl.Container implements SingleDefinition
|
---|
| 37 | {
|
---|
| 38 | /**
|
---|
| 39 | * The cached value of the '{@link #getTerms() <em>Terms</em>}' containment reference list.
|
---|
| 40 | * <!-- begin-user-doc -->
|
---|
| 41 | * <!-- end-user-doc -->
|
---|
| 42 | * @see #getTerms()
|
---|
| 43 | * @generated
|
---|
| 44 | * @ordered
|
---|
| 45 | */
|
---|
| 46 | protected EList<Term> terms;
|
---|
| 47 |
|
---|
| 48 | /**
|
---|
| 49 | * <!-- begin-user-doc -->
|
---|
| 50 | * <!-- end-user-doc -->
|
---|
| 51 | * @generated
|
---|
| 52 | */
|
---|
| 53 | protected SingleDefinitionImpl()
|
---|
| 54 | {
|
---|
| 55 | super();
|
---|
| 56 | }
|
---|
| 57 |
|
---|
| 58 | /**
|
---|
| 59 | * <!-- begin-user-doc -->
|
---|
| 60 | * <!-- end-user-doc -->
|
---|
| 61 | * @generated
|
---|
| 62 | */
|
---|
| 63 | @Override
|
---|
| 64 | protected EClass eStaticClass()
|
---|
| 65 | {
|
---|
| 66 | return EbnfPackage.Literals.SINGLE_DEFINITION;
|
---|
| 67 | }
|
---|
| 68 |
|
---|
| 69 | /**
|
---|
| 70 | * <!-- begin-user-doc -->
|
---|
| 71 | * <!-- end-user-doc -->
|
---|
| 72 | * @generated
|
---|
| 73 | */
|
---|
| 74 | public EList<Term> getTerms()
|
---|
| 75 | {
|
---|
| 76 | if (terms == null)
|
---|
| 77 | {
|
---|
| 78 | terms = new EObjectContainmentEList<Term>(Term.class, this, EbnfPackage.SINGLE_DEFINITION__TERMS);
|
---|
| 79 | }
|
---|
| 80 | return terms;
|
---|
| 81 | }
|
---|
| 82 |
|
---|
| 83 | /**
|
---|
| 84 | * <!-- begin-user-doc -->
|
---|
| 85 | * <!-- end-user-doc -->
|
---|
| 86 | * @generated
|
---|
| 87 | */
|
---|
| 88 | @Override
|
---|
| 89 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
|
---|
| 90 | {
|
---|
| 91 | switch (featureID)
|
---|
| 92 | {
|
---|
| 93 | case EbnfPackage.SINGLE_DEFINITION__TERMS:
|
---|
| 94 | return ((InternalEList<?>)getTerms()).basicRemove(otherEnd, msgs);
|
---|
| 95 | }
|
---|
| 96 | return super.eInverseRemove(otherEnd, featureID, msgs);
|
---|
| 97 | }
|
---|
| 98 |
|
---|
| 99 | /**
|
---|
| 100 | * <!-- begin-user-doc -->
|
---|
| 101 | * <!-- end-user-doc -->
|
---|
| 102 | * @generated
|
---|
| 103 | */
|
---|
| 104 | @Override
|
---|
| 105 | public Object eGet(int featureID, boolean resolve, boolean coreType)
|
---|
| 106 | {
|
---|
| 107 | switch (featureID)
|
---|
| 108 | {
|
---|
| 109 | case EbnfPackage.SINGLE_DEFINITION__TERMS:
|
---|
| 110 | return getTerms();
|
---|
| 111 | }
|
---|
| 112 | return super.eGet(featureID, resolve, coreType);
|
---|
| 113 | }
|
---|
| 114 |
|
---|
| 115 | /**
|
---|
| 116 | * <!-- begin-user-doc -->
|
---|
| 117 | * <!-- end-user-doc -->
|
---|
| 118 | * @generated
|
---|
| 119 | */
|
---|
| 120 | @SuppressWarnings("unchecked")
|
---|
| 121 | @Override
|
---|
| 122 | public void eSet(int featureID, Object newValue)
|
---|
| 123 | {
|
---|
| 124 | switch (featureID)
|
---|
| 125 | {
|
---|
| 126 | case EbnfPackage.SINGLE_DEFINITION__TERMS:
|
---|
| 127 | getTerms().clear();
|
---|
| 128 | getTerms().addAll((Collection<? extends Term>)newValue);
|
---|
| 129 | return;
|
---|
| 130 | }
|
---|
| 131 | super.eSet(featureID, newValue);
|
---|
| 132 | }
|
---|
| 133 |
|
---|
| 134 | /**
|
---|
| 135 | * <!-- begin-user-doc -->
|
---|
| 136 | * <!-- end-user-doc -->
|
---|
| 137 | * @generated
|
---|
| 138 | */
|
---|
| 139 | @Override
|
---|
| 140 | public void eUnset(int featureID)
|
---|
| 141 | {
|
---|
| 142 | switch (featureID)
|
---|
| 143 | {
|
---|
| 144 | case EbnfPackage.SINGLE_DEFINITION__TERMS:
|
---|
| 145 | getTerms().clear();
|
---|
| 146 | return;
|
---|
| 147 | }
|
---|
| 148 | super.eUnset(featureID);
|
---|
| 149 | }
|
---|
| 150 |
|
---|
| 151 | /**
|
---|
| 152 | * <!-- begin-user-doc -->
|
---|
| 153 | * <!-- end-user-doc -->
|
---|
| 154 | * @generated
|
---|
| 155 | */
|
---|
| 156 | @Override
|
---|
| 157 | public boolean eIsSet(int featureID)
|
---|
| 158 | {
|
---|
| 159 | switch (featureID)
|
---|
| 160 | {
|
---|
| 161 | case EbnfPackage.SINGLE_DEFINITION__TERMS:
|
---|
| 162 | return terms != null && !terms.isEmpty();
|
---|
| 163 | }
|
---|
| 164 | return super.eIsSet(featureID);
|
---|
| 165 | }
|
---|
| 166 |
|
---|
| 167 | } //SingleDefinitionImpl
|
---|