/**
*/
package de.gebit.integrity.dsl.impl;
import de.gebit.integrity.dsl.ConstantValue;
import de.gebit.integrity.dsl.DslPackage;
import de.gebit.integrity.dsl.ExecutionMultiplier;
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>Execution Multiplier</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link de.gebit.integrity.dsl.impl.ExecutionMultiplierImpl#getCount <em>Count</em>}</li>
* </ul>
*
* @generated
*/
public class ExecutionMultiplierImpl extends MinimalEObjectImpl.Container implements ExecutionMultiplier
{
/**
* The cached value of the '{@link #getCount() <em>Count</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getCount()
* @generated
* @ordered
*/
protected ConstantValue count;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ExecutionMultiplierImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return DslPackage.Literals.EXECUTION_MULTIPLIER;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ConstantValue getCount()
{
return count;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetCount(ConstantValue newCount, NotificationChain msgs)
{
ConstantValue oldCount = count;
count = newCount;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DslPackage.EXECUTION_MULTIPLIER__COUNT, oldCount, newCount);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setCount(ConstantValue newCount)
{
if (newCount != count)
{
NotificationChain msgs = null;
if (count != null)
msgs = ((InternalEObject)count).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DslPackage.EXECUTION_MULTIPLIER__COUNT, null, msgs);
if (newCount != null)
msgs = ((InternalEObject)newCount).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DslPackage.EXECUTION_MULTIPLIER__COUNT, null, msgs);
msgs = basicSetCount(newCount, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DslPackage.EXECUTION_MULTIPLIER__COUNT, newCount, newCount));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case DslPackage.EXECUTION_MULTIPLIER__COUNT:
return basicSetCount(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 DslPackage.EXECUTION_MULTIPLIER__COUNT:
return getCount();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case DslPackage.EXECUTION_MULTIPLIER__COUNT:
setCount((ConstantValue)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case DslPackage.EXECUTION_MULTIPLIER__COUNT:
setCount((ConstantValue)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case DslPackage.EXECUTION_MULTIPLIER__COUNT:
return count != null;
}
return super.eIsSet(featureID);
}
} //ExecutionMultiplierImpl