1 | /** |
2 | * Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany |
3 | * |
4 | * $Id$ |
5 | */ |
6 | package de.uka.ipd.sdq.pcm.resourcetype.impl; |
7 | |
8 | import org.eclipse.emf.common.notify.Notification; |
9 | import org.eclipse.emf.common.notify.NotificationChain; |
10 | import org.eclipse.emf.ecore.EClass; |
11 | import org.eclipse.emf.ecore.InternalEObject; |
12 | import org.eclipse.emf.ecore.impl.ENotificationImpl; |
13 | |
14 | import de.uka.ipd.sdq.pcm.reliability.NetworkInducedFailureType; |
15 | import de.uka.ipd.sdq.pcm.reliability.ReliabilityPackage; |
16 | import de.uka.ipd.sdq.pcm.resourcetype.CommunicationLinkResourceType; |
17 | import de.uka.ipd.sdq.pcm.resourcetype.ResourcetypePackage; |
18 | |
19 | /** |
20 | * <!-- begin-user-doc --> |
21 | * An implementation of the model object '<em><b>Communication Link Resource Type</b></em>'. |
22 | * <!-- end-user-doc --> |
23 | * <p> |
24 | * The following features are implemented: |
25 | * <ul> |
26 | * <li>{@link de.uka.ipd.sdq.pcm.resourcetype.impl.CommunicationLinkResourceTypeImpl#getNetworkInducedFailureType__CommunicationLinkResourceType <em>Network Induced Failure Type Communication Link Resource Type</em>}</li> |
27 | * </ul> |
28 | * </p> |
29 | * |
30 | * @generated |
31 | */ |
32 | public class CommunicationLinkResourceTypeImpl extends ProcessingResourceTypeImpl implements CommunicationLinkResourceType { |
33 | /** |
34 | * <!-- begin-user-doc --> |
35 | * <!-- end-user-doc --> |
36 | * @generated |
37 | */ |
38 | public static final String copyright = "Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany"; |
39 | |
40 | /** |
41 | * The cached value of the '{@link #getNetworkInducedFailureType__CommunicationLinkResourceType() <em>Network Induced Failure Type Communication Link Resource Type</em>}' reference. |
42 | * <!-- begin-user-doc --> |
43 | * <!-- end-user-doc --> |
44 | * @see #getNetworkInducedFailureType__CommunicationLinkResourceType() |
45 | * @generated |
46 | * @ordered |
47 | */ |
48 | protected NetworkInducedFailureType networkInducedFailureType__CommunicationLinkResourceType; |
49 | |
50 | /** |
51 | * <!-- begin-user-doc --> |
52 | * <!-- end-user-doc --> |
53 | * @generated |
54 | */ |
55 | protected CommunicationLinkResourceTypeImpl() { |
56 | super(); |
57 | } |
58 | |
59 | /** |
60 | * <!-- begin-user-doc --> |
61 | * <!-- end-user-doc --> |
62 | * @generated |
63 | */ |
64 | @Override |
65 | protected EClass eStaticClass() { |
66 | return ResourcetypePackage.Literals.COMMUNICATION_LINK_RESOURCE_TYPE; |
67 | } |
68 | |
69 | /** |
70 | * <!-- begin-user-doc --> |
71 | * <!-- end-user-doc --> |
72 | * @generated |
73 | */ |
74 | public NetworkInducedFailureType getNetworkInducedFailureType__CommunicationLinkResourceType() { |
75 | if (networkInducedFailureType__CommunicationLinkResourceType != null && networkInducedFailureType__CommunicationLinkResourceType.eIsProxy()) { |
76 | InternalEObject oldNetworkInducedFailureType__CommunicationLinkResourceType = (InternalEObject)networkInducedFailureType__CommunicationLinkResourceType; |
77 | networkInducedFailureType__CommunicationLinkResourceType = (NetworkInducedFailureType)eResolveProxy(oldNetworkInducedFailureType__CommunicationLinkResourceType); |
78 | if (networkInducedFailureType__CommunicationLinkResourceType != oldNetworkInducedFailureType__CommunicationLinkResourceType) { |
79 | if (eNotificationRequired()) |
80 | eNotify(new ENotificationImpl(this, Notification.RESOLVE, ResourcetypePackage.COMMUNICATION_LINK_RESOURCE_TYPE__NETWORK_INDUCED_FAILURE_TYPE_COMMUNICATION_LINK_RESOURCE_TYPE, oldNetworkInducedFailureType__CommunicationLinkResourceType, networkInducedFailureType__CommunicationLinkResourceType)); |
81 | } |
82 | } |
83 | return networkInducedFailureType__CommunicationLinkResourceType; |
84 | } |
85 | |
86 | /** |
87 | * <!-- begin-user-doc --> |
88 | * <!-- end-user-doc --> |
89 | * @generated |
90 | */ |
91 | public NetworkInducedFailureType basicGetNetworkInducedFailureType__CommunicationLinkResourceType() { |
92 | return networkInducedFailureType__CommunicationLinkResourceType; |
93 | } |
94 | |
95 | /** |
96 | * <!-- begin-user-doc --> |
97 | * <!-- end-user-doc --> |
98 | * @generated |
99 | */ |
100 | public NotificationChain basicSetNetworkInducedFailureType__CommunicationLinkResourceType(NetworkInducedFailureType newNetworkInducedFailureType__CommunicationLinkResourceType, NotificationChain msgs) { |
101 | NetworkInducedFailureType oldNetworkInducedFailureType__CommunicationLinkResourceType = networkInducedFailureType__CommunicationLinkResourceType; |
102 | networkInducedFailureType__CommunicationLinkResourceType = newNetworkInducedFailureType__CommunicationLinkResourceType; |
103 | if (eNotificationRequired()) { |
104 | ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ResourcetypePackage.COMMUNICATION_LINK_RESOURCE_TYPE__NETWORK_INDUCED_FAILURE_TYPE_COMMUNICATION_LINK_RESOURCE_TYPE, oldNetworkInducedFailureType__CommunicationLinkResourceType, newNetworkInducedFailureType__CommunicationLinkResourceType); |
105 | if (msgs == null) msgs = notification; else msgs.add(notification); |
106 | } |
107 | return msgs; |
108 | } |
109 | |
110 | /** |
111 | * <!-- begin-user-doc --> |
112 | * <!-- end-user-doc --> |
113 | * @generated |
114 | */ |
115 | public void setNetworkInducedFailureType__CommunicationLinkResourceType(NetworkInducedFailureType newNetworkInducedFailureType__CommunicationLinkResourceType) { |
116 | if (newNetworkInducedFailureType__CommunicationLinkResourceType != networkInducedFailureType__CommunicationLinkResourceType) { |
117 | NotificationChain msgs = null; |
118 | if (networkInducedFailureType__CommunicationLinkResourceType != null) |
119 | msgs = ((InternalEObject)networkInducedFailureType__CommunicationLinkResourceType).eInverseRemove(this, ReliabilityPackage.NETWORK_INDUCED_FAILURE_TYPE__COMMUNICATION_LINK_RESOURCE_TYPE_NETWORK_INDUCED_FAILURE_TYPE, NetworkInducedFailureType.class, msgs); |
120 | if (newNetworkInducedFailureType__CommunicationLinkResourceType != null) |
121 | msgs = ((InternalEObject)newNetworkInducedFailureType__CommunicationLinkResourceType).eInverseAdd(this, ReliabilityPackage.NETWORK_INDUCED_FAILURE_TYPE__COMMUNICATION_LINK_RESOURCE_TYPE_NETWORK_INDUCED_FAILURE_TYPE, NetworkInducedFailureType.class, msgs); |
122 | msgs = basicSetNetworkInducedFailureType__CommunicationLinkResourceType(newNetworkInducedFailureType__CommunicationLinkResourceType, msgs); |
123 | if (msgs != null) msgs.dispatch(); |
124 | } |
125 | else if (eNotificationRequired()) |
126 | eNotify(new ENotificationImpl(this, Notification.SET, ResourcetypePackage.COMMUNICATION_LINK_RESOURCE_TYPE__NETWORK_INDUCED_FAILURE_TYPE_COMMUNICATION_LINK_RESOURCE_TYPE, newNetworkInducedFailureType__CommunicationLinkResourceType, newNetworkInducedFailureType__CommunicationLinkResourceType)); |
127 | } |
128 | |
129 | /** |
130 | * <!-- begin-user-doc --> |
131 | * <!-- end-user-doc --> |
132 | * @generated |
133 | */ |
134 | @Override |
135 | public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
136 | switch (featureID) { |
137 | case ResourcetypePackage.COMMUNICATION_LINK_RESOURCE_TYPE__NETWORK_INDUCED_FAILURE_TYPE_COMMUNICATION_LINK_RESOURCE_TYPE: |
138 | if (networkInducedFailureType__CommunicationLinkResourceType != null) |
139 | msgs = ((InternalEObject)networkInducedFailureType__CommunicationLinkResourceType).eInverseRemove(this, ReliabilityPackage.NETWORK_INDUCED_FAILURE_TYPE__COMMUNICATION_LINK_RESOURCE_TYPE_NETWORK_INDUCED_FAILURE_TYPE, NetworkInducedFailureType.class, msgs); |
140 | return basicSetNetworkInducedFailureType__CommunicationLinkResourceType((NetworkInducedFailureType)otherEnd, msgs); |
141 | } |
142 | return super.eInverseAdd(otherEnd, featureID, msgs); |
143 | } |
144 | |
145 | /** |
146 | * <!-- begin-user-doc --> |
147 | * <!-- end-user-doc --> |
148 | * @generated |
149 | */ |
150 | @Override |
151 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
152 | switch (featureID) { |
153 | case ResourcetypePackage.COMMUNICATION_LINK_RESOURCE_TYPE__NETWORK_INDUCED_FAILURE_TYPE_COMMUNICATION_LINK_RESOURCE_TYPE: |
154 | return basicSetNetworkInducedFailureType__CommunicationLinkResourceType(null, msgs); |
155 | } |
156 | return super.eInverseRemove(otherEnd, featureID, msgs); |
157 | } |
158 | |
159 | /** |
160 | * <!-- begin-user-doc --> |
161 | * <!-- end-user-doc --> |
162 | * @generated |
163 | */ |
164 | @Override |
165 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
166 | switch (featureID) { |
167 | case ResourcetypePackage.COMMUNICATION_LINK_RESOURCE_TYPE__NETWORK_INDUCED_FAILURE_TYPE_COMMUNICATION_LINK_RESOURCE_TYPE: |
168 | if (resolve) return getNetworkInducedFailureType__CommunicationLinkResourceType(); |
169 | return basicGetNetworkInducedFailureType__CommunicationLinkResourceType(); |
170 | } |
171 | return super.eGet(featureID, resolve, coreType); |
172 | } |
173 | |
174 | /** |
175 | * <!-- begin-user-doc --> |
176 | * <!-- end-user-doc --> |
177 | * @generated |
178 | */ |
179 | @Override |
180 | public void eSet(int featureID, Object newValue) { |
181 | switch (featureID) { |
182 | case ResourcetypePackage.COMMUNICATION_LINK_RESOURCE_TYPE__NETWORK_INDUCED_FAILURE_TYPE_COMMUNICATION_LINK_RESOURCE_TYPE: |
183 | setNetworkInducedFailureType__CommunicationLinkResourceType((NetworkInducedFailureType)newValue); |
184 | return; |
185 | } |
186 | super.eSet(featureID, newValue); |
187 | } |
188 | |
189 | /** |
190 | * <!-- begin-user-doc --> |
191 | * <!-- end-user-doc --> |
192 | * @generated |
193 | */ |
194 | @Override |
195 | public void eUnset(int featureID) { |
196 | switch (featureID) { |
197 | case ResourcetypePackage.COMMUNICATION_LINK_RESOURCE_TYPE__NETWORK_INDUCED_FAILURE_TYPE_COMMUNICATION_LINK_RESOURCE_TYPE: |
198 | setNetworkInducedFailureType__CommunicationLinkResourceType((NetworkInducedFailureType)null); |
199 | return; |
200 | } |
201 | super.eUnset(featureID); |
202 | } |
203 | |
204 | /** |
205 | * <!-- begin-user-doc --> |
206 | * <!-- end-user-doc --> |
207 | * @generated |
208 | */ |
209 | @Override |
210 | public boolean eIsSet(int featureID) { |
211 | switch (featureID) { |
212 | case ResourcetypePackage.COMMUNICATION_LINK_RESOURCE_TYPE__NETWORK_INDUCED_FAILURE_TYPE_COMMUNICATION_LINK_RESOURCE_TYPE: |
213 | return networkInducedFailureType__CommunicationLinkResourceType != null; |
214 | } |
215 | return super.eIsSet(featureID); |
216 | } |
217 | |
218 | } //CommunicationLinkResourceTypeImpl |