/**
*/
package hu.bme.mit.inf.dslreasoner.alloyLanguage.impl;
import hu.bme.mit.inf.dslreasoner.alloyLanguage.ALSTerm;
import hu.bme.mit.inf.dslreasoner.alloyLanguage.ALSVariableDeclaration;
import hu.bme.mit.inf.dslreasoner.alloyLanguage.AlloyLanguagePackage;
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 'ALS Variable Declaration'.
*
*
* The following features are implemented:
*
*
* - {@link hu.bme.mit.inf.dslreasoner.alloyLanguage.impl.ALSVariableDeclarationImpl#getRange Range}
*
*
* @generated
*/
public class ALSVariableDeclarationImpl extends ALSRelationDeclarationImpl implements ALSVariableDeclaration
{
/**
* The cached value of the '{@link #getRange() Range}' containment reference.
*
*
* @see #getRange()
* @generated
* @ordered
*/
protected ALSTerm range;
/**
*
*
* @generated
*/
protected ALSVariableDeclarationImpl()
{
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass()
{
return AlloyLanguagePackage.Literals.ALS_VARIABLE_DECLARATION;
}
/**
*
*
* @generated
*/
public ALSTerm getRange()
{
return range;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetRange(ALSTerm newRange, NotificationChain msgs)
{
ALSTerm oldRange = range;
range = newRange;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, AlloyLanguagePackage.ALS_VARIABLE_DECLARATION__RANGE, oldRange, newRange);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
public void setRange(ALSTerm newRange)
{
if (newRange != range)
{
NotificationChain msgs = null;
if (range != null)
msgs = ((InternalEObject)range).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - AlloyLanguagePackage.ALS_VARIABLE_DECLARATION__RANGE, null, msgs);
if (newRange != null)
msgs = ((InternalEObject)newRange).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - AlloyLanguagePackage.ALS_VARIABLE_DECLARATION__RANGE, null, msgs);
msgs = basicSetRange(newRange, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AlloyLanguagePackage.ALS_VARIABLE_DECLARATION__RANGE, newRange, newRange));
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case AlloyLanguagePackage.ALS_VARIABLE_DECLARATION__RANGE:
return basicSetRange(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case AlloyLanguagePackage.ALS_VARIABLE_DECLARATION__RANGE:
return getRange();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case AlloyLanguagePackage.ALS_VARIABLE_DECLARATION__RANGE:
setRange((ALSTerm)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case AlloyLanguagePackage.ALS_VARIABLE_DECLARATION__RANGE:
setRange((ALSTerm)null);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case AlloyLanguagePackage.ALS_VARIABLE_DECLARATION__RANGE:
return range != null;
}
return super.eIsSet(featureID);
}
} //ALSVariableDeclarationImpl