1 | /** |
2 | * <copyright> |
3 | * </copyright> |
4 | * |
5 | * $Id$ |
6 | */ |
7 | package EssentialOCL.impl; |
8 | |
9 | import EssentialOCL.CallExp; |
10 | import EssentialOCL.EssentialOCLPackage; |
11 | import EssentialOCL.OclExpression; |
12 | |
13 | import org.eclipse.emf.common.notify.Notification; |
14 | import org.eclipse.emf.common.notify.NotificationChain; |
15 | |
16 | import org.eclipse.emf.ecore.EClass; |
17 | import org.eclipse.emf.ecore.InternalEObject; |
18 | |
19 | import org.eclipse.emf.ecore.impl.ENotificationImpl; |
20 | |
21 | /** |
22 | * <!-- begin-user-doc --> |
23 | * An implementation of the model object '<em><b>Call Exp</b></em>'. |
24 | * <!-- end-user-doc --> |
25 | * <p> |
26 | * The following features are implemented: |
27 | * <ul> |
28 | * <li>{@link EssentialOCL.impl.CallExpImpl#getSource <em>Source</em>}</li> |
29 | * </ul> |
30 | * </p> |
31 | * |
32 | * @generated |
33 | */ |
34 | public abstract class CallExpImpl extends OclExpressionImpl implements CallExp { |
35 | /** |
36 | * The cached value of the '{@link #getSource() <em>Source</em>}' containment reference. |
37 | * <!-- begin-user-doc --> |
38 | * <!-- end-user-doc --> |
39 | * @see #getSource() |
40 | * @generated |
41 | * @ordered |
42 | */ |
43 | protected OclExpression source; |
44 | |
45 | /** |
46 | * <!-- begin-user-doc --> |
47 | * <!-- end-user-doc --> |
48 | * @generated |
49 | */ |
50 | protected CallExpImpl() { |
51 | super(); |
52 | } |
53 | |
54 | /** |
55 | * <!-- begin-user-doc --> |
56 | * <!-- end-user-doc --> |
57 | * @generated |
58 | */ |
59 | @Override |
60 | protected EClass eStaticClass() { |
61 | return EssentialOCLPackage.Literals.CALL_EXP; |
62 | } |
63 | |
64 | /** |
65 | * <!-- begin-user-doc --> |
66 | * <!-- end-user-doc --> |
67 | * @generated |
68 | */ |
69 | public OclExpression getSource() { |
70 | return source; |
71 | } |
72 | |
73 | /** |
74 | * <!-- begin-user-doc --> |
75 | * <!-- end-user-doc --> |
76 | * @generated |
77 | */ |
78 | public NotificationChain basicSetSource(OclExpression newSource, NotificationChain msgs) { |
79 | OclExpression oldSource = source; |
80 | source = newSource; |
81 | if (eNotificationRequired()) { |
82 | ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EssentialOCLPackage.CALL_EXP__SOURCE, oldSource, newSource); |
83 | if (msgs == null) msgs = notification; else msgs.add(notification); |
84 | } |
85 | return msgs; |
86 | } |
87 | |
88 | /** |
89 | * <!-- begin-user-doc --> |
90 | * <!-- end-user-doc --> |
91 | * @generated |
92 | */ |
93 | public void setSource(OclExpression newSource) { |
94 | if (newSource != source) { |
95 | NotificationChain msgs = null; |
96 | if (source != null) |
97 | msgs = ((InternalEObject)source).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EssentialOCLPackage.CALL_EXP__SOURCE, null, msgs); |
98 | if (newSource != null) |
99 | msgs = ((InternalEObject)newSource).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EssentialOCLPackage.CALL_EXP__SOURCE, null, msgs); |
100 | msgs = basicSetSource(newSource, msgs); |
101 | if (msgs != null) msgs.dispatch(); |
102 | } |
103 | else if (eNotificationRequired()) |
104 | eNotify(new ENotificationImpl(this, Notification.SET, EssentialOCLPackage.CALL_EXP__SOURCE, newSource, newSource)); |
105 | } |
106 | |
107 | /** |
108 | * <!-- begin-user-doc --> |
109 | * <!-- end-user-doc --> |
110 | * @generated |
111 | */ |
112 | @Override |
113 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
114 | switch (featureID) { |
115 | case EssentialOCLPackage.CALL_EXP__SOURCE: |
116 | return basicSetSource(null, msgs); |
117 | } |
118 | return super.eInverseRemove(otherEnd, featureID, msgs); |
119 | } |
120 | |
121 | /** |
122 | * <!-- begin-user-doc --> |
123 | * <!-- end-user-doc --> |
124 | * @generated |
125 | */ |
126 | @Override |
127 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
128 | switch (featureID) { |
129 | case EssentialOCLPackage.CALL_EXP__SOURCE: |
130 | return getSource(); |
131 | } |
132 | return super.eGet(featureID, resolve, coreType); |
133 | } |
134 | |
135 | /** |
136 | * <!-- begin-user-doc --> |
137 | * <!-- end-user-doc --> |
138 | * @generated |
139 | */ |
140 | @Override |
141 | public void eSet(int featureID, Object newValue) { |
142 | switch (featureID) { |
143 | case EssentialOCLPackage.CALL_EXP__SOURCE: |
144 | setSource((OclExpression)newValue); |
145 | return; |
146 | } |
147 | super.eSet(featureID, newValue); |
148 | } |
149 | |
150 | /** |
151 | * <!-- begin-user-doc --> |
152 | * <!-- end-user-doc --> |
153 | * @generated |
154 | */ |
155 | @Override |
156 | public void eUnset(int featureID) { |
157 | switch (featureID) { |
158 | case EssentialOCLPackage.CALL_EXP__SOURCE: |
159 | setSource((OclExpression)null); |
160 | return; |
161 | } |
162 | super.eUnset(featureID); |
163 | } |
164 | |
165 | /** |
166 | * <!-- begin-user-doc --> |
167 | * <!-- end-user-doc --> |
168 | * @generated |
169 | */ |
170 | @Override |
171 | public boolean eIsSet(int featureID) { |
172 | switch (featureID) { |
173 | case EssentialOCLPackage.CALL_EXP__SOURCE: |
174 | return source != null; |
175 | } |
176 | return super.eIsSet(featureID); |
177 | } |
178 | |
179 | } //CallExpImpl |