/**
*/
package net.certware.argument.language.l.impl;
import net.certware.argument.language.l.ArithmeticTerm;
import net.certware.argument.language.l.LPackage;
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.EObject;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Arithmetic Term</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link net.certware.argument.language.l.impl.ArithmeticTermImpl#getTerm <em>Term</em>}</li>
* <li>{@link net.certware.argument.language.l.impl.ArithmeticTermImpl#getLhs <em>Lhs</em>}</li>
* <li>{@link net.certware.argument.language.l.impl.ArithmeticTermImpl#getRhs <em>Rhs</em>}</li>
* </ul>
*
* @generated
*/
public class ArithmeticTermImpl extends BasicTermImpl implements ArithmeticTerm
{
/**
* The cached value of the '{@link #getTerm() <em>Term</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getTerm()
* @generated
* @ordered
*/
protected EObject term;
/**
* The cached value of the '{@link #getLhs() <em>Lhs</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getLhs()
* @generated
* @ordered
*/
protected ArithmeticTerm lhs;
/**
* The cached value of the '{@link #getRhs() <em>Rhs</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getRhs()
* @generated
* @ordered
*/
protected ArithmeticTerm rhs;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ArithmeticTermImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return LPackage.Literals.ARITHMETIC_TERM;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EObject getTerm()
{
return term;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetTerm(EObject newTerm, NotificationChain msgs)
{
EObject oldTerm = term;
term = newTerm;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, LPackage.ARITHMETIC_TERM__TERM, oldTerm, newTerm);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setTerm(EObject newTerm)
{
if (newTerm != term)
{
NotificationChain msgs = null;
if (term != null)
msgs = ((InternalEObject)term).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - LPackage.ARITHMETIC_TERM__TERM, null, msgs);
if (newTerm != null)
msgs = ((InternalEObject)newTerm).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - LPackage.ARITHMETIC_TERM__TERM, null, msgs);
msgs = basicSetTerm(newTerm, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, LPackage.ARITHMETIC_TERM__TERM, newTerm, newTerm));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ArithmeticTerm getLhs()
{
return lhs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetLhs(ArithmeticTerm newLhs, NotificationChain msgs)
{
ArithmeticTerm oldLhs = lhs;
lhs = newLhs;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, LPackage.ARITHMETIC_TERM__LHS, oldLhs, newLhs);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setLhs(ArithmeticTerm newLhs)
{
if (newLhs != lhs)
{
NotificationChain msgs = null;
if (lhs != null)
msgs = ((InternalEObject)lhs).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - LPackage.ARITHMETIC_TERM__LHS, null, msgs);
if (newLhs != null)
msgs = ((InternalEObject)newLhs).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - LPackage.ARITHMETIC_TERM__LHS, null, msgs);
msgs = basicSetLhs(newLhs, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, LPackage.ARITHMETIC_TERM__LHS, newLhs, newLhs));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ArithmeticTerm getRhs()
{
return rhs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetRhs(ArithmeticTerm newRhs, NotificationChain msgs)
{
ArithmeticTerm oldRhs = rhs;
rhs = newRhs;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, LPackage.ARITHMETIC_TERM__RHS, oldRhs, newRhs);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setRhs(ArithmeticTerm newRhs)
{
if (newRhs != rhs)
{
NotificationChain msgs = null;
if (rhs != null)
msgs = ((InternalEObject)rhs).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - LPackage.ARITHMETIC_TERM__RHS, null, msgs);
if (newRhs != null)
msgs = ((InternalEObject)newRhs).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - LPackage.ARITHMETIC_TERM__RHS, null, msgs);
msgs = basicSetRhs(newRhs, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, LPackage.ARITHMETIC_TERM__RHS, newRhs, newRhs));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case LPackage.ARITHMETIC_TERM__TERM:
return basicSetTerm(null, msgs);
case LPackage.ARITHMETIC_TERM__LHS:
return basicSetLhs(null, msgs);
case LPackage.ARITHMETIC_TERM__RHS:
return basicSetRhs(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case LPackage.ARITHMETIC_TERM__TERM:
return getTerm();
case LPackage.ARITHMETIC_TERM__LHS:
return getLhs();
case LPackage.ARITHMETIC_TERM__RHS:
return getRhs();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case LPackage.ARITHMETIC_TERM__TERM:
setTerm((EObject)newValue);
return;
case LPackage.ARITHMETIC_TERM__LHS:
setLhs((ArithmeticTerm)newValue);
return;
case LPackage.ARITHMETIC_TERM__RHS:
setRhs((ArithmeticTerm)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case LPackage.ARITHMETIC_TERM__TERM:
setTerm((EObject)null);
return;
case LPackage.ARITHMETIC_TERM__LHS:
setLhs((ArithmeticTerm)null);
return;
case LPackage.ARITHMETIC_TERM__RHS:
setRhs((ArithmeticTerm)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case LPackage.ARITHMETIC_TERM__TERM:
return term != null;
case LPackage.ARITHMETIC_TERM__LHS:
return lhs != null;
case LPackage.ARITHMETIC_TERM__RHS:
return rhs != null;
}
return super.eIsSet(featureID);
}
} //ArithmeticTermImpl