/** * generated by Xtext 2.10.0 */ package com.arm.cmsis.pack.debugseq.debugSeq.impl; import com.arm.cmsis.pack.debugseq.debugSeq.DebugSeqModel; import com.arm.cmsis.pack.debugseq.debugSeq.DebugSeqPackage; import com.arm.cmsis.pack.debugseq.debugSeq.DebugVars; import com.arm.cmsis.pack.debugseq.debugSeq.Sequences; 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; import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Model</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * </p> * <ul> * <li>{@link com.arm.cmsis.pack.debugseq.debugSeq.impl.DebugSeqModelImpl#getDebugvars <em>Debugvars</em>}</li> * <li>{@link com.arm.cmsis.pack.debugseq.debugSeq.impl.DebugSeqModelImpl#getSequences <em>Sequences</em>}</li> * </ul> * * @generated */ public class DebugSeqModelImpl extends MinimalEObjectImpl.Container implements DebugSeqModel { /** * The cached value of the '{@link #getDebugvars() <em>Debugvars</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getDebugvars() * @generated * @ordered */ protected DebugVars debugvars; /** * The cached value of the '{@link #getSequences() <em>Sequences</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getSequences() * @generated * @ordered */ protected Sequences sequences; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected DebugSeqModelImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return DebugSeqPackage.Literals.DEBUG_SEQ_MODEL; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public DebugVars getDebugvars() { return debugvars; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetDebugvars(DebugVars newDebugvars, NotificationChain msgs) { DebugVars oldDebugvars = debugvars; debugvars = newDebugvars; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DebugSeqPackage.DEBUG_SEQ_MODEL__DEBUGVARS, oldDebugvars, newDebugvars); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setDebugvars(DebugVars newDebugvars) { if (newDebugvars != debugvars) { NotificationChain msgs = null; if (debugvars != null) msgs = ((InternalEObject)debugvars).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DebugSeqPackage.DEBUG_SEQ_MODEL__DEBUGVARS, null, msgs); if (newDebugvars != null) msgs = ((InternalEObject)newDebugvars).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DebugSeqPackage.DEBUG_SEQ_MODEL__DEBUGVARS, null, msgs); msgs = basicSetDebugvars(newDebugvars, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, DebugSeqPackage.DEBUG_SEQ_MODEL__DEBUGVARS, newDebugvars, newDebugvars)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Sequences getSequences() { return sequences; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetSequences(Sequences newSequences, NotificationChain msgs) { Sequences oldSequences = sequences; sequences = newSequences; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DebugSeqPackage.DEBUG_SEQ_MODEL__SEQUENCES, oldSequences, newSequences); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setSequences(Sequences newSequences) { if (newSequences != sequences) { NotificationChain msgs = null; if (sequences != null) msgs = ((InternalEObject)sequences).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DebugSeqPackage.DEBUG_SEQ_MODEL__SEQUENCES, null, msgs); if (newSequences != null) msgs = ((InternalEObject)newSequences).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DebugSeqPackage.DEBUG_SEQ_MODEL__SEQUENCES, null, msgs); msgs = basicSetSequences(newSequences, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, DebugSeqPackage.DEBUG_SEQ_MODEL__SEQUENCES, newSequences, newSequences)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case DebugSeqPackage.DEBUG_SEQ_MODEL__DEBUGVARS: return basicSetDebugvars(null, msgs); case DebugSeqPackage.DEBUG_SEQ_MODEL__SEQUENCES: return basicSetSequences(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.DEBUG_SEQ_MODEL__DEBUGVARS: return getDebugvars(); case DebugSeqPackage.DEBUG_SEQ_MODEL__SEQUENCES: return getSequences(); } 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.DEBUG_SEQ_MODEL__DEBUGVARS: setDebugvars((DebugVars)newValue); return; case DebugSeqPackage.DEBUG_SEQ_MODEL__SEQUENCES: setSequences((Sequences)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case DebugSeqPackage.DEBUG_SEQ_MODEL__DEBUGVARS: setDebugvars((DebugVars)null); return; case DebugSeqPackage.DEBUG_SEQ_MODEL__SEQUENCES: setSequences((Sequences)null); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case DebugSeqPackage.DEBUG_SEQ_MODEL__DEBUGVARS: return debugvars != null; case DebugSeqPackage.DEBUG_SEQ_MODEL__SEQUENCES: return sequences != null; } return super.eIsSet(featureID); } } //DebugSeqModelImpl