blob: 3f2b6085be4d43ba45f7bb0c4c6daf4307288de5 [file] [log] [blame]
/**
*/
package org.polarsys.chess.xtext.flaDsl.impl;
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;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
import org.polarsys.chess.xtext.flaDsl.Expression;
import org.polarsys.chess.xtext.flaDsl.FlaDslPackage;
import org.polarsys.chess.xtext.flaDsl.Lhs;
import org.polarsys.chess.xtext.flaDsl.Rhs;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Expression</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.polarsys.chess.xtext.flaDsl.impl.ExpressionImpl#getLhs <em>Lhs</em>}</li>
* <li>{@link org.polarsys.chess.xtext.flaDsl.impl.ExpressionImpl#getRhs <em>Rhs</em>}</li>
* </ul>
*
* @generated
*/
public class ExpressionImpl extends MinimalEObjectImpl.Container implements Expression
{
/**
* The cached value of the '{@link #getLhs() <em>Lhs</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getLhs()
* @generated
* @ordered
*/
protected Lhs lhs;
/**
* The cached value of the '{@link #getRhs() <em>Rhs</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getRhs()
* @generated
* @ordered
*/
protected Rhs rhs;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ExpressionImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return FlaDslPackage.Literals.EXPRESSION;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Lhs getLhs()
{
return lhs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetLhs(Lhs newLhs, NotificationChain msgs)
{
Lhs oldLhs = lhs;
lhs = newLhs;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FlaDslPackage.EXPRESSION__LHS, oldLhs, newLhs);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setLhs(Lhs newLhs)
{
if (newLhs != lhs)
{
NotificationChain msgs = null;
if (lhs != null)
msgs = ((InternalEObject)lhs).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FlaDslPackage.EXPRESSION__LHS, null, msgs);
if (newLhs != null)
msgs = ((InternalEObject)newLhs).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FlaDslPackage.EXPRESSION__LHS, null, msgs);
msgs = basicSetLhs(newLhs, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FlaDslPackage.EXPRESSION__LHS, newLhs, newLhs));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Rhs getRhs()
{
return rhs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetRhs(Rhs newRhs, NotificationChain msgs)
{
Rhs oldRhs = rhs;
rhs = newRhs;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FlaDslPackage.EXPRESSION__RHS, oldRhs, newRhs);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setRhs(Rhs newRhs)
{
if (newRhs != rhs)
{
NotificationChain msgs = null;
if (rhs != null)
msgs = ((InternalEObject)rhs).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FlaDslPackage.EXPRESSION__RHS, null, msgs);
if (newRhs != null)
msgs = ((InternalEObject)newRhs).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FlaDslPackage.EXPRESSION__RHS, null, msgs);
msgs = basicSetRhs(newRhs, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FlaDslPackage.EXPRESSION__RHS, newRhs, newRhs));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case FlaDslPackage.EXPRESSION__LHS:
return basicSetLhs(null, msgs);
case FlaDslPackage.EXPRESSION__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 FlaDslPackage.EXPRESSION__LHS:
return getLhs();
case FlaDslPackage.EXPRESSION__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 FlaDslPackage.EXPRESSION__LHS:
setLhs((Lhs)newValue);
return;
case FlaDslPackage.EXPRESSION__RHS:
setRhs((Rhs)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case FlaDslPackage.EXPRESSION__LHS:
setLhs((Lhs)null);
return;
case FlaDslPackage.EXPRESSION__RHS:
setRhs((Rhs)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case FlaDslPackage.EXPRESSION__LHS:
return lhs != null;
case FlaDslPackage.EXPRESSION__RHS:
return rhs != null;
}
return super.eIsSet(featureID);
}
} //ExpressionImpl