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.Import; |
---|
7 | import de.ugoe.cs.swe.bnftools.ebnf.ImportSection; |
---|
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>Import Section</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.ImportSectionImpl#getImports <em>Imports</em>}</li> |
---|
31 | * </ul> |
---|
32 | * </p> |
---|
33 | * |
---|
34 | * @generated |
---|
35 | */ |
---|
36 | public class ImportSectionImpl extends MinimalEObjectImpl.Container implements ImportSection |
---|
37 | { |
---|
38 | /** |
---|
39 | * The cached value of the '{@link #getImports() <em>Imports</em>}' containment reference list. |
---|
40 | * <!-- begin-user-doc --> |
---|
41 | * <!-- end-user-doc --> |
---|
42 | * @see #getImports() |
---|
43 | * @generated |
---|
44 | * @ordered |
---|
45 | */ |
---|
46 | protected EList<Import> imports; |
---|
47 | |
---|
48 | /** |
---|
49 | * <!-- begin-user-doc --> |
---|
50 | * <!-- end-user-doc --> |
---|
51 | * @generated |
---|
52 | */ |
---|
53 | protected ImportSectionImpl() |
---|
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.IMPORT_SECTION; |
---|
67 | } |
---|
68 | |
---|
69 | /** |
---|
70 | * <!-- begin-user-doc --> |
---|
71 | * <!-- end-user-doc --> |
---|
72 | * @generated |
---|
73 | */ |
---|
74 | public EList<Import> getImports() |
---|
75 | { |
---|
76 | if (imports == null) |
---|
77 | { |
---|
78 | imports = new EObjectContainmentEList<Import>(Import.class, this, EbnfPackage.IMPORT_SECTION__IMPORTS); |
---|
79 | } |
---|
80 | return imports; |
---|
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.IMPORT_SECTION__IMPORTS: |
---|
94 | return ((InternalEList<?>)getImports()).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.IMPORT_SECTION__IMPORTS: |
---|
110 | return getImports(); |
---|
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.IMPORT_SECTION__IMPORTS: |
---|
127 | getImports().clear(); |
---|
128 | getImports().addAll((Collection<? extends Import>)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.IMPORT_SECTION__IMPORTS: |
---|
145 | getImports().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.IMPORT_SECTION__IMPORTS: |
---|
162 | return imports != null && !imports.isEmpty(); |
---|
163 | } |
---|
164 | return super.eIsSet(featureID); |
---|
165 | } |
---|
166 | |
---|
167 | } //ImportSectionImpl |
---|