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