1 | /** |
2 | * <copyright> |
3 | * </copyright> |
4 | * |
5 | * $Id$ |
6 | */ |
7 | package EMOF.impl; |
8 | |
9 | import EMOF.Comment; |
10 | import EMOF.EMOFPackage; |
11 | import EMOF.Element; |
12 | import EMOF.Property; |
13 | |
14 | import java.util.Collection; |
15 | |
16 | import org.eclipse.emf.common.notify.NotificationChain; |
17 | |
18 | import org.eclipse.emf.common.util.EList; |
19 | |
20 | import org.eclipse.emf.ecore.EClass; |
21 | import org.eclipse.emf.ecore.InternalEObject; |
22 | |
23 | import org.eclipse.emf.ecore.util.EObjectContainmentEList; |
24 | import org.eclipse.emf.ecore.util.InternalEList; |
25 | |
26 | /** |
27 | * <!-- begin-user-doc --> |
28 | * An implementation of the model object '<em><b>Element</b></em>'. |
29 | * <!-- end-user-doc --> |
30 | * <p> |
31 | * The following features are implemented: |
32 | * <ul> |
33 | * <li>{@link EMOF.impl.ElementImpl#getOwnedComment <em>Owned Comment</em>}</li> |
34 | * </ul> |
35 | * </p> |
36 | * |
37 | * @generated |
38 | */ |
39 | public abstract class ElementImpl extends ObjectImpl implements Element { |
40 | /** |
41 | * The cached value of the '{@link #getOwnedComment() <em>Owned Comment</em>}' containment reference list. |
42 | * <!-- begin-user-doc --> |
43 | * <!-- end-user-doc --> |
44 | * @see #getOwnedComment() |
45 | * @generated |
46 | * @ordered |
47 | */ |
48 | protected EList<Comment> ownedComment; |
49 | |
50 | /** |
51 | * <!-- begin-user-doc --> |
52 | * <!-- end-user-doc --> |
53 | * @generated |
54 | */ |
55 | protected ElementImpl() { |
56 | super(); |
57 | } |
58 | |
59 | /** |
60 | * <!-- begin-user-doc --> |
61 | * <!-- end-user-doc --> |
62 | * @generated |
63 | */ |
64 | @Override |
65 | protected EClass eStaticClass() { |
66 | return EMOFPackage.Literals.ELEMENT; |
67 | } |
68 | |
69 | /** |
70 | * <!-- begin-user-doc --> |
71 | * <!-- end-user-doc --> |
72 | * @generated |
73 | */ |
74 | public EList<Comment> getOwnedComment() { |
75 | if (ownedComment == null) { |
76 | ownedComment = new EObjectContainmentEList<Comment>(Comment.class, this, EMOFPackage.ELEMENT__OWNED_COMMENT); |
77 | } |
78 | return ownedComment; |
79 | } |
80 | |
81 | /** |
82 | * <!-- begin-user-doc --> |
83 | * <!-- end-user-doc --> |
84 | * @generated |
85 | */ |
86 | public Element container() { |
87 | // TODO: implement this method |
88 | // Ensure that you remove @generated or mark it @generated NOT |
89 | throw new UnsupportedOperationException(); |
90 | } |
91 | |
92 | /** |
93 | * <!-- begin-user-doc --> |
94 | * <!-- end-user-doc --> |
95 | * @generated |
96 | */ |
97 | public Boolean equals(EMOF.Object object) { |
98 | // TODO: implement this method |
99 | // Ensure that you remove @generated or mark it @generated NOT |
100 | throw new UnsupportedOperationException(); |
101 | } |
102 | |
103 | /** |
104 | * <!-- begin-user-doc --> |
105 | * <!-- end-user-doc --> |
106 | * @generated |
107 | */ |
108 | public EMOF.Object get(Property property) { |
109 | // TODO: implement this method |
110 | // Ensure that you remove @generated or mark it @generated NOT |
111 | throw new UnsupportedOperationException(); |
112 | } |
113 | |
114 | /** |
115 | * <!-- begin-user-doc --> |
116 | * <!-- end-user-doc --> |
117 | * @generated |
118 | */ |
119 | public EMOF.Class getMetaClass() { |
120 | // TODO: implement this method |
121 | // Ensure that you remove @generated or mark it @generated NOT |
122 | throw new UnsupportedOperationException(); |
123 | } |
124 | |
125 | /** |
126 | * <!-- begin-user-doc --> |
127 | * <!-- end-user-doc --> |
128 | * @generated |
129 | */ |
130 | public Boolean isSet(Property property) { |
131 | // TODO: implement this method |
132 | // Ensure that you remove @generated or mark it @generated NOT |
133 | throw new UnsupportedOperationException(); |
134 | } |
135 | |
136 | /** |
137 | * <!-- begin-user-doc --> |
138 | * <!-- end-user-doc --> |
139 | * @generated |
140 | */ |
141 | public void set(Property property, EMOF.Object object) { |
142 | // TODO: implement this method |
143 | // Ensure that you remove @generated or mark it @generated NOT |
144 | throw new UnsupportedOperationException(); |
145 | } |
146 | |
147 | /** |
148 | * <!-- begin-user-doc --> |
149 | * <!-- end-user-doc --> |
150 | * @generated |
151 | */ |
152 | public void unset(Property property) { |
153 | // TODO: implement this method |
154 | // Ensure that you remove @generated or mark it @generated NOT |
155 | throw new UnsupportedOperationException(); |
156 | } |
157 | |
158 | /** |
159 | * <!-- begin-user-doc --> |
160 | * <!-- end-user-doc --> |
161 | * @generated |
162 | */ |
163 | @Override |
164 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
165 | switch (featureID) { |
166 | case EMOFPackage.ELEMENT__OWNED_COMMENT: |
167 | return ((InternalEList<?>)getOwnedComment()).basicRemove(otherEnd, msgs); |
168 | } |
169 | return super.eInverseRemove(otherEnd, featureID, msgs); |
170 | } |
171 | |
172 | /** |
173 | * <!-- begin-user-doc --> |
174 | * <!-- end-user-doc --> |
175 | * @generated |
176 | */ |
177 | @Override |
178 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
179 | switch (featureID) { |
180 | case EMOFPackage.ELEMENT__OWNED_COMMENT: |
181 | return getOwnedComment(); |
182 | } |
183 | return super.eGet(featureID, resolve, coreType); |
184 | } |
185 | |
186 | /** |
187 | * <!-- begin-user-doc --> |
188 | * <!-- end-user-doc --> |
189 | * @generated |
190 | */ |
191 | @SuppressWarnings("unchecked") |
192 | @Override |
193 | public void eSet(int featureID, Object newValue) { |
194 | switch (featureID) { |
195 | case EMOFPackage.ELEMENT__OWNED_COMMENT: |
196 | getOwnedComment().clear(); |
197 | getOwnedComment().addAll((Collection<? extends Comment>)newValue); |
198 | return; |
199 | } |
200 | super.eSet(featureID, newValue); |
201 | } |
202 | |
203 | /** |
204 | * <!-- begin-user-doc --> |
205 | * <!-- end-user-doc --> |
206 | * @generated |
207 | */ |
208 | @Override |
209 | public void eUnset(int featureID) { |
210 | switch (featureID) { |
211 | case EMOFPackage.ELEMENT__OWNED_COMMENT: |
212 | getOwnedComment().clear(); |
213 | return; |
214 | } |
215 | super.eUnset(featureID); |
216 | } |
217 | |
218 | /** |
219 | * <!-- begin-user-doc --> |
220 | * <!-- end-user-doc --> |
221 | * @generated |
222 | */ |
223 | @Override |
224 | public boolean eIsSet(int featureID) { |
225 | switch (featureID) { |
226 | case EMOFPackage.ELEMENT__OWNED_COMMENT: |
227 | return ownedComment != null && !ownedComment.isEmpty(); |
228 | } |
229 | return super.eIsSet(featureID); |
230 | } |
231 | |
232 | } //ElementImpl |