/**
*/
package edu.ksu.cis.projects.mdcf.devicemodel.deviceModelingLanguage.impl;
import edu.ksu.cis.projects.mdcf.devicemodel.deviceModelingLanguage.DeviceModelingLanguagePackage;
import edu.ksu.cis.projects.mdcf.devicemodel.deviceModelingLanguage.Primary;
import edu.ksu.cis.projects.mdcf.devicemodel.deviceModelingLanguage.PrimaryExp;
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>Primary Exp</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link edu.ksu.cis.projects.mdcf.devicemodel.deviceModelingLanguage.impl.PrimaryExpImpl#getPrimary <em>Primary</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class PrimaryExpImpl extends ExpImpl implements PrimaryExp
{
/**
* The cached value of the '{@link #getPrimary() <em>Primary</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getPrimary()
* @generated
* @ordered
*/
protected Primary primary;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected PrimaryExpImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return DeviceModelingLanguagePackage.Literals.PRIMARY_EXP;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Primary getPrimary()
{
return primary;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetPrimary(Primary newPrimary, NotificationChain msgs)
{
Primary oldPrimary = primary;
primary = newPrimary;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DeviceModelingLanguagePackage.PRIMARY_EXP__PRIMARY, oldPrimary, newPrimary);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setPrimary(Primary newPrimary)
{
if (newPrimary != primary)
{
NotificationChain msgs = null;
if (primary != null)
msgs = ((InternalEObject)primary).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DeviceModelingLanguagePackage.PRIMARY_EXP__PRIMARY, null, msgs);
if (newPrimary != null)
msgs = ((InternalEObject)newPrimary).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DeviceModelingLanguagePackage.PRIMARY_EXP__PRIMARY, null, msgs);
msgs = basicSetPrimary(newPrimary, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DeviceModelingLanguagePackage.PRIMARY_EXP__PRIMARY, newPrimary, newPrimary));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case DeviceModelingLanguagePackage.PRIMARY_EXP__PRIMARY:
return basicSetPrimary(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 DeviceModelingLanguagePackage.PRIMARY_EXP__PRIMARY:
return getPrimary();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case DeviceModelingLanguagePackage.PRIMARY_EXP__PRIMARY:
setPrimary((Primary)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case DeviceModelingLanguagePackage.PRIMARY_EXP__PRIMARY:
setPrimary((Primary)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case DeviceModelingLanguagePackage.PRIMARY_EXP__PRIMARY:
return primary != null;
}
return super.eIsSet(featureID);
}
} //PrimaryExpImpl