1 | /** |
2 | * <copyright> |
3 | * </copyright> |
4 | * |
5 | * $Id$ |
6 | */ |
7 | package de.uka.ipd.sdq.sensitivity.impl; |
8 | |
9 | import de.uka.ipd.sdq.pcm.resourceenvironment.CommunicationLinkResourceSpecification; |
10 | |
11 | import de.uka.ipd.sdq.sensitivity.CommunicationLinkReliabilityParameter; |
12 | import de.uka.ipd.sdq.sensitivity.SensitivityPackage; |
13 | |
14 | import de.uka.ipd.sdq.sensitivity.util.SensitivityValidator; |
15 | |
16 | import java.util.Map; |
17 | |
18 | import org.eclipse.emf.common.notify.Notification; |
19 | |
20 | import org.eclipse.emf.common.util.BasicDiagnostic; |
21 | import org.eclipse.emf.common.util.Diagnostic; |
22 | import org.eclipse.emf.common.util.DiagnosticChain; |
23 | |
24 | import org.eclipse.emf.ecore.EClass; |
25 | import org.eclipse.emf.ecore.InternalEObject; |
26 | |
27 | import org.eclipse.emf.ecore.impl.ENotificationImpl; |
28 | |
29 | import org.eclipse.emf.ecore.plugin.EcorePlugin; |
30 | |
31 | import org.eclipse.emf.ecore.util.EObjectValidator; |
32 | |
33 | /** |
34 | * <!-- begin-user-doc --> |
35 | * An implementation of the model object '<em><b>Communication Link Reliability Parameter</b></em>'. |
36 | * <!-- end-user-doc --> |
37 | * <p> |
38 | * The following features are implemented: |
39 | * <ul> |
40 | * <li>{@link de.uka.ipd.sdq.sensitivity.impl.CommunicationLinkReliabilityParameterImpl#getCommunicationLinkResourceSpecification__CommunicationLinkReliabilityParameter <em>Communication Link Resource Specification Communication Link Reliability Parameter</em>}</li> |
41 | * </ul> |
42 | * </p> |
43 | * |
44 | * @generated |
45 | */ |
46 | public class CommunicationLinkReliabilityParameterImpl extends SingleSensitivityParameterImpl implements CommunicationLinkReliabilityParameter { |
47 | /** |
48 | * The cached value of the '{@link #getCommunicationLinkResourceSpecification__CommunicationLinkReliabilityParameter() <em>Communication Link Resource Specification Communication Link Reliability Parameter</em>}' reference. |
49 | * <!-- begin-user-doc --> |
50 | * <!-- end-user-doc --> |
51 | * @see #getCommunicationLinkResourceSpecification__CommunicationLinkReliabilityParameter() |
52 | * @generated |
53 | * @ordered |
54 | */ |
55 | protected CommunicationLinkResourceSpecification communicationLinkResourceSpecification__CommunicationLinkReliabilityParameter; |
56 | |
57 | /** |
58 | * <!-- begin-user-doc --> |
59 | * <!-- end-user-doc --> |
60 | * @generated |
61 | */ |
62 | protected CommunicationLinkReliabilityParameterImpl() { |
63 | super(); |
64 | } |
65 | |
66 | /** |
67 | * <!-- begin-user-doc --> |
68 | * <!-- end-user-doc --> |
69 | * @generated |
70 | */ |
71 | @Override |
72 | protected EClass eStaticClass() { |
73 | return SensitivityPackage.Literals.COMMUNICATION_LINK_RELIABILITY_PARAMETER; |
74 | } |
75 | |
76 | /** |
77 | * <!-- begin-user-doc --> |
78 | * <!-- end-user-doc --> |
79 | * @generated |
80 | */ |
81 | public CommunicationLinkResourceSpecification getCommunicationLinkResourceSpecification__CommunicationLinkReliabilityParameter() { |
82 | if (communicationLinkResourceSpecification__CommunicationLinkReliabilityParameter != null && communicationLinkResourceSpecification__CommunicationLinkReliabilityParameter.eIsProxy()) { |
83 | InternalEObject oldCommunicationLinkResourceSpecification__CommunicationLinkReliabilityParameter = (InternalEObject)communicationLinkResourceSpecification__CommunicationLinkReliabilityParameter; |
84 | communicationLinkResourceSpecification__CommunicationLinkReliabilityParameter = (CommunicationLinkResourceSpecification)eResolveProxy(oldCommunicationLinkResourceSpecification__CommunicationLinkReliabilityParameter); |
85 | if (communicationLinkResourceSpecification__CommunicationLinkReliabilityParameter != oldCommunicationLinkResourceSpecification__CommunicationLinkReliabilityParameter) { |
86 | if (eNotificationRequired()) |
87 | eNotify(new ENotificationImpl(this, Notification.RESOLVE, SensitivityPackage.COMMUNICATION_LINK_RELIABILITY_PARAMETER__COMMUNICATION_LINK_RESOURCE_SPECIFICATION_COMMUNICATION_LINK_RELIABILITY_PARAMETER, oldCommunicationLinkResourceSpecification__CommunicationLinkReliabilityParameter, communicationLinkResourceSpecification__CommunicationLinkReliabilityParameter)); |
88 | } |
89 | } |
90 | return communicationLinkResourceSpecification__CommunicationLinkReliabilityParameter; |
91 | } |
92 | |
93 | /** |
94 | * <!-- begin-user-doc --> |
95 | * <!-- end-user-doc --> |
96 | * @generated |
97 | */ |
98 | public CommunicationLinkResourceSpecification basicGetCommunicationLinkResourceSpecification__CommunicationLinkReliabilityParameter() { |
99 | return communicationLinkResourceSpecification__CommunicationLinkReliabilityParameter; |
100 | } |
101 | |
102 | /** |
103 | * <!-- begin-user-doc --> |
104 | * <!-- end-user-doc --> |
105 | * @generated |
106 | */ |
107 | public void setCommunicationLinkResourceSpecification__CommunicationLinkReliabilityParameter(CommunicationLinkResourceSpecification newCommunicationLinkResourceSpecification__CommunicationLinkReliabilityParameter) { |
108 | CommunicationLinkResourceSpecification oldCommunicationLinkResourceSpecification__CommunicationLinkReliabilityParameter = communicationLinkResourceSpecification__CommunicationLinkReliabilityParameter; |
109 | communicationLinkResourceSpecification__CommunicationLinkReliabilityParameter = newCommunicationLinkResourceSpecification__CommunicationLinkReliabilityParameter; |
110 | if (eNotificationRequired()) |
111 | eNotify(new ENotificationImpl(this, Notification.SET, SensitivityPackage.COMMUNICATION_LINK_RELIABILITY_PARAMETER__COMMUNICATION_LINK_RESOURCE_SPECIFICATION_COMMUNICATION_LINK_RELIABILITY_PARAMETER, oldCommunicationLinkResourceSpecification__CommunicationLinkReliabilityParameter, communicationLinkResourceSpecification__CommunicationLinkReliabilityParameter)); |
112 | } |
113 | |
114 | /** |
115 | * <!-- begin-user-doc --> |
116 | * <!-- end-user-doc --> |
117 | * @generated |
118 | */ |
119 | public boolean CommunicationLinkParameterMustHaveDoubleVariation(DiagnosticChain diagnostics, Map<Object, Object> context) { |
120 | // TODO: implement this method |
121 | // -> specify the condition that violates the invariant |
122 | // -> verify the details of the diagnostic, including severity and message |
123 | // Ensure that you remove @generated or mark it @generated NOT |
124 | if (false) { |
125 | if (diagnostics != null) { |
126 | diagnostics.add |
127 | (new BasicDiagnostic |
128 | (Diagnostic.ERROR, |
129 | SensitivityValidator.DIAGNOSTIC_SOURCE, |
130 | SensitivityValidator.COMMUNICATION_LINK_RELIABILITY_PARAMETER__COMMUNICATION_LINK_PARAMETER_MUST_HAVE_DOUBLE_VARIATION, |
131 | EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "CommunicationLinkParameterMustHaveDoubleVariation", EObjectValidator.getObjectLabel(this, context) }), |
132 | new Object [] { this })); |
133 | } |
134 | return false; |
135 | } |
136 | return true; |
137 | } |
138 | |
139 | /** |
140 | * <!-- begin-user-doc --> |
141 | * <!-- end-user-doc --> |
142 | * @generated |
143 | */ |
144 | @Override |
145 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
146 | switch (featureID) { |
147 | case SensitivityPackage.COMMUNICATION_LINK_RELIABILITY_PARAMETER__COMMUNICATION_LINK_RESOURCE_SPECIFICATION_COMMUNICATION_LINK_RELIABILITY_PARAMETER: |
148 | if (resolve) return getCommunicationLinkResourceSpecification__CommunicationLinkReliabilityParameter(); |
149 | return basicGetCommunicationLinkResourceSpecification__CommunicationLinkReliabilityParameter(); |
150 | } |
151 | return super.eGet(featureID, resolve, coreType); |
152 | } |
153 | |
154 | /** |
155 | * <!-- begin-user-doc --> |
156 | * <!-- end-user-doc --> |
157 | * @generated |
158 | */ |
159 | @Override |
160 | public void eSet(int featureID, Object newValue) { |
161 | switch (featureID) { |
162 | case SensitivityPackage.COMMUNICATION_LINK_RELIABILITY_PARAMETER__COMMUNICATION_LINK_RESOURCE_SPECIFICATION_COMMUNICATION_LINK_RELIABILITY_PARAMETER: |
163 | setCommunicationLinkResourceSpecification__CommunicationLinkReliabilityParameter((CommunicationLinkResourceSpecification)newValue); |
164 | return; |
165 | } |
166 | super.eSet(featureID, newValue); |
167 | } |
168 | |
169 | /** |
170 | * <!-- begin-user-doc --> |
171 | * <!-- end-user-doc --> |
172 | * @generated |
173 | */ |
174 | @Override |
175 | public void eUnset(int featureID) { |
176 | switch (featureID) { |
177 | case SensitivityPackage.COMMUNICATION_LINK_RELIABILITY_PARAMETER__COMMUNICATION_LINK_RESOURCE_SPECIFICATION_COMMUNICATION_LINK_RELIABILITY_PARAMETER: |
178 | setCommunicationLinkResourceSpecification__CommunicationLinkReliabilityParameter((CommunicationLinkResourceSpecification)null); |
179 | return; |
180 | } |
181 | super.eUnset(featureID); |
182 | } |
183 | |
184 | /** |
185 | * <!-- begin-user-doc --> |
186 | * <!-- end-user-doc --> |
187 | * @generated |
188 | */ |
189 | @Override |
190 | public boolean eIsSet(int featureID) { |
191 | switch (featureID) { |
192 | case SensitivityPackage.COMMUNICATION_LINK_RELIABILITY_PARAMETER__COMMUNICATION_LINK_RESOURCE_SPECIFICATION_COMMUNICATION_LINK_RELIABILITY_PARAMETER: |
193 | return communicationLinkResourceSpecification__CommunicationLinkReliabilityParameter != null; |
194 | } |
195 | return super.eIsSet(featureID); |
196 | } |
197 | |
198 | } //CommunicationLinkReliabilityParameterImpl |