org.openxma.dsl.dom.model.impl.AltWhenClauseImpl Maven / Gradle / Ivy
/**
*
*
*
* $Id$
*/
package org.openxma.dsl.dom.model.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.openxma.dsl.dom.DomPackage;
import org.openxma.dsl.dom.model.AltWhenClause;
import org.openxma.dsl.dom.model.Expression;
/**
*
* An implementation of the model object 'Alt When Clause'.
*
*
* The following features are implemented:
*
* - {@link org.openxma.dsl.dom.model.impl.AltWhenClauseImpl#getWhenExpression When Expression}
* - {@link org.openxma.dsl.dom.model.impl.AltWhenClauseImpl#getThenExpression Then Expression}
*
*
*
* @generated
*/
public class AltWhenClauseImpl extends MinimalEObjectImpl.Container implements AltWhenClause {
/**
* The cached value of the '{@link #getWhenExpression() When Expression}' containment reference.
*
*
* @see #getWhenExpression()
* @generated
* @ordered
*/
protected Expression whenExpression;
/**
* The cached value of the '{@link #getThenExpression() Then Expression}' containment reference.
*
*
* @see #getThenExpression()
* @generated
* @ordered
*/
protected Expression thenExpression;
/**
*
*
* @generated
*/
protected AltWhenClauseImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return DomPackage.Literals.ALT_WHEN_CLAUSE;
}
/**
*
*
* @generated
*/
public Expression getWhenExpression() {
return whenExpression;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetWhenExpression(Expression newWhenExpression, NotificationChain msgs) {
Expression oldWhenExpression = whenExpression;
whenExpression = newWhenExpression;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DomPackage.ALT_WHEN_CLAUSE__WHEN_EXPRESSION, oldWhenExpression, newWhenExpression);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
public void setWhenExpression(Expression newWhenExpression) {
if (newWhenExpression != whenExpression) {
NotificationChain msgs = null;
if (whenExpression != null)
msgs = ((InternalEObject)whenExpression).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DomPackage.ALT_WHEN_CLAUSE__WHEN_EXPRESSION, null, msgs);
if (newWhenExpression != null)
msgs = ((InternalEObject)newWhenExpression).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DomPackage.ALT_WHEN_CLAUSE__WHEN_EXPRESSION, null, msgs);
msgs = basicSetWhenExpression(newWhenExpression, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DomPackage.ALT_WHEN_CLAUSE__WHEN_EXPRESSION, newWhenExpression, newWhenExpression));
}
/**
*
*
* @generated
*/
public Expression getThenExpression() {
return thenExpression;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetThenExpression(Expression newThenExpression, NotificationChain msgs) {
Expression oldThenExpression = thenExpression;
thenExpression = newThenExpression;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DomPackage.ALT_WHEN_CLAUSE__THEN_EXPRESSION, oldThenExpression, newThenExpression);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
public void setThenExpression(Expression newThenExpression) {
if (newThenExpression != thenExpression) {
NotificationChain msgs = null;
if (thenExpression != null)
msgs = ((InternalEObject)thenExpression).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DomPackage.ALT_WHEN_CLAUSE__THEN_EXPRESSION, null, msgs);
if (newThenExpression != null)
msgs = ((InternalEObject)newThenExpression).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DomPackage.ALT_WHEN_CLAUSE__THEN_EXPRESSION, null, msgs);
msgs = basicSetThenExpression(newThenExpression, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DomPackage.ALT_WHEN_CLAUSE__THEN_EXPRESSION, newThenExpression, newThenExpression));
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case DomPackage.ALT_WHEN_CLAUSE__WHEN_EXPRESSION:
return basicSetWhenExpression(null, msgs);
case DomPackage.ALT_WHEN_CLAUSE__THEN_EXPRESSION:
return basicSetThenExpression(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case DomPackage.ALT_WHEN_CLAUSE__WHEN_EXPRESSION:
return getWhenExpression();
case DomPackage.ALT_WHEN_CLAUSE__THEN_EXPRESSION:
return getThenExpression();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case DomPackage.ALT_WHEN_CLAUSE__WHEN_EXPRESSION:
setWhenExpression((Expression)newValue);
return;
case DomPackage.ALT_WHEN_CLAUSE__THEN_EXPRESSION:
setThenExpression((Expression)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case DomPackage.ALT_WHEN_CLAUSE__WHEN_EXPRESSION:
setWhenExpression((Expression)null);
return;
case DomPackage.ALT_WHEN_CLAUSE__THEN_EXPRESSION:
setThenExpression((Expression)null);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case DomPackage.ALT_WHEN_CLAUSE__WHEN_EXPRESSION:
return whenExpression != null;
case DomPackage.ALT_WHEN_CLAUSE__THEN_EXPRESSION:
return thenExpression != null;
}
return super.eIsSet(featureID);
}
} //AltWhenClauseImpl