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.Expression; |
16 | import de.uka.ipd.sdq.stoex.Parenthesis; |
17 | import de.uka.ipd.sdq.stoex.StoexPackage; |
18 | |
19 | /** |
20 | * <!-- begin-user-doc --> |
21 | * An implementation of the model object '<em><b>Parenthesis</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.ParenthesisImpl#getInnerExpression <em>Inner Expression</em>}</li> |
27 | * </ul> |
28 | * </p> |
29 | * |
30 | * @generated |
31 | */ |
32 | public class ParenthesisImpl extends AtomImpl implements Parenthesis { |
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 #getInnerExpression() <em>Inner Expression</em>}' containment reference. |
41 | * <!-- begin-user-doc --> |
42 | * <!-- end-user-doc --> |
43 | * @see #getInnerExpression() |
44 | * @generated |
45 | * @ordered |
46 | */ |
47 | protected Expression innerExpression; |
48 | |
49 | /** |
50 | * <!-- begin-user-doc --> |
51 | * <!-- end-user-doc --> |
52 | * @generated |
53 | */ |
54 | protected ParenthesisImpl() { |
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.PARENTHESIS; |
66 | } |
67 | |
68 | /** |
69 | * <!-- begin-user-doc --> |
70 | * <!-- end-user-doc --> |
71 | * @generated |
72 | */ |
73 | public Expression getInnerExpression() { |
74 | return innerExpression; |
75 | } |
76 | |
77 | /** |
78 | * <!-- begin-user-doc --> |
79 | * <!-- end-user-doc --> |
80 | * @generated |
81 | */ |
82 | public NotificationChain basicSetInnerExpression(Expression newInnerExpression, NotificationChain msgs) { |
83 | Expression oldInnerExpression = innerExpression; |
84 | innerExpression = newInnerExpression; |
85 | if (eNotificationRequired()) { |
86 | ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, StoexPackage.PARENTHESIS__INNER_EXPRESSION, oldInnerExpression, newInnerExpression); |
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 setInnerExpression(Expression newInnerExpression) { |
98 | if (newInnerExpression != innerExpression) { |
99 | NotificationChain msgs = null; |
100 | if (innerExpression != null) |
101 | msgs = ((InternalEObject)innerExpression).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - StoexPackage.PARENTHESIS__INNER_EXPRESSION, null, msgs); |
102 | if (newInnerExpression != null) |
103 | msgs = ((InternalEObject)newInnerExpression).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - StoexPackage.PARENTHESIS__INNER_EXPRESSION, null, msgs); |
104 | msgs = basicSetInnerExpression(newInnerExpression, msgs); |
105 | if (msgs != null) msgs.dispatch(); |
106 | } |
107 | else if (eNotificationRequired()) |
108 | eNotify(new ENotificationImpl(this, Notification.SET, StoexPackage.PARENTHESIS__INNER_EXPRESSION, newInnerExpression, newInnerExpression)); |
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.PARENTHESIS__INNER_EXPRESSION: |
120 | return basicSetInnerExpression(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.PARENTHESIS__INNER_EXPRESSION: |
134 | return getInnerExpression(); |
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.PARENTHESIS__INNER_EXPRESSION: |
148 | setInnerExpression((Expression)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.PARENTHESIS__INNER_EXPRESSION: |
163 | setInnerExpression((Expression)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.PARENTHESIS__INNER_EXPRESSION: |
178 | return innerExpression != null; |
179 | } |
180 | return super.eIsSet(featureID); |
181 | } |
182 | |
183 | } //ParenthesisImpl |