1 | /** |
2 | * Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany |
3 | * |
4 | * $Id$ |
5 | */ |
6 | package de.uka.ipd.sdq.pcm.seff.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.core.CorePackage; |
15 | import de.uka.ipd.sdq.pcm.core.PCMRandomVariable; |
16 | import de.uka.ipd.sdq.pcm.seff.LoopAction; |
17 | import de.uka.ipd.sdq.pcm.seff.SeffPackage; |
18 | |
19 | /** |
20 | * <!-- begin-user-doc --> |
21 | * An implementation of the model object '<em><b>Loop Action</b></em>'. |
22 | * <!-- end-user-doc --> |
23 | * <p> |
24 | * The following features are implemented: |
25 | * <ul> |
26 | * <li>{@link de.uka.ipd.sdq.pcm.seff.impl.LoopActionImpl#getIterationCount_LoopAction <em>Iteration Count Loop Action</em>}</li> |
27 | * </ul> |
28 | * </p> |
29 | * |
30 | * @generated |
31 | */ |
32 | public class LoopActionImpl extends AbstractLoopActionImpl implements LoopAction { |
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 #getIterationCount_LoopAction() <em>Iteration Count Loop Action</em>}' containment reference. |
42 | * <!-- begin-user-doc --> |
43 | * <!-- end-user-doc --> |
44 | * @see #getIterationCount_LoopAction() |
45 | * @generated |
46 | * @ordered |
47 | */ |
48 | protected PCMRandomVariable iterationCount_LoopAction; |
49 | |
50 | /** |
51 | * <!-- begin-user-doc --> |
52 | * <!-- end-user-doc --> |
53 | * @generated |
54 | */ |
55 | protected LoopActionImpl() { |
56 | super(); |
57 | } |
58 | |
59 | /** |
60 | * <!-- begin-user-doc --> |
61 | * <!-- end-user-doc --> |
62 | * @generated |
63 | */ |
64 | @Override |
65 | protected EClass eStaticClass() { |
66 | return SeffPackage.Literals.LOOP_ACTION; |
67 | } |
68 | |
69 | /** |
70 | * <!-- begin-user-doc --> |
71 | * <!-- end-user-doc --> |
72 | * @generated |
73 | */ |
74 | public PCMRandomVariable getIterationCount_LoopAction() { |
75 | return iterationCount_LoopAction; |
76 | } |
77 | |
78 | /** |
79 | * <!-- begin-user-doc --> |
80 | * <!-- end-user-doc --> |
81 | * @generated |
82 | */ |
83 | public NotificationChain basicSetIterationCount_LoopAction(PCMRandomVariable newIterationCount_LoopAction, NotificationChain msgs) { |
84 | PCMRandomVariable oldIterationCount_LoopAction = iterationCount_LoopAction; |
85 | iterationCount_LoopAction = newIterationCount_LoopAction; |
86 | if (eNotificationRequired()) { |
87 | ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SeffPackage.LOOP_ACTION__ITERATION_COUNT_LOOP_ACTION, oldIterationCount_LoopAction, newIterationCount_LoopAction); |
88 | if (msgs == null) msgs = notification; else msgs.add(notification); |
89 | } |
90 | return msgs; |
91 | } |
92 | |
93 | /** |
94 | * <!-- begin-user-doc --> |
95 | * <!-- end-user-doc --> |
96 | * @generated |
97 | */ |
98 | public void setIterationCount_LoopAction(PCMRandomVariable newIterationCount_LoopAction) { |
99 | if (newIterationCount_LoopAction != iterationCount_LoopAction) { |
100 | NotificationChain msgs = null; |
101 | if (iterationCount_LoopAction != null) |
102 | msgs = ((InternalEObject)iterationCount_LoopAction).eInverseRemove(this, CorePackage.PCM_RANDOM_VARIABLE__LOOP_ACTION_PCM_RANDOM_VARIABLE, PCMRandomVariable.class, msgs); |
103 | if (newIterationCount_LoopAction != null) |
104 | msgs = ((InternalEObject)newIterationCount_LoopAction).eInverseAdd(this, CorePackage.PCM_RANDOM_VARIABLE__LOOP_ACTION_PCM_RANDOM_VARIABLE, PCMRandomVariable.class, msgs); |
105 | msgs = basicSetIterationCount_LoopAction(newIterationCount_LoopAction, msgs); |
106 | if (msgs != null) msgs.dispatch(); |
107 | } |
108 | else if (eNotificationRequired()) |
109 | eNotify(new ENotificationImpl(this, Notification.SET, SeffPackage.LOOP_ACTION__ITERATION_COUNT_LOOP_ACTION, newIterationCount_LoopAction, newIterationCount_LoopAction)); |
110 | } |
111 | |
112 | /** |
113 | * <!-- begin-user-doc --> |
114 | * <!-- end-user-doc --> |
115 | * @generated |
116 | */ |
117 | @Override |
118 | public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
119 | switch (featureID) { |
120 | case SeffPackage.LOOP_ACTION__ITERATION_COUNT_LOOP_ACTION: |
121 | if (iterationCount_LoopAction != null) |
122 | msgs = ((InternalEObject)iterationCount_LoopAction).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - SeffPackage.LOOP_ACTION__ITERATION_COUNT_LOOP_ACTION, null, msgs); |
123 | return basicSetIterationCount_LoopAction((PCMRandomVariable)otherEnd, msgs); |
124 | } |
125 | return super.eInverseAdd(otherEnd, featureID, msgs); |
126 | } |
127 | |
128 | /** |
129 | * <!-- begin-user-doc --> |
130 | * <!-- end-user-doc --> |
131 | * @generated |
132 | */ |
133 | @Override |
134 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
135 | switch (featureID) { |
136 | case SeffPackage.LOOP_ACTION__ITERATION_COUNT_LOOP_ACTION: |
137 | return basicSetIterationCount_LoopAction(null, msgs); |
138 | } |
139 | return super.eInverseRemove(otherEnd, featureID, msgs); |
140 | } |
141 | |
142 | /** |
143 | * <!-- begin-user-doc --> |
144 | * <!-- end-user-doc --> |
145 | * @generated |
146 | */ |
147 | @Override |
148 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
149 | switch (featureID) { |
150 | case SeffPackage.LOOP_ACTION__ITERATION_COUNT_LOOP_ACTION: |
151 | return getIterationCount_LoopAction(); |
152 | } |
153 | return super.eGet(featureID, resolve, coreType); |
154 | } |
155 | |
156 | /** |
157 | * <!-- begin-user-doc --> |
158 | * <!-- end-user-doc --> |
159 | * @generated |
160 | */ |
161 | @Override |
162 | public void eSet(int featureID, Object newValue) { |
163 | switch (featureID) { |
164 | case SeffPackage.LOOP_ACTION__ITERATION_COUNT_LOOP_ACTION: |
165 | setIterationCount_LoopAction((PCMRandomVariable)newValue); |
166 | return; |
167 | } |
168 | super.eSet(featureID, newValue); |
169 | } |
170 | |
171 | /** |
172 | * <!-- begin-user-doc --> |
173 | * <!-- end-user-doc --> |
174 | * @generated |
175 | */ |
176 | @Override |
177 | public void eUnset(int featureID) { |
178 | switch (featureID) { |
179 | case SeffPackage.LOOP_ACTION__ITERATION_COUNT_LOOP_ACTION: |
180 | setIterationCount_LoopAction((PCMRandomVariable)null); |
181 | return; |
182 | } |
183 | super.eUnset(featureID); |
184 | } |
185 | |
186 | /** |
187 | * <!-- begin-user-doc --> |
188 | * <!-- end-user-doc --> |
189 | * @generated |
190 | */ |
191 | @Override |
192 | public boolean eIsSet(int featureID) { |
193 | switch (featureID) { |
194 | case SeffPackage.LOOP_ACTION__ITERATION_COUNT_LOOP_ACTION: |
195 | return iterationCount_LoopAction != null; |
196 | } |
197 | return super.eIsSet(featureID); |
198 | } |
199 | |
200 | } //LoopActionImpl |