/**
*/
package hu.bme.mit.inf.dslreasoner.alloyLanguage.impl;
import hu.bme.mit.inf.dslreasoner.alloyLanguage.ALSReference;
import hu.bme.mit.inf.dslreasoner.alloyLanguage.ALSRelationDeclaration;
import hu.bme.mit.inf.dslreasoner.alloyLanguage.AlloyLanguagePackage;
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 'ALS Reference'.
*
*
* The following features are implemented:
*
*
* - {@link hu.bme.mit.inf.dslreasoner.alloyLanguage.impl.ALSReferenceImpl#getReferred Referred}
*
*
* @generated
*/
public class ALSReferenceImpl extends ALSTermImpl implements ALSReference
{
/**
* The cached value of the '{@link #getReferred() Referred}' reference.
*
*
* @see #getReferred()
* @generated
* @ordered
*/
protected ALSRelationDeclaration referred;
/**
*
*
* @generated
*/
protected ALSReferenceImpl()
{
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass()
{
return AlloyLanguagePackage.Literals.ALS_REFERENCE;
}
/**
*
*
* @generated
*/
public ALSRelationDeclaration getReferred()
{
if (referred != null && referred.eIsProxy())
{
InternalEObject oldReferred = (InternalEObject)referred;
referred = (ALSRelationDeclaration)eResolveProxy(oldReferred);
if (referred != oldReferred)
{
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, AlloyLanguagePackage.ALS_REFERENCE__REFERRED, oldReferred, referred));
}
}
return referred;
}
/**
*
*
* @generated
*/
public ALSRelationDeclaration basicGetReferred()
{
return referred;
}
/**
*
*
* @generated
*/
public void setReferred(ALSRelationDeclaration newReferred)
{
ALSRelationDeclaration oldReferred = referred;
referred = newReferred;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AlloyLanguagePackage.ALS_REFERENCE__REFERRED, oldReferred, referred));
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case AlloyLanguagePackage.ALS_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 AlloyLanguagePackage.ALS_REFERENCE__REFERRED:
setReferred((ALSRelationDeclaration)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case AlloyLanguagePackage.ALS_REFERENCE__REFERRED:
setReferred((ALSRelationDeclaration)null);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case AlloyLanguagePackage.ALS_REFERENCE__REFERRED:
return referred != null;
}
return super.eIsSet(featureID);
}
} //ALSReferenceImpl