/**
* generated by Xtext 2.14.0
*/
package ca.mcgill.ecse.dslreasoner.vampireLanguage.impl;
import ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSDeclaration;
import ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSTypeDef;
import ca.mcgill.ecse.dslreasoner.vampireLanguage.VampireLanguagePackage;
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 'VLS Declaration'.
*
*
* The following features are implemented:
*
*
* - {@link ca.mcgill.ecse.dslreasoner.vampireLanguage.impl.VLSDeclarationImpl#getType Type}
*
*
* @generated
*/
public class VLSDeclarationImpl extends VLSTffTermImpl implements VLSDeclaration
{
/**
* The cached value of the '{@link #getType() Type}' containment reference.
*
*
* @see #getType()
* @generated
* @ordered
*/
protected VLSTypeDef type;
/**
*
*
* @generated
*/
protected VLSDeclarationImpl()
{
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass()
{
return VampireLanguagePackage.Literals.VLS_DECLARATION;
}
/**
*
*
* @generated
*/
public VLSTypeDef getType()
{
return type;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetType(VLSTypeDef newType, NotificationChain msgs)
{
VLSTypeDef oldType = type;
type = newType;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, VampireLanguagePackage.VLS_DECLARATION__TYPE, oldType, newType);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
public void setType(VLSTypeDef newType)
{
if (newType != type)
{
NotificationChain msgs = null;
if (type != null)
msgs = ((InternalEObject)type).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - VampireLanguagePackage.VLS_DECLARATION__TYPE, null, msgs);
if (newType != null)
msgs = ((InternalEObject)newType).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - VampireLanguagePackage.VLS_DECLARATION__TYPE, null, msgs);
msgs = basicSetType(newType, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, VampireLanguagePackage.VLS_DECLARATION__TYPE, newType, newType));
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case VampireLanguagePackage.VLS_DECLARATION__TYPE:
return basicSetType(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case VampireLanguagePackage.VLS_DECLARATION__TYPE:
return getType();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case VampireLanguagePackage.VLS_DECLARATION__TYPE:
setType((VLSTypeDef)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case VampireLanguagePackage.VLS_DECLARATION__TYPE:
setType((VLSTypeDef)null);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case VampireLanguagePackage.VLS_DECLARATION__TYPE:
return type != null;
}
return super.eIsSet(featureID);
}
} //VLSDeclarationImpl