/**
* generated by Xtext 2.12.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.ClassReference;
import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.MetamodelElement;
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;
/**
*
* An implementation of the model object 'Class Reference'.
*
*
* The following features are implemented:
*
*
* - {@link hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.impl.ClassReferenceImpl#getElement Element}
*
*
* @generated
*/
public class ClassReferenceImpl extends TypeReferenceImpl implements ClassReference
{
/**
* The cached value of the '{@link #getElement() Element}' containment reference.
*
*
* @see #getElement()
* @generated
* @ordered
*/
protected MetamodelElement element;
/**
*
*
* @generated
*/
protected ClassReferenceImpl()
{
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass()
{
return ApplicationConfigurationPackage.Literals.CLASS_REFERENCE;
}
/**
*
*
* @generated
*/
public MetamodelElement getElement()
{
return element;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetElement(MetamodelElement newElement, NotificationChain msgs)
{
MetamodelElement oldElement = element;
element = newElement;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ApplicationConfigurationPackage.CLASS_REFERENCE__ELEMENT, oldElement, newElement);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
public void setElement(MetamodelElement newElement)
{
if (newElement != element)
{
NotificationChain msgs = null;
if (element != null)
msgs = ((InternalEObject)element).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ApplicationConfigurationPackage.CLASS_REFERENCE__ELEMENT, null, msgs);
if (newElement != null)
msgs = ((InternalEObject)newElement).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ApplicationConfigurationPackage.CLASS_REFERENCE__ELEMENT, null, msgs);
msgs = basicSetElement(newElement, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ApplicationConfigurationPackage.CLASS_REFERENCE__ELEMENT, newElement, newElement));
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case ApplicationConfigurationPackage.CLASS_REFERENCE__ELEMENT:
return basicSetElement(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case ApplicationConfigurationPackage.CLASS_REFERENCE__ELEMENT:
return getElement();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case ApplicationConfigurationPackage.CLASS_REFERENCE__ELEMENT:
setElement((MetamodelElement)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case ApplicationConfigurationPackage.CLASS_REFERENCE__ELEMENT:
setElement((MetamodelElement)null);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case ApplicationConfigurationPackage.CLASS_REFERENCE__ELEMENT:
return element != null;
}
return super.eIsSet(featureID);
}
} //ClassReferenceImpl