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