/**
* generated by Xtext 2.21.0
*/
package hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.impl;
import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.ApplicationConfigurationPackage;
import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.ObjectiveEntry;
import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.ObjectiveFunction;
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;
/**
*
* An implementation of the model object 'Objective Entry'.
*
*
* The following features are implemented:
*
*
* - {@link hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.impl.ObjectiveEntryImpl#getFunction Function}
*
*
* @generated
*/
public class ObjectiveEntryImpl extends MinimalEObjectImpl.Container implements ObjectiveEntry
{
/**
* The cached value of the '{@link #getFunction() Function}' containment reference.
*
*
* @see #getFunction()
* @generated
* @ordered
*/
protected ObjectiveFunction function;
/**
*
*
* @generated
*/
protected ObjectiveEntryImpl()
{
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass()
{
return ApplicationConfigurationPackage.Literals.OBJECTIVE_ENTRY;
}
/**
*
*
* @generated
*/
@Override
public ObjectiveFunction getFunction()
{
return function;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetFunction(ObjectiveFunction newFunction, NotificationChain msgs)
{
ObjectiveFunction oldFunction = function;
function = newFunction;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ApplicationConfigurationPackage.OBJECTIVE_ENTRY__FUNCTION, oldFunction, newFunction);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
@Override
public void setFunction(ObjectiveFunction newFunction)
{
if (newFunction != function)
{
NotificationChain msgs = null;
if (function != null)
msgs = ((InternalEObject)function).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ApplicationConfigurationPackage.OBJECTIVE_ENTRY__FUNCTION, null, msgs);
if (newFunction != null)
msgs = ((InternalEObject)newFunction).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ApplicationConfigurationPackage.OBJECTIVE_ENTRY__FUNCTION, null, msgs);
msgs = basicSetFunction(newFunction, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ApplicationConfigurationPackage.OBJECTIVE_ENTRY__FUNCTION, newFunction, newFunction));
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case ApplicationConfigurationPackage.OBJECTIVE_ENTRY__FUNCTION:
return basicSetFunction(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case ApplicationConfigurationPackage.OBJECTIVE_ENTRY__FUNCTION:
return getFunction();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case ApplicationConfigurationPackage.OBJECTIVE_ENTRY__FUNCTION:
setFunction((ObjectiveFunction)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case ApplicationConfigurationPackage.OBJECTIVE_ENTRY__FUNCTION:
setFunction((ObjectiveFunction)null);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case ApplicationConfigurationPackage.OBJECTIVE_ENTRY__FUNCTION:
return function != null;
}
return super.eIsSet(featureID);
}
} //ObjectiveEntryImpl