/**
* generated by Xtext 2.17.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.MetamodelDeclaration;
import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.MetamodelReference;
import org.eclipse.emf.common.notify.Notification;
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 'Metamodel Reference'.
*
*
* The following features are implemented:
*
*
* - {@link hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.impl.MetamodelReferenceImpl#getReferred Referred}
*
*
* @generated
*/
public class MetamodelReferenceImpl extends MetamodelImpl implements MetamodelReference
{
/**
* The cached value of the '{@link #getReferred() Referred}' reference.
*
*
* @see #getReferred()
* @generated
* @ordered
*/
protected MetamodelDeclaration referred;
/**
*
*
* @generated
*/
protected MetamodelReferenceImpl()
{
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass()
{
return ApplicationConfigurationPackage.Literals.METAMODEL_REFERENCE;
}
/**
*
*
* @generated
*/
@Override
public MetamodelDeclaration getReferred()
{
if (referred != null && referred.eIsProxy())
{
InternalEObject oldReferred = (InternalEObject)referred;
referred = (MetamodelDeclaration)eResolveProxy(oldReferred);
if (referred != oldReferred)
{
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, ApplicationConfigurationPackage.METAMODEL_REFERENCE__REFERRED, oldReferred, referred));
}
}
return referred;
}
/**
*
*
* @generated
*/
public MetamodelDeclaration basicGetReferred()
{
return referred;
}
/**
*
*
* @generated
*/
@Override
public void setReferred(MetamodelDeclaration newReferred)
{
MetamodelDeclaration oldReferred = referred;
referred = newReferred;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ApplicationConfigurationPackage.METAMODEL_REFERENCE__REFERRED, oldReferred, referred));
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case ApplicationConfigurationPackage.METAMODEL_REFERENCE__REFERRED:
if (resolve) return getReferred();
return basicGetReferred();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case ApplicationConfigurationPackage.METAMODEL_REFERENCE__REFERRED:
setReferred((MetamodelDeclaration)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case ApplicationConfigurationPackage.METAMODEL_REFERENCE__REFERRED:
setReferred((MetamodelDeclaration)null);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case ApplicationConfigurationPackage.METAMODEL_REFERENCE__REFERRED:
return referred != null;
}
return super.eIsSet(featureID);
}
} //MetamodelReferenceImpl