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.ResourceInterfaceProvidingEntity; |
19 | import de.uka.ipd.sdq.pcm.core.entity.ResourceProvidedRole; |
20 | |
21 | /** |
22 | * <!-- begin-user-doc --> |
23 | * An implementation of the model object '<em><b>Resource Interface Providing Entity</b></em>'. |
24 | * <!-- end-user-doc --> |
25 | * <p> |
26 | * The following features are implemented: |
27 | * <ul> |
28 | * <li>{@link de.uka.ipd.sdq.pcm.core.entity.impl.ResourceInterfaceProvidingEntityImpl#getResourceProvidedRoles__ResourceInterfaceProvidingEntity <em>Resource Provided Roles Resource Interface Providing Entity</em>}</li> |
29 | * </ul> |
30 | * </p> |
31 | * |
32 | * @generated |
33 | */ |
34 | public class ResourceInterfaceProvidingEntityImpl extends EntityImpl implements ResourceInterfaceProvidingEntity { |
35 | /** |
36 | * <!-- begin-user-doc --> |
37 | * <!-- end-user-doc --> |
38 | * @generated |
39 | */ |
40 | public static final String copyright = "Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany"; |
41 | |
42 | /** |
43 | * The cached value of the '{@link #getResourceProvidedRoles__ResourceInterfaceProvidingEntity() <em>Resource Provided Roles Resource Interface Providing Entity</em>}' containment reference list. |
44 | * <!-- begin-user-doc --> |
45 | * <!-- end-user-doc --> |
46 | * @see #getResourceProvidedRoles__ResourceInterfaceProvidingEntity() |
47 | * @generated |
48 | * @ordered |
49 | */ |
50 | protected EList<ResourceProvidedRole> resourceProvidedRoles__ResourceInterfaceProvidingEntity; |
51 | |
52 | /** |
53 | * <!-- begin-user-doc --> |
54 | * <!-- end-user-doc --> |
55 | * @generated |
56 | */ |
57 | protected ResourceInterfaceProvidingEntityImpl() { |
58 | super(); |
59 | } |
60 | |
61 | /** |
62 | * <!-- begin-user-doc --> |
63 | * <!-- end-user-doc --> |
64 | * @generated |
65 | */ |
66 | @Override |
67 | protected EClass eStaticClass() { |
68 | return EntityPackage.Literals.RESOURCE_INTERFACE_PROVIDING_ENTITY; |
69 | } |
70 | |
71 | /** |
72 | * <!-- begin-user-doc --> |
73 | * <!-- end-user-doc --> |
74 | * @generated |
75 | */ |
76 | public EList<ResourceProvidedRole> getResourceProvidedRoles__ResourceInterfaceProvidingEntity() { |
77 | if (resourceProvidedRoles__ResourceInterfaceProvidingEntity == null) { |
78 | resourceProvidedRoles__ResourceInterfaceProvidingEntity = new EObjectContainmentWithInverseEList<ResourceProvidedRole>(ResourceProvidedRole.class, this, EntityPackage.RESOURCE_INTERFACE_PROVIDING_ENTITY__RESOURCE_PROVIDED_ROLES_RESOURCE_INTERFACE_PROVIDING_ENTITY, EntityPackage.RESOURCE_PROVIDED_ROLE__RESOURCE_INTERFACE_PROVIDING_ENTITY_RESOURCE_PROVIDED_ROLE); |
79 | } |
80 | return resourceProvidedRoles__ResourceInterfaceProvidingEntity; |
81 | } |
82 | |
83 | /** |
84 | * <!-- begin-user-doc --> |
85 | * <!-- end-user-doc --> |
86 | * @generated |
87 | */ |
88 | @SuppressWarnings("unchecked") |
89 | @Override |
90 | public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
91 | switch (featureID) { |
92 | case EntityPackage.RESOURCE_INTERFACE_PROVIDING_ENTITY__RESOURCE_PROVIDED_ROLES_RESOURCE_INTERFACE_PROVIDING_ENTITY: |
93 | return ((InternalEList<InternalEObject>)(InternalEList<?>)getResourceProvidedRoles__ResourceInterfaceProvidingEntity()).basicAdd(otherEnd, msgs); |
94 | } |
95 | return super.eInverseAdd(otherEnd, featureID, msgs); |
96 | } |
97 | |
98 | /** |
99 | * <!-- begin-user-doc --> |
100 | * <!-- end-user-doc --> |
101 | * @generated |
102 | */ |
103 | @Override |
104 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
105 | switch (featureID) { |
106 | case EntityPackage.RESOURCE_INTERFACE_PROVIDING_ENTITY__RESOURCE_PROVIDED_ROLES_RESOURCE_INTERFACE_PROVIDING_ENTITY: |
107 | return ((InternalEList<?>)getResourceProvidedRoles__ResourceInterfaceProvidingEntity()).basicRemove(otherEnd, msgs); |
108 | } |
109 | return super.eInverseRemove(otherEnd, featureID, msgs); |
110 | } |
111 | |
112 | /** |
113 | * <!-- begin-user-doc --> |
114 | * <!-- end-user-doc --> |
115 | * @generated |
116 | */ |
117 | @Override |
118 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
119 | switch (featureID) { |
120 | case EntityPackage.RESOURCE_INTERFACE_PROVIDING_ENTITY__RESOURCE_PROVIDED_ROLES_RESOURCE_INTERFACE_PROVIDING_ENTITY: |
121 | return getResourceProvidedRoles__ResourceInterfaceProvidingEntity(); |
122 | } |
123 | return super.eGet(featureID, resolve, coreType); |
124 | } |
125 | |
126 | /** |
127 | * <!-- begin-user-doc --> |
128 | * <!-- end-user-doc --> |
129 | * @generated |
130 | */ |
131 | @SuppressWarnings("unchecked") |
132 | @Override |
133 | public void eSet(int featureID, Object newValue) { |
134 | switch (featureID) { |
135 | case EntityPackage.RESOURCE_INTERFACE_PROVIDING_ENTITY__RESOURCE_PROVIDED_ROLES_RESOURCE_INTERFACE_PROVIDING_ENTITY: |
136 | getResourceProvidedRoles__ResourceInterfaceProvidingEntity().clear(); |
137 | getResourceProvidedRoles__ResourceInterfaceProvidingEntity().addAll((Collection<? extends ResourceProvidedRole>)newValue); |
138 | return; |
139 | } |
140 | super.eSet(featureID, newValue); |
141 | } |
142 | |
143 | /** |
144 | * <!-- begin-user-doc --> |
145 | * <!-- end-user-doc --> |
146 | * @generated |
147 | */ |
148 | @Override |
149 | public void eUnset(int featureID) { |
150 | switch (featureID) { |
151 | case EntityPackage.RESOURCE_INTERFACE_PROVIDING_ENTITY__RESOURCE_PROVIDED_ROLES_RESOURCE_INTERFACE_PROVIDING_ENTITY: |
152 | getResourceProvidedRoles__ResourceInterfaceProvidingEntity().clear(); |
153 | return; |
154 | } |
155 | super.eUnset(featureID); |
156 | } |
157 | |
158 | /** |
159 | * <!-- begin-user-doc --> |
160 | * <!-- end-user-doc --> |
161 | * @generated |
162 | */ |
163 | @Override |
164 | public boolean eIsSet(int featureID) { |
165 | switch (featureID) { |
166 | case EntityPackage.RESOURCE_INTERFACE_PROVIDING_ENTITY__RESOURCE_PROVIDED_ROLES_RESOURCE_INTERFACE_PROVIDING_ENTITY: |
167 | return resourceProvidedRoles__ResourceInterfaceProvidingEntity != null && !resourceProvidedRoles__ResourceInterfaceProvidingEntity.isEmpty(); |
168 | } |
169 | return super.eIsSet(featureID); |
170 | } |
171 | |
172 | } //ResourceInterfaceProvidingEntityImpl |