/**
*/
package org.eclipse.viatra.solver.language.solverLanguage.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.viatra.solver.language.solverLanguage.AbstractAssertion;
import org.eclipse.viatra.solver.language.solverLanguage.Expression;
import org.eclipse.viatra.solver.language.solverLanguage.SolverLanguagePackage;
/**
*
* An implementation of the model object 'Abstract Assertion'.
*
*
* The following features are implemented:
*
*
* - {@link org.eclipse.viatra.solver.language.solverLanguage.impl.AbstractAssertionImpl#getExpression Expression}
* - {@link org.eclipse.viatra.solver.language.solverLanguage.impl.AbstractAssertionImpl#getRange Range}
*
*
* @generated
*/
public abstract class AbstractAssertionImpl extends StatementImpl implements AbstractAssertion {
/**
* The cached value of the '{@link #getExpression() Expression}' containment reference.
*
*
* @see #getExpression()
* @generated
* @ordered
*/
protected Expression expression;
/**
* The cached value of the '{@link #getRange() Range}' containment reference.
*
*
* @see #getRange()
* @generated
* @ordered
*/
protected Expression range;
/**
*
*
* @generated
*/
protected AbstractAssertionImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return SolverLanguagePackage.Literals.ABSTRACT_ASSERTION;
}
/**
*
*
* @generated
*/
public Expression getExpression() {
return expression;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetExpression(Expression newExpression, NotificationChain msgs) {
Expression oldExpression = expression;
expression = newExpression;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET,
SolverLanguagePackage.ABSTRACT_ASSERTION__EXPRESSION, oldExpression, newExpression);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
public void setExpression(Expression newExpression) {
if (newExpression != expression) {
NotificationChain msgs = null;
if (expression != null)
msgs = ((InternalEObject) expression).eInverseRemove(this,
EOPPOSITE_FEATURE_BASE - SolverLanguagePackage.ABSTRACT_ASSERTION__EXPRESSION, null, msgs);
if (newExpression != null)
msgs = ((InternalEObject) newExpression).eInverseAdd(this,
EOPPOSITE_FEATURE_BASE - SolverLanguagePackage.ABSTRACT_ASSERTION__EXPRESSION, null, msgs);
msgs = basicSetExpression(newExpression, msgs);
if (msgs != null)
msgs.dispatch();
} else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, SolverLanguagePackage.ABSTRACT_ASSERTION__EXPRESSION,
newExpression, newExpression));
}
/**
*
*
* @generated
*/
public Expression getRange() {
return range;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetRange(Expression newRange, NotificationChain msgs) {
Expression oldRange = range;
range = newRange;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET,
SolverLanguagePackage.ABSTRACT_ASSERTION__RANGE, oldRange, newRange);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
public void setRange(Expression newRange) {
if (newRange != range) {
NotificationChain msgs = null;
if (range != null)
msgs = ((InternalEObject) range).eInverseRemove(this,
EOPPOSITE_FEATURE_BASE - SolverLanguagePackage.ABSTRACT_ASSERTION__RANGE, null, msgs);
if (newRange != null)
msgs = ((InternalEObject) newRange).eInverseAdd(this,
EOPPOSITE_FEATURE_BASE - SolverLanguagePackage.ABSTRACT_ASSERTION__RANGE, null, msgs);
msgs = basicSetRange(newRange, msgs);
if (msgs != null)
msgs.dispatch();
} else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, SolverLanguagePackage.ABSTRACT_ASSERTION__RANGE,
newRange, newRange));
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case SolverLanguagePackage.ABSTRACT_ASSERTION__EXPRESSION:
return basicSetExpression(null, msgs);
case SolverLanguagePackage.ABSTRACT_ASSERTION__RANGE:
return basicSetRange(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case SolverLanguagePackage.ABSTRACT_ASSERTION__EXPRESSION:
return getExpression();
case SolverLanguagePackage.ABSTRACT_ASSERTION__RANGE:
return getRange();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case SolverLanguagePackage.ABSTRACT_ASSERTION__EXPRESSION:
setExpression((Expression) newValue);
return;
case SolverLanguagePackage.ABSTRACT_ASSERTION__RANGE:
setRange((Expression) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case SolverLanguagePackage.ABSTRACT_ASSERTION__EXPRESSION:
setExpression((Expression) null);
return;
case SolverLanguagePackage.ABSTRACT_ASSERTION__RANGE:
setRange((Expression) null);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case SolverLanguagePackage.ABSTRACT_ASSERTION__EXPRESSION:
return expression != null;
case SolverLanguagePackage.ABSTRACT_ASSERTION__RANGE:
return range != null;
}
return super.eIsSet(featureID);
}
} //AbstractAssertionImpl