/**
* generated by Xtext 2.14.0
*/
package ca.mcgill.ecse.dslreasoner.vampireLanguage.impl;
import ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSEquivalent;
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 Equivalent'.
*
*
* The following features are implemented:
*
*
* - {@link ca.mcgill.ecse.dslreasoner.vampireLanguage.impl.VLSEquivalentImpl#getLeft Left}
* - {@link ca.mcgill.ecse.dslreasoner.vampireLanguage.impl.VLSEquivalentImpl#getRight Right}
*
*
* @generated
*/
public class VLSEquivalentImpl extends VLSTermImpl implements VLSEquivalent
{
/**
* 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 VLSEquivalentImpl()
{
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass()
{
return VampireLanguagePackage.Literals.VLS_EQUIVALENT;
}
/**
*
*
* @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_EQUIVALENT__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_EQUIVALENT__LEFT, null, msgs);
if (newLeft != null)
msgs = ((InternalEObject)newLeft).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - VampireLanguagePackage.VLS_EQUIVALENT__LEFT, null, msgs);
msgs = basicSetLeft(newLeft, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, VampireLanguagePackage.VLS_EQUIVALENT__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_EQUIVALENT__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_EQUIVALENT__RIGHT, null, msgs);
if (newRight != null)
msgs = ((InternalEObject)newRight).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - VampireLanguagePackage.VLS_EQUIVALENT__RIGHT, null, msgs);
msgs = basicSetRight(newRight, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, VampireLanguagePackage.VLS_EQUIVALENT__RIGHT, newRight, newRight));
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case VampireLanguagePackage.VLS_EQUIVALENT__LEFT:
return basicSetLeft(null, msgs);
case VampireLanguagePackage.VLS_EQUIVALENT__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_EQUIVALENT__LEFT:
return getLeft();
case VampireLanguagePackage.VLS_EQUIVALENT__RIGHT:
return getRight();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case VampireLanguagePackage.VLS_EQUIVALENT__LEFT:
setLeft((VLSTerm)newValue);
return;
case VampireLanguagePackage.VLS_EQUIVALENT__RIGHT:
setRight((VLSTerm)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case VampireLanguagePackage.VLS_EQUIVALENT__LEFT:
setLeft((VLSTerm)null);
return;
case VampireLanguagePackage.VLS_EQUIVALENT__RIGHT:
setRight((VLSTerm)null);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case VampireLanguagePackage.VLS_EQUIVALENT__LEFT:
return left != null;
case VampireLanguagePackage.VLS_EQUIVALENT__RIGHT:
return right != null;
}
return super.eIsSet(featureID);
}
} //VLSEquivalentImpl