/**
* generated by Xtext 2.14.0
*/
package ca.mcgill.ecse.dslreasoner.vampireLanguage.impl;
import ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSTerm;
import ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUnaryNegation;
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 Unary Negation'.
*
*
* The following features are implemented:
*
*
* - {@link ca.mcgill.ecse.dslreasoner.vampireLanguage.impl.VLSUnaryNegationImpl#getOperand Operand}
*
*
* @generated
*/
public class VLSUnaryNegationImpl extends VLSTermImpl implements VLSUnaryNegation
{
/**
* The cached value of the '{@link #getOperand() Operand}' containment reference.
*
*
* @see #getOperand()
* @generated
* @ordered
*/
protected VLSTerm operand;
/**
*
*
* @generated
*/
protected VLSUnaryNegationImpl()
{
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass()
{
return VampireLanguagePackage.Literals.VLS_UNARY_NEGATION;
}
/**
*
*
* @generated
*/
public VLSTerm getOperand()
{
return operand;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetOperand(VLSTerm newOperand, NotificationChain msgs)
{
VLSTerm oldOperand = operand;
operand = newOperand;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, VampireLanguagePackage.VLS_UNARY_NEGATION__OPERAND, oldOperand, newOperand);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
public void setOperand(VLSTerm newOperand)
{
if (newOperand != operand)
{
NotificationChain msgs = null;
if (operand != null)
msgs = ((InternalEObject)operand).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - VampireLanguagePackage.VLS_UNARY_NEGATION__OPERAND, null, msgs);
if (newOperand != null)
msgs = ((InternalEObject)newOperand).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - VampireLanguagePackage.VLS_UNARY_NEGATION__OPERAND, null, msgs);
msgs = basicSetOperand(newOperand, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, VampireLanguagePackage.VLS_UNARY_NEGATION__OPERAND, newOperand, newOperand));
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case VampireLanguagePackage.VLS_UNARY_NEGATION__OPERAND:
return basicSetOperand(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case VampireLanguagePackage.VLS_UNARY_NEGATION__OPERAND:
return getOperand();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case VampireLanguagePackage.VLS_UNARY_NEGATION__OPERAND:
setOperand((VLSTerm)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case VampireLanguagePackage.VLS_UNARY_NEGATION__OPERAND:
setOperand((VLSTerm)null);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case VampireLanguagePackage.VLS_UNARY_NEGATION__OPERAND:
return operand != null;
}
return super.eIsSet(featureID);
}
} //VLSUnaryNegationImpl