/**
* generated by Xtext 2.12.0
*/
package ca.mcgill.ecse.dslreasoner.vampireLanguage.impl;
import ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSInequality;
import ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSTerm;
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 Inequality'.
*
*
* The following features are implemented:
*
*
* - {@link ca.mcgill.ecse.dslreasoner.vampireLanguage.impl.VLSInequalityImpl#getLeft Left}
* - {@link ca.mcgill.ecse.dslreasoner.vampireLanguage.impl.VLSInequalityImpl#getRight Right}
*
*
* @generated
*/
public class VLSInequalityImpl extends VLSTermImpl implements VLSInequality
{
/**
* The cached value of the '{@link #getLeft() Left}' containment reference.
*
*
* @see #getLeft()
* @generated
* @ordered
*/
protected VLSTerm left;
/**
* The cached value of the '{@link #getRight() Right}' containment reference.
*
*
* @see #getRight()
* @generated
* @ordered
*/
protected VLSTerm right;
/**
*
*
* @generated
*/
protected VLSInequalityImpl()
{
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass()
{
return VampireLanguagePackage.Literals.VLS_INEQUALITY;
}
/**
*
*
* @generated
*/
public VLSTerm getLeft()
{
return left;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetLeft(VLSTerm newLeft, NotificationChain msgs)
{
VLSTerm oldLeft = left;
left = newLeft;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, VampireLanguagePackage.VLS_INEQUALITY__LEFT, oldLeft, newLeft);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
public void setLeft(VLSTerm newLeft)
{
if (newLeft != left)
{
NotificationChain msgs = null;
if (left != null)
msgs = ((InternalEObject)left).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - VampireLanguagePackage.VLS_INEQUALITY__LEFT, null, msgs);
if (newLeft != null)
msgs = ((InternalEObject)newLeft).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - VampireLanguagePackage.VLS_INEQUALITY__LEFT, null, msgs);
msgs = basicSetLeft(newLeft, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, VampireLanguagePackage.VLS_INEQUALITY__LEFT, newLeft, newLeft));
}
/**
*
*
* @generated
*/
public VLSTerm getRight()
{
return right;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetRight(VLSTerm newRight, NotificationChain msgs)
{
VLSTerm oldRight = right;
right = newRight;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, VampireLanguagePackage.VLS_INEQUALITY__RIGHT, oldRight, newRight);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
public void setRight(VLSTerm newRight)
{
if (newRight != right)
{
NotificationChain msgs = null;
if (right != null)
msgs = ((InternalEObject)right).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - VampireLanguagePackage.VLS_INEQUALITY__RIGHT, null, msgs);
if (newRight != null)
msgs = ((InternalEObject)newRight).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - VampireLanguagePackage.VLS_INEQUALITY__RIGHT, null, msgs);
msgs = basicSetRight(newRight, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, VampireLanguagePackage.VLS_INEQUALITY__RIGHT, newRight, newRight));
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case VampireLanguagePackage.VLS_INEQUALITY__LEFT:
return basicSetLeft(null, msgs);
case VampireLanguagePackage.VLS_INEQUALITY__RIGHT:
return basicSetRight(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case VampireLanguagePackage.VLS_INEQUALITY__LEFT:
return getLeft();
case VampireLanguagePackage.VLS_INEQUALITY__RIGHT:
return getRight();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case VampireLanguagePackage.VLS_INEQUALITY__LEFT:
setLeft((VLSTerm)newValue);
return;
case VampireLanguagePackage.VLS_INEQUALITY__RIGHT:
setRight((VLSTerm)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case VampireLanguagePackage.VLS_INEQUALITY__LEFT:
setLeft((VLSTerm)null);
return;
case VampireLanguagePackage.VLS_INEQUALITY__RIGHT:
setRight((VLSTerm)null);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case VampireLanguagePackage.VLS_INEQUALITY__LEFT:
return left != null;
case VampireLanguagePackage.VLS_INEQUALITY__RIGHT:
return right != null;
}
return super.eIsSet(featureID);
}
} //VLSInequalityImpl