001: /**
002: * <copyright>
003: * </copyright>
004: *
005: * $Id$
006: */package newprocess.impl;
007:
008: import newprocess.Conclusion;
009: import newprocess.ConditionProxy;
010: import newprocess.Expression;
011: import newprocess.NewprocessPackage;
012:
013: import org.eclipse.emf.common.notify.Notification;
014: import org.eclipse.emf.common.notify.NotificationChain;
015: import org.eclipse.emf.ecore.EClass;
016: import org.eclipse.emf.ecore.InternalEObject;
017: import org.eclipse.emf.ecore.impl.ENotificationImpl;
018:
019: /**
020: * <!-- begin-user-doc -->
021: * An implementation of the model object '<em><b>Conclusion</b></em>'.
022: * <!-- end-user-doc -->
023: * <p>
024: * The following features are implemented:
025: * <ul>
026: * <li>{@link newprocess.impl.ConclusionImpl#getHasPrecondition <em>Has Precondition</em>}</li>
027: * <li>{@link newprocess.impl.ConclusionImpl#getConclusionProxy <em>Conclusion Proxy</em>}</li>
028: * </ul>
029: * </p>
030: *
031: * @generated
032: */
033: public class ConclusionImpl extends ElementImpl implements Conclusion {
034: /**
035: * The cached value of the '{@link #getHasPrecondition() <em>Has Precondition</em>}' containment reference.
036: * <!-- begin-user-doc -->
037: * <!-- end-user-doc -->
038: * @see #getHasPrecondition()
039: * @generated
040: * @ordered
041: */
042: protected Expression hasPrecondition = null;
043:
044: /**
045: * The cached value of the '{@link #getConclusionProxy() <em>Conclusion Proxy</em>}' reference.
046: * <!-- begin-user-doc -->
047: * <!-- end-user-doc -->
048: * @see #getConclusionProxy()
049: * @generated
050: * @ordered
051: */
052: protected ConditionProxy conclusionProxy = null;
053:
054: /**
055: * <!-- begin-user-doc -->
056: * <!-- end-user-doc -->
057: * @generated
058: */
059: protected ConclusionImpl() {
060: super ();
061: }
062:
063: /**
064: * <!-- begin-user-doc -->
065: * <!-- end-user-doc -->
066: * @generated
067: */
068: @Override
069: protected EClass eStaticClass() {
070: return NewprocessPackage.Literals.CONCLUSION;
071: }
072:
073: /**
074: * <!-- begin-user-doc -->
075: * <!-- end-user-doc -->
076: * @generated
077: */
078: public Expression getHasPrecondition() {
079: return hasPrecondition;
080: }
081:
082: /**
083: * <!-- begin-user-doc -->
084: * <!-- end-user-doc -->
085: * @generated
086: */
087: public NotificationChain basicSetHasPrecondition(
088: Expression newHasPrecondition, NotificationChain msgs) {
089: Expression oldHasPrecondition = hasPrecondition;
090: hasPrecondition = newHasPrecondition;
091: if (eNotificationRequired()) {
092: ENotificationImpl notification = new ENotificationImpl(
093: this , Notification.SET,
094: NewprocessPackage.CONCLUSION__HAS_PRECONDITION,
095: oldHasPrecondition, newHasPrecondition);
096: if (msgs == null)
097: msgs = notification;
098: else
099: msgs.add(notification);
100: }
101: return msgs;
102: }
103:
104: /**
105: * <!-- begin-user-doc -->
106: * <!-- end-user-doc -->
107: * @generated
108: */
109: public void setHasPrecondition(Expression newHasPrecondition) {
110: if (newHasPrecondition != hasPrecondition) {
111: NotificationChain msgs = null;
112: if (hasPrecondition != null)
113: msgs = ((InternalEObject) hasPrecondition)
114: .eInverseRemove(
115: this ,
116: EOPPOSITE_FEATURE_BASE
117: - NewprocessPackage.CONCLUSION__HAS_PRECONDITION,
118: null, msgs);
119: if (newHasPrecondition != null)
120: msgs = ((InternalEObject) newHasPrecondition)
121: .eInverseAdd(
122: this ,
123: EOPPOSITE_FEATURE_BASE
124: - NewprocessPackage.CONCLUSION__HAS_PRECONDITION,
125: null, msgs);
126: msgs = basicSetHasPrecondition(newHasPrecondition, msgs);
127: if (msgs != null)
128: msgs.dispatch();
129: } else if (eNotificationRequired())
130: eNotify(new ENotificationImpl(this , Notification.SET,
131: NewprocessPackage.CONCLUSION__HAS_PRECONDITION,
132: newHasPrecondition, newHasPrecondition));
133: }
134:
135: /**
136: * <!-- begin-user-doc -->
137: * <!-- end-user-doc -->
138: * @generated
139: */
140: public ConditionProxy getConclusionProxy() {
141: if (conclusionProxy != null && conclusionProxy.eIsProxy()) {
142: InternalEObject oldConclusionProxy = (InternalEObject) conclusionProxy;
143: conclusionProxy = (ConditionProxy) eResolveProxy(oldConclusionProxy);
144: if (conclusionProxy != oldConclusionProxy) {
145: if (eNotificationRequired())
146: eNotify(new ENotificationImpl(
147: this ,
148: Notification.RESOLVE,
149: NewprocessPackage.CONCLUSION__CONCLUSION_PROXY,
150: oldConclusionProxy, conclusionProxy));
151: }
152: }
153: return conclusionProxy;
154: }
155:
156: /**
157: * <!-- begin-user-doc -->
158: * <!-- end-user-doc -->
159: * @generated
160: */
161: public ConditionProxy basicGetConclusionProxy() {
162: return conclusionProxy;
163: }
164:
165: /**
166: * <!-- begin-user-doc -->
167: * <!-- end-user-doc -->
168: * @generated
169: */
170: public void setConclusionProxy(ConditionProxy newConclusionProxy) {
171: ConditionProxy oldConclusionProxy = conclusionProxy;
172: conclusionProxy = newConclusionProxy;
173: if (eNotificationRequired())
174: eNotify(new ENotificationImpl(this , Notification.SET,
175: NewprocessPackage.CONCLUSION__CONCLUSION_PROXY,
176: oldConclusionProxy, conclusionProxy));
177: }
178:
179: /**
180: * <!-- begin-user-doc -->
181: * <!-- end-user-doc -->
182: * @generated NOT
183: * @author sh
184: */
185: public void performUpdate() {
186: Expression preconExpr = getHasPrecondition();
187: if (preconExpr != null)
188: preconExpr.updateName();
189: }
190:
191: /**
192: * <!-- begin-user-doc -->
193: * <!-- end-user-doc -->
194: * @generated
195: */
196: @Override
197: public NotificationChain eInverseRemove(InternalEObject otherEnd,
198: int featureID, NotificationChain msgs) {
199: switch (featureID) {
200: case NewprocessPackage.CONCLUSION__HAS_PRECONDITION:
201: return basicSetHasPrecondition(null, msgs);
202: }
203: return super .eInverseRemove(otherEnd, featureID, msgs);
204: }
205:
206: /**
207: * <!-- begin-user-doc -->
208: * <!-- end-user-doc -->
209: * @generated
210: */
211: @Override
212: public Object eGet(int featureID, boolean resolve, boolean coreType) {
213: switch (featureID) {
214: case NewprocessPackage.CONCLUSION__HAS_PRECONDITION:
215: return getHasPrecondition();
216: case NewprocessPackage.CONCLUSION__CONCLUSION_PROXY:
217: if (resolve)
218: return getConclusionProxy();
219: return basicGetConclusionProxy();
220: }
221: return super .eGet(featureID, resolve, coreType);
222: }
223:
224: /**
225: * <!-- begin-user-doc -->
226: * <!-- end-user-doc -->
227: * @generated
228: */
229: @Override
230: public void eSet(int featureID, Object newValue) {
231: switch (featureID) {
232: case NewprocessPackage.CONCLUSION__HAS_PRECONDITION:
233: setHasPrecondition((Expression) newValue);
234: return;
235: case NewprocessPackage.CONCLUSION__CONCLUSION_PROXY:
236: setConclusionProxy((ConditionProxy) newValue);
237: return;
238: }
239: super .eSet(featureID, newValue);
240: }
241:
242: /**
243: * <!-- begin-user-doc -->
244: * <!-- end-user-doc -->
245: * @generated
246: */
247: @Override
248: public void eUnset(int featureID) {
249: switch (featureID) {
250: case NewprocessPackage.CONCLUSION__HAS_PRECONDITION:
251: setHasPrecondition((Expression) null);
252: return;
253: case NewprocessPackage.CONCLUSION__CONCLUSION_PROXY:
254: setConclusionProxy((ConditionProxy) null);
255: return;
256: }
257: super .eUnset(featureID);
258: }
259:
260: /**
261: * <!-- begin-user-doc -->
262: * <!-- end-user-doc -->
263: * @generated
264: */
265: @Override
266: public boolean eIsSet(int featureID) {
267: switch (featureID) {
268: case NewprocessPackage.CONCLUSION__HAS_PRECONDITION:
269: return hasPrecondition != null;
270: case NewprocessPackage.CONCLUSION__CONCLUSION_PROXY:
271: return conclusionProxy != null;
272: }
273: return super .eIsSet(featureID);
274: }
275:
276: } //ConclusionImpl
|