/** * generated by Xtext 2.10.0 */ package com.arm.cmsis.pack.debugseq.debugSeq.impl; import com.arm.cmsis.pack.debugseq.debugSeq.DapSwjSequence; import com.arm.cmsis.pack.debugseq.debugSeq.DebugSeqPackage; import com.arm.cmsis.pack.debugseq.debugSeq.Expression; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Dap Swj Sequence</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * </p> * <ul> * <li>{@link com.arm.cmsis.pack.debugseq.debugSeq.impl.DapSwjSequenceImpl#getCnt <em>Cnt</em>}</li> * <li>{@link com.arm.cmsis.pack.debugseq.debugSeq.impl.DapSwjSequenceImpl#getVal <em>Val</em>}</li> * </ul> * * @generated */ public class DapSwjSequenceImpl extends ExpressionImpl implements DapSwjSequence { /** * The cached value of the '{@link #getCnt() <em>Cnt</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getCnt() * @generated * @ordered */ protected Expression cnt; /** * The cached value of the '{@link #getVal() <em>Val</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getVal() * @generated * @ordered */ protected Expression val; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected DapSwjSequenceImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return DebugSeqPackage.Literals.DAP_SWJ_SEQUENCE; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Expression getCnt() { return cnt; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetCnt(Expression newCnt, NotificationChain msgs) { Expression oldCnt = cnt; cnt = newCnt; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DebugSeqPackage.DAP_SWJ_SEQUENCE__CNT, oldCnt, newCnt); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setCnt(Expression newCnt) { if (newCnt != cnt) { NotificationChain msgs = null; if (cnt != null) msgs = ((InternalEObject)cnt).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DebugSeqPackage.DAP_SWJ_SEQUENCE__CNT, null, msgs); if (newCnt != null) msgs = ((InternalEObject)newCnt).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DebugSeqPackage.DAP_SWJ_SEQUENCE__CNT, null, msgs); msgs = basicSetCnt(newCnt, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, DebugSeqPackage.DAP_SWJ_SEQUENCE__CNT, newCnt, newCnt)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Expression getVal() { return val; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetVal(Expression newVal, NotificationChain msgs) { Expression oldVal = val; val = newVal; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DebugSeqPackage.DAP_SWJ_SEQUENCE__VAL, oldVal, newVal); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setVal(Expression newVal) { if (newVal != val) { NotificationChain msgs = null; if (val != null) msgs = ((InternalEObject)val).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DebugSeqPackage.DAP_SWJ_SEQUENCE__VAL, null, msgs); if (newVal != null) msgs = ((InternalEObject)newVal).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DebugSeqPackage.DAP_SWJ_SEQUENCE__VAL, null, msgs); msgs = basicSetVal(newVal, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, DebugSeqPackage.DAP_SWJ_SEQUENCE__VAL, newVal, newVal)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case DebugSeqPackage.DAP_SWJ_SEQUENCE__CNT: return basicSetCnt(null, msgs); case DebugSeqPackage.DAP_SWJ_SEQUENCE__VAL: return basicSetVal(null, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case DebugSeqPackage.DAP_SWJ_SEQUENCE__CNT: return getCnt(); case DebugSeqPackage.DAP_SWJ_SEQUENCE__VAL: return getVal(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case DebugSeqPackage.DAP_SWJ_SEQUENCE__CNT: setCnt((Expression)newValue); return; case DebugSeqPackage.DAP_SWJ_SEQUENCE__VAL: setVal((Expression)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case DebugSeqPackage.DAP_SWJ_SEQUENCE__CNT: setCnt((Expression)null); return; case DebugSeqPackage.DAP_SWJ_SEQUENCE__VAL: setVal((Expression)null); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case DebugSeqPackage.DAP_SWJ_SEQUENCE__CNT: return cnt != null; case DebugSeqPackage.DAP_SWJ_SEQUENCE__VAL: return val != null; } return super.eIsSet(featureID); } } //DapSwjSequenceImpl