1 | /** |
2 | * Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany |
3 | * |
4 | * $Id$ |
5 | */ |
6 | package de.uka.ipd.sdq.pcm.core.entity.impl; |
7 | |
8 | import java.util.Collection; |
9 | |
10 | import org.eclipse.emf.common.notify.NotificationChain; |
11 | import org.eclipse.emf.common.util.EList; |
12 | import org.eclipse.emf.ecore.EClass; |
13 | import org.eclipse.emf.ecore.InternalEObject; |
14 | import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList; |
15 | import org.eclipse.emf.ecore.util.InternalEList; |
16 | |
17 | import de.uka.ipd.sdq.pcm.core.entity.EntityPackage; |
18 | import de.uka.ipd.sdq.pcm.core.entity.InterfaceProvidingRequiringEntity; |
19 | import de.uka.ipd.sdq.pcm.core.entity.InterfaceRequiringEntity; |
20 | import de.uka.ipd.sdq.pcm.core.entity.ResourceInterfaceRequiringEntity; |
21 | import de.uka.ipd.sdq.pcm.core.entity.ResourceRequiredRole; |
22 | import de.uka.ipd.sdq.pcm.repository.RepositoryPackage; |
23 | import de.uka.ipd.sdq.pcm.repository.RequiredRole; |
24 | |
25 | /** |
26 | * <!-- begin-user-doc --> |
27 | * An implementation of the model object '<em><b>Interface Providing Requiring Entity</b></em>'. |
28 | * <!-- end-user-doc --> |
29 | * <p> |
30 | * The following features are implemented: |
31 | * <ul> |
32 | * <li>{@link de.uka.ipd.sdq.pcm.core.entity.impl.InterfaceProvidingRequiringEntityImpl#getResourceRequiredRoles__ResourceInterfaceRequiringEntity <em>Resource Required Roles Resource Interface Requiring Entity</em>}</li> |
33 | * <li>{@link de.uka.ipd.sdq.pcm.core.entity.impl.InterfaceProvidingRequiringEntityImpl#getRequiredRoles_InterfaceRequiringEntity <em>Required Roles Interface Requiring Entity</em>}</li> |
34 | * </ul> |
35 | * </p> |
36 | * |
37 | * @generated |
38 | */ |
39 | public abstract class InterfaceProvidingRequiringEntityImpl extends InterfaceProvidingEntityImpl implements InterfaceProvidingRequiringEntity { |
40 | /** |
41 | * <!-- begin-user-doc --> |
42 | * <!-- end-user-doc --> |
43 | * @generated |
44 | */ |
45 | public static final String copyright = "Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany"; |
46 | |
47 | /** |
48 | * The cached value of the '{@link #getResourceRequiredRoles__ResourceInterfaceRequiringEntity() <em>Resource Required Roles Resource Interface Requiring Entity</em>}' containment reference list. |
49 | * <!-- begin-user-doc --> |
50 | * <!-- end-user-doc --> |
51 | * @see #getResourceRequiredRoles__ResourceInterfaceRequiringEntity() |
52 | * @generated |
53 | * @ordered |
54 | */ |
55 | protected EList<ResourceRequiredRole> resourceRequiredRoles__ResourceInterfaceRequiringEntity; |
56 | |
57 | /** |
58 | * The cached value of the '{@link #getRequiredRoles_InterfaceRequiringEntity() <em>Required Roles Interface Requiring Entity</em>}' containment reference list. |
59 | * <!-- begin-user-doc --> |
60 | * <!-- end-user-doc --> |
61 | * @see #getRequiredRoles_InterfaceRequiringEntity() |
62 | * @generated |
63 | * @ordered |
64 | */ |
65 | protected EList<RequiredRole> requiredRoles_InterfaceRequiringEntity; |
66 | |
67 | /** |
68 | * <!-- begin-user-doc --> |
69 | * <!-- end-user-doc --> |
70 | * @generated |
71 | */ |
72 | protected InterfaceProvidingRequiringEntityImpl() { |
73 | super(); |
74 | } |
75 | |
76 | /** |
77 | * <!-- begin-user-doc --> |
78 | * <!-- end-user-doc --> |
79 | * @generated |
80 | */ |
81 | @Override |
82 | protected EClass eStaticClass() { |
83 | return EntityPackage.Literals.INTERFACE_PROVIDING_REQUIRING_ENTITY; |
84 | } |
85 | |
86 | /** |
87 | * <!-- begin-user-doc --> |
88 | * <!-- end-user-doc --> |
89 | * @generated |
90 | */ |
91 | public EList<ResourceRequiredRole> getResourceRequiredRoles__ResourceInterfaceRequiringEntity() { |
92 | if (resourceRequiredRoles__ResourceInterfaceRequiringEntity == null) { |
93 | resourceRequiredRoles__ResourceInterfaceRequiringEntity = new EObjectContainmentWithInverseEList<ResourceRequiredRole>(ResourceRequiredRole.class, this, EntityPackage.INTERFACE_PROVIDING_REQUIRING_ENTITY__RESOURCE_REQUIRED_ROLES_RESOURCE_INTERFACE_REQUIRING_ENTITY, EntityPackage.RESOURCE_REQUIRED_ROLE__RESOURCE_INTERFACE_REQUIRING_ENTITY_RESOURCE_REQUIRED_ROLE); |
94 | } |
95 | return resourceRequiredRoles__ResourceInterfaceRequiringEntity; |
96 | } |
97 | |
98 | /** |
99 | * <!-- begin-user-doc --> |
100 | * <!-- end-user-doc --> |
101 | * @generated |
102 | */ |
103 | public EList<RequiredRole> getRequiredRoles_InterfaceRequiringEntity() { |
104 | if (requiredRoles_InterfaceRequiringEntity == null) { |
105 | requiredRoles_InterfaceRequiringEntity = new EObjectContainmentWithInverseEList<RequiredRole>(RequiredRole.class, this, EntityPackage.INTERFACE_PROVIDING_REQUIRING_ENTITY__REQUIRED_ROLES_INTERFACE_REQUIRING_ENTITY, RepositoryPackage.REQUIRED_ROLE__REQUIRING_ENTITY_REQUIRED_ROLE); |
106 | } |
107 | return requiredRoles_InterfaceRequiringEntity; |
108 | } |
109 | |
110 | /** |
111 | * <!-- begin-user-doc --> |
112 | * <!-- end-user-doc --> |
113 | * @generated |
114 | */ |
115 | @SuppressWarnings("unchecked") |
116 | @Override |
117 | public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
118 | switch (featureID) { |
119 | case EntityPackage.INTERFACE_PROVIDING_REQUIRING_ENTITY__RESOURCE_REQUIRED_ROLES_RESOURCE_INTERFACE_REQUIRING_ENTITY: |
120 | return ((InternalEList<InternalEObject>)(InternalEList<?>)getResourceRequiredRoles__ResourceInterfaceRequiringEntity()).basicAdd(otherEnd, msgs); |
121 | case EntityPackage.INTERFACE_PROVIDING_REQUIRING_ENTITY__REQUIRED_ROLES_INTERFACE_REQUIRING_ENTITY: |
122 | return ((InternalEList<InternalEObject>)(InternalEList<?>)getRequiredRoles_InterfaceRequiringEntity()).basicAdd(otherEnd, msgs); |
123 | } |
124 | return super.eInverseAdd(otherEnd, featureID, msgs); |
125 | } |
126 | |
127 | /** |
128 | * <!-- begin-user-doc --> |
129 | * <!-- end-user-doc --> |
130 | * @generated |
131 | */ |
132 | @Override |
133 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
134 | switch (featureID) { |
135 | case EntityPackage.INTERFACE_PROVIDING_REQUIRING_ENTITY__RESOURCE_REQUIRED_ROLES_RESOURCE_INTERFACE_REQUIRING_ENTITY: |
136 | return ((InternalEList<?>)getResourceRequiredRoles__ResourceInterfaceRequiringEntity()).basicRemove(otherEnd, msgs); |
137 | case EntityPackage.INTERFACE_PROVIDING_REQUIRING_ENTITY__REQUIRED_ROLES_INTERFACE_REQUIRING_ENTITY: |
138 | return ((InternalEList<?>)getRequiredRoles_InterfaceRequiringEntity()).basicRemove(otherEnd, msgs); |
139 | } |
140 | return super.eInverseRemove(otherEnd, featureID, msgs); |
141 | } |
142 | |
143 | /** |
144 | * <!-- begin-user-doc --> |
145 | * <!-- end-user-doc --> |
146 | * @generated |
147 | */ |
148 | @Override |
149 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
150 | switch (featureID) { |
151 | case EntityPackage.INTERFACE_PROVIDING_REQUIRING_ENTITY__RESOURCE_REQUIRED_ROLES_RESOURCE_INTERFACE_REQUIRING_ENTITY: |
152 | return getResourceRequiredRoles__ResourceInterfaceRequiringEntity(); |
153 | case EntityPackage.INTERFACE_PROVIDING_REQUIRING_ENTITY__REQUIRED_ROLES_INTERFACE_REQUIRING_ENTITY: |
154 | return getRequiredRoles_InterfaceRequiringEntity(); |
155 | } |
156 | return super.eGet(featureID, resolve, coreType); |
157 | } |
158 | |
159 | /** |
160 | * <!-- begin-user-doc --> |
161 | * <!-- end-user-doc --> |
162 | * @generated |
163 | */ |
164 | @SuppressWarnings("unchecked") |
165 | @Override |
166 | public void eSet(int featureID, Object newValue) { |
167 | switch (featureID) { |
168 | case EntityPackage.INTERFACE_PROVIDING_REQUIRING_ENTITY__RESOURCE_REQUIRED_ROLES_RESOURCE_INTERFACE_REQUIRING_ENTITY: |
169 | getResourceRequiredRoles__ResourceInterfaceRequiringEntity().clear(); |
170 | getResourceRequiredRoles__ResourceInterfaceRequiringEntity().addAll((Collection<? extends ResourceRequiredRole>)newValue); |
171 | return; |
172 | case EntityPackage.INTERFACE_PROVIDING_REQUIRING_ENTITY__REQUIRED_ROLES_INTERFACE_REQUIRING_ENTITY: |
173 | getRequiredRoles_InterfaceRequiringEntity().clear(); |
174 | getRequiredRoles_InterfaceRequiringEntity().addAll((Collection<? extends RequiredRole>)newValue); |
175 | return; |
176 | } |
177 | super.eSet(featureID, newValue); |
178 | } |
179 | |
180 | /** |
181 | * <!-- begin-user-doc --> |
182 | * <!-- end-user-doc --> |
183 | * @generated |
184 | */ |
185 | @Override |
186 | public void eUnset(int featureID) { |
187 | switch (featureID) { |
188 | case EntityPackage.INTERFACE_PROVIDING_REQUIRING_ENTITY__RESOURCE_REQUIRED_ROLES_RESOURCE_INTERFACE_REQUIRING_ENTITY: |
189 | getResourceRequiredRoles__ResourceInterfaceRequiringEntity().clear(); |
190 | return; |
191 | case EntityPackage.INTERFACE_PROVIDING_REQUIRING_ENTITY__REQUIRED_ROLES_INTERFACE_REQUIRING_ENTITY: |
192 | getRequiredRoles_InterfaceRequiringEntity().clear(); |
193 | return; |
194 | } |
195 | super.eUnset(featureID); |
196 | } |
197 | |
198 | /** |
199 | * <!-- begin-user-doc --> |
200 | * <!-- end-user-doc --> |
201 | * @generated |
202 | */ |
203 | @Override |
204 | public boolean eIsSet(int featureID) { |
205 | switch (featureID) { |
206 | case EntityPackage.INTERFACE_PROVIDING_REQUIRING_ENTITY__RESOURCE_REQUIRED_ROLES_RESOURCE_INTERFACE_REQUIRING_ENTITY: |
207 | return resourceRequiredRoles__ResourceInterfaceRequiringEntity != null && !resourceRequiredRoles__ResourceInterfaceRequiringEntity.isEmpty(); |
208 | case EntityPackage.INTERFACE_PROVIDING_REQUIRING_ENTITY__REQUIRED_ROLES_INTERFACE_REQUIRING_ENTITY: |
209 | return requiredRoles_InterfaceRequiringEntity != null && !requiredRoles_InterfaceRequiringEntity.isEmpty(); |
210 | } |
211 | return super.eIsSet(featureID); |
212 | } |
213 | |
214 | /** |
215 | * <!-- begin-user-doc --> |
216 | * <!-- end-user-doc --> |
217 | * @generated |
218 | */ |
219 | @Override |
220 | public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) { |
221 | if (baseClass == ResourceInterfaceRequiringEntity.class) { |
222 | switch (derivedFeatureID) { |
223 | case EntityPackage.INTERFACE_PROVIDING_REQUIRING_ENTITY__RESOURCE_REQUIRED_ROLES_RESOURCE_INTERFACE_REQUIRING_ENTITY: return EntityPackage.RESOURCE_INTERFACE_REQUIRING_ENTITY__RESOURCE_REQUIRED_ROLES_RESOURCE_INTERFACE_REQUIRING_ENTITY; |
224 | default: return -1; |
225 | } |
226 | } |
227 | if (baseClass == InterfaceRequiringEntity.class) { |
228 | switch (derivedFeatureID) { |
229 | case EntityPackage.INTERFACE_PROVIDING_REQUIRING_ENTITY__REQUIRED_ROLES_INTERFACE_REQUIRING_ENTITY: return EntityPackage.INTERFACE_REQUIRING_ENTITY__REQUIRED_ROLES_INTERFACE_REQUIRING_ENTITY; |
230 | default: return -1; |
231 | } |
232 | } |
233 | return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); |
234 | } |
235 | |
236 | /** |
237 | * <!-- begin-user-doc --> |
238 | * <!-- end-user-doc --> |
239 | * @generated |
240 | */ |
241 | @Override |
242 | public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) { |
243 | if (baseClass == ResourceInterfaceRequiringEntity.class) { |
244 | switch (baseFeatureID) { |
245 | case EntityPackage.RESOURCE_INTERFACE_REQUIRING_ENTITY__RESOURCE_REQUIRED_ROLES_RESOURCE_INTERFACE_REQUIRING_ENTITY: return EntityPackage.INTERFACE_PROVIDING_REQUIRING_ENTITY__RESOURCE_REQUIRED_ROLES_RESOURCE_INTERFACE_REQUIRING_ENTITY; |
246 | default: return -1; |
247 | } |
248 | } |
249 | if (baseClass == InterfaceRequiringEntity.class) { |
250 | switch (baseFeatureID) { |
251 | case EntityPackage.INTERFACE_REQUIRING_ENTITY__REQUIRED_ROLES_INTERFACE_REQUIRING_ENTITY: return EntityPackage.INTERFACE_PROVIDING_REQUIRING_ENTITY__REQUIRED_ROLES_INTERFACE_REQUIRING_ENTITY; |
252 | default: return -1; |
253 | } |
254 | } |
255 | return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); |
256 | } |
257 | |
258 | } //InterfaceProvidingRequiringEntityImpl |