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