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.GuardedBranchTransition; |
17 | import de.uka.ipd.sdq.pcm.seff.SeffPackage; |
18 | |
19 | /** |
20 | * <!-- begin-user-doc --> |
21 | * An implementation of the model object '<em><b>Guarded Branch Transition</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.GuardedBranchTransitionImpl#getBranchCondition_GuardedBranchTransition <em>Branch Condition Guarded Branch Transition</em>}</li> |
27 | * </ul> |
28 | * </p> |
29 | * |
30 | * @generated |
31 | */ |
32 | public class GuardedBranchTransitionImpl extends AbstractBranchTransitionImpl implements GuardedBranchTransition { |
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 #getBranchCondition_GuardedBranchTransition() <em>Branch Condition Guarded Branch Transition</em>}' containment reference. |
42 | * <!-- begin-user-doc --> |
43 | * <!-- end-user-doc --> |
44 | * @see #getBranchCondition_GuardedBranchTransition() |
45 | * @generated |
46 | * @ordered |
47 | */ |
48 | protected PCMRandomVariable branchCondition_GuardedBranchTransition; |
49 | |
50 | /** |
51 | * <!-- begin-user-doc --> |
52 | * <!-- end-user-doc --> |
53 | * @generated |
54 | */ |
55 | protected GuardedBranchTransitionImpl() { |
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.GUARDED_BRANCH_TRANSITION; |
67 | } |
68 | |
69 | /** |
70 | * <!-- begin-user-doc --> |
71 | * <!-- end-user-doc --> |
72 | * @generated |
73 | */ |
74 | public PCMRandomVariable getBranchCondition_GuardedBranchTransition() { |
75 | return branchCondition_GuardedBranchTransition; |
76 | } |
77 | |
78 | /** |
79 | * <!-- begin-user-doc --> |
80 | * <!-- end-user-doc --> |
81 | * @generated |
82 | */ |
83 | public NotificationChain basicSetBranchCondition_GuardedBranchTransition(PCMRandomVariable newBranchCondition_GuardedBranchTransition, NotificationChain msgs) { |
84 | PCMRandomVariable oldBranchCondition_GuardedBranchTransition = branchCondition_GuardedBranchTransition; |
85 | branchCondition_GuardedBranchTransition = newBranchCondition_GuardedBranchTransition; |
86 | if (eNotificationRequired()) { |
87 | ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SeffPackage.GUARDED_BRANCH_TRANSITION__BRANCH_CONDITION_GUARDED_BRANCH_TRANSITION, oldBranchCondition_GuardedBranchTransition, newBranchCondition_GuardedBranchTransition); |
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 setBranchCondition_GuardedBranchTransition(PCMRandomVariable newBranchCondition_GuardedBranchTransition) { |
99 | if (newBranchCondition_GuardedBranchTransition != branchCondition_GuardedBranchTransition) { |
100 | NotificationChain msgs = null; |
101 | if (branchCondition_GuardedBranchTransition != null) |
102 | msgs = ((InternalEObject)branchCondition_GuardedBranchTransition).eInverseRemove(this, CorePackage.PCM_RANDOM_VARIABLE__GUARDED_BRANCH_TRANSITION_PCM_RANDOM_VARIABLE, PCMRandomVariable.class, msgs); |
103 | if (newBranchCondition_GuardedBranchTransition != null) |
104 | msgs = ((InternalEObject)newBranchCondition_GuardedBranchTransition).eInverseAdd(this, CorePackage.PCM_RANDOM_VARIABLE__GUARDED_BRANCH_TRANSITION_PCM_RANDOM_VARIABLE, PCMRandomVariable.class, msgs); |
105 | msgs = basicSetBranchCondition_GuardedBranchTransition(newBranchCondition_GuardedBranchTransition, msgs); |
106 | if (msgs != null) msgs.dispatch(); |
107 | } |
108 | else if (eNotificationRequired()) |
109 | eNotify(new ENotificationImpl(this, Notification.SET, SeffPackage.GUARDED_BRANCH_TRANSITION__BRANCH_CONDITION_GUARDED_BRANCH_TRANSITION, newBranchCondition_GuardedBranchTransition, newBranchCondition_GuardedBranchTransition)); |
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.GUARDED_BRANCH_TRANSITION__BRANCH_CONDITION_GUARDED_BRANCH_TRANSITION: |
121 | if (branchCondition_GuardedBranchTransition != null) |
122 | msgs = ((InternalEObject)branchCondition_GuardedBranchTransition).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - SeffPackage.GUARDED_BRANCH_TRANSITION__BRANCH_CONDITION_GUARDED_BRANCH_TRANSITION, null, msgs); |
123 | return basicSetBranchCondition_GuardedBranchTransition((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.GUARDED_BRANCH_TRANSITION__BRANCH_CONDITION_GUARDED_BRANCH_TRANSITION: |
137 | return basicSetBranchCondition_GuardedBranchTransition(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.GUARDED_BRANCH_TRANSITION__BRANCH_CONDITION_GUARDED_BRANCH_TRANSITION: |
151 | return getBranchCondition_GuardedBranchTransition(); |
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.GUARDED_BRANCH_TRANSITION__BRANCH_CONDITION_GUARDED_BRANCH_TRANSITION: |
165 | setBranchCondition_GuardedBranchTransition((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.GUARDED_BRANCH_TRANSITION__BRANCH_CONDITION_GUARDED_BRANCH_TRANSITION: |
180 | setBranchCondition_GuardedBranchTransition((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.GUARDED_BRANCH_TRANSITION__BRANCH_CONDITION_GUARDED_BRANCH_TRANSITION: |
195 | return branchCondition_GuardedBranchTransition != null; |
196 | } |
197 | return super.eIsSet(featureID); |
198 | } |
199 | |
200 | } //GuardedBranchTransitionImpl |