/**
* generated by Xtext 2.10.0
*/
package com.arm.cmsis.pack.debugseq.debugSeq.impl;
import com.arm.cmsis.pack.debugseq.debugSeq.DapSwjPins;
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 Pins</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link com.arm.cmsis.pack.debugseq.debugSeq.impl.DapSwjPinsImpl#getPinout <em>Pinout</em>}</li>
* <li>{@link com.arm.cmsis.pack.debugseq.debugSeq.impl.DapSwjPinsImpl#getPinselect <em>Pinselect</em>}</li>
* <li>{@link com.arm.cmsis.pack.debugseq.debugSeq.impl.DapSwjPinsImpl#getPinwait <em>Pinwait</em>}</li>
* </ul>
*
* @generated
*/
public class DapSwjPinsImpl extends ExpressionImpl implements DapSwjPins
{
/**
* The cached value of the '{@link #getPinout() <em>Pinout</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getPinout()
* @generated
* @ordered
*/
protected Expression pinout;
/**
* The cached value of the '{@link #getPinselect() <em>Pinselect</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getPinselect()
* @generated
* @ordered
*/
protected Expression pinselect;
/**
* The cached value of the '{@link #getPinwait() <em>Pinwait</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getPinwait()
* @generated
* @ordered
*/
protected Expression pinwait;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected DapSwjPinsImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return DebugSeqPackage.Literals.DAP_SWJ_PINS;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Expression getPinout()
{
return pinout;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetPinout(Expression newPinout, NotificationChain msgs)
{
Expression oldPinout = pinout;
pinout = newPinout;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DebugSeqPackage.DAP_SWJ_PINS__PINOUT, oldPinout, newPinout);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setPinout(Expression newPinout)
{
if (newPinout != pinout)
{
NotificationChain msgs = null;
if (pinout != null)
msgs = ((InternalEObject)pinout).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DebugSeqPackage.DAP_SWJ_PINS__PINOUT, null, msgs);
if (newPinout != null)
msgs = ((InternalEObject)newPinout).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DebugSeqPackage.DAP_SWJ_PINS__PINOUT, null, msgs);
msgs = basicSetPinout(newPinout, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DebugSeqPackage.DAP_SWJ_PINS__PINOUT, newPinout, newPinout));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Expression getPinselect()
{
return pinselect;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetPinselect(Expression newPinselect, NotificationChain msgs)
{
Expression oldPinselect = pinselect;
pinselect = newPinselect;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DebugSeqPackage.DAP_SWJ_PINS__PINSELECT, oldPinselect, newPinselect);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setPinselect(Expression newPinselect)
{
if (newPinselect != pinselect)
{
NotificationChain msgs = null;
if (pinselect != null)
msgs = ((InternalEObject)pinselect).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DebugSeqPackage.DAP_SWJ_PINS__PINSELECT, null, msgs);
if (newPinselect != null)
msgs = ((InternalEObject)newPinselect).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DebugSeqPackage.DAP_SWJ_PINS__PINSELECT, null, msgs);
msgs = basicSetPinselect(newPinselect, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DebugSeqPackage.DAP_SWJ_PINS__PINSELECT, newPinselect, newPinselect));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Expression getPinwait()
{
return pinwait;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetPinwait(Expression newPinwait, NotificationChain msgs)
{
Expression oldPinwait = pinwait;
pinwait = newPinwait;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DebugSeqPackage.DAP_SWJ_PINS__PINWAIT, oldPinwait, newPinwait);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setPinwait(Expression newPinwait)
{
if (newPinwait != pinwait)
{
NotificationChain msgs = null;
if (pinwait != null)
msgs = ((InternalEObject)pinwait).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DebugSeqPackage.DAP_SWJ_PINS__PINWAIT, null, msgs);
if (newPinwait != null)
msgs = ((InternalEObject)newPinwait).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DebugSeqPackage.DAP_SWJ_PINS__PINWAIT, null, msgs);
msgs = basicSetPinwait(newPinwait, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DebugSeqPackage.DAP_SWJ_PINS__PINWAIT, newPinwait, newPinwait));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case DebugSeqPackage.DAP_SWJ_PINS__PINOUT:
return basicSetPinout(null, msgs);
case DebugSeqPackage.DAP_SWJ_PINS__PINSELECT:
return basicSetPinselect(null, msgs);
case DebugSeqPackage.DAP_SWJ_PINS__PINWAIT:
return basicSetPinwait(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_PINS__PINOUT:
return getPinout();
case DebugSeqPackage.DAP_SWJ_PINS__PINSELECT:
return getPinselect();
case DebugSeqPackage.DAP_SWJ_PINS__PINWAIT:
return getPinwait();
}
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_PINS__PINOUT:
setPinout((Expression)newValue);
return;
case DebugSeqPackage.DAP_SWJ_PINS__PINSELECT:
setPinselect((Expression)newValue);
return;
case DebugSeqPackage.DAP_SWJ_PINS__PINWAIT:
setPinwait((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_PINS__PINOUT:
setPinout((Expression)null);
return;
case DebugSeqPackage.DAP_SWJ_PINS__PINSELECT:
setPinselect((Expression)null);
return;
case DebugSeqPackage.DAP_SWJ_PINS__PINWAIT:
setPinwait((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_PINS__PINOUT:
return pinout != null;
case DebugSeqPackage.DAP_SWJ_PINS__PINSELECT:
return pinselect != null;
case DebugSeqPackage.DAP_SWJ_PINS__PINWAIT:
return pinwait != null;
}
return super.eIsSet(featureID);
}
} //DapSwjPinsImpl