/** */ package hu.bme.mit.inf.dslreasoner.smtLanguage.impl; import hu.bme.mit.inf.dslreasoner.smtLanguage.SMTQuantifiedExpression; import hu.bme.mit.inf.dslreasoner.smtLanguage.SMTSortedVariable; import hu.bme.mit.inf.dslreasoner.smtLanguage.SMTTerm; import hu.bme.mit.inf.dslreasoner.smtLanguage.SmtLanguagePackage; import java.util.Collection; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.InternalEList; /** * * An implementation of the model object 'SMT Quantified Expression'. * *

* The following features are implemented: *

*

* * @generated */ public class SMTQuantifiedExpressionImpl extends SMTTermImpl implements SMTQuantifiedExpression { /** * The cached value of the '{@link #getQuantifiedVariables() Quantified Variables}' containment reference list. * * * @see #getQuantifiedVariables() * @generated * @ordered */ protected EList quantifiedVariables; /** * The cached value of the '{@link #getExpression() Expression}' containment reference. * * * @see #getExpression() * @generated * @ordered */ protected SMTTerm expression; /** * The cached value of the '{@link #getPattern() Pattern}' containment reference. * * * @see #getPattern() * @generated * @ordered */ protected SMTTerm pattern; /** * * * @generated */ protected SMTQuantifiedExpressionImpl() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return SmtLanguagePackage.Literals.SMT_QUANTIFIED_EXPRESSION; } /** * * * @generated */ public EList getQuantifiedVariables() { if (quantifiedVariables == null) { quantifiedVariables = new EObjectContainmentEList(SMTSortedVariable.class, this, SmtLanguagePackage.SMT_QUANTIFIED_EXPRESSION__QUANTIFIED_VARIABLES); } return quantifiedVariables; } /** * * * @generated */ public SMTTerm getExpression() { return expression; } /** * * * @generated */ public NotificationChain basicSetExpression(SMTTerm newExpression, NotificationChain msgs) { SMTTerm oldExpression = expression; expression = newExpression; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SmtLanguagePackage.SMT_QUANTIFIED_EXPRESSION__EXPRESSION, oldExpression, newExpression); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * * * @generated */ public void setExpression(SMTTerm newExpression) { if (newExpression != expression) { NotificationChain msgs = null; if (expression != null) msgs = ((InternalEObject)expression).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - SmtLanguagePackage.SMT_QUANTIFIED_EXPRESSION__EXPRESSION, null, msgs); if (newExpression != null) msgs = ((InternalEObject)newExpression).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - SmtLanguagePackage.SMT_QUANTIFIED_EXPRESSION__EXPRESSION, null, msgs); msgs = basicSetExpression(newExpression, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, SmtLanguagePackage.SMT_QUANTIFIED_EXPRESSION__EXPRESSION, newExpression, newExpression)); } /** * * * @generated */ public SMTTerm getPattern() { return pattern; } /** * * * @generated */ public NotificationChain basicSetPattern(SMTTerm newPattern, NotificationChain msgs) { SMTTerm oldPattern = pattern; pattern = newPattern; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SmtLanguagePackage.SMT_QUANTIFIED_EXPRESSION__PATTERN, oldPattern, newPattern); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * * * @generated */ public void setPattern(SMTTerm newPattern) { if (newPattern != pattern) { NotificationChain msgs = null; if (pattern != null) msgs = ((InternalEObject)pattern).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - SmtLanguagePackage.SMT_QUANTIFIED_EXPRESSION__PATTERN, null, msgs); if (newPattern != null) msgs = ((InternalEObject)newPattern).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - SmtLanguagePackage.SMT_QUANTIFIED_EXPRESSION__PATTERN, null, msgs); msgs = basicSetPattern(newPattern, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, SmtLanguagePackage.SMT_QUANTIFIED_EXPRESSION__PATTERN, newPattern, newPattern)); } /** * * * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case SmtLanguagePackage.SMT_QUANTIFIED_EXPRESSION__QUANTIFIED_VARIABLES: return ((InternalEList)getQuantifiedVariables()).basicRemove(otherEnd, msgs); case SmtLanguagePackage.SMT_QUANTIFIED_EXPRESSION__EXPRESSION: return basicSetExpression(null, msgs); case SmtLanguagePackage.SMT_QUANTIFIED_EXPRESSION__PATTERN: return basicSetPattern(null, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case SmtLanguagePackage.SMT_QUANTIFIED_EXPRESSION__QUANTIFIED_VARIABLES: return getQuantifiedVariables(); case SmtLanguagePackage.SMT_QUANTIFIED_EXPRESSION__EXPRESSION: return getExpression(); case SmtLanguagePackage.SMT_QUANTIFIED_EXPRESSION__PATTERN: return getPattern(); } return super.eGet(featureID, resolve, coreType); } /** * * * @generated */ @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case SmtLanguagePackage.SMT_QUANTIFIED_EXPRESSION__QUANTIFIED_VARIABLES: getQuantifiedVariables().clear(); getQuantifiedVariables().addAll((Collection)newValue); return; case SmtLanguagePackage.SMT_QUANTIFIED_EXPRESSION__EXPRESSION: setExpression((SMTTerm)newValue); return; case SmtLanguagePackage.SMT_QUANTIFIED_EXPRESSION__PATTERN: setPattern((SMTTerm)newValue); return; } super.eSet(featureID, newValue); } /** * * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case SmtLanguagePackage.SMT_QUANTIFIED_EXPRESSION__QUANTIFIED_VARIABLES: getQuantifiedVariables().clear(); return; case SmtLanguagePackage.SMT_QUANTIFIED_EXPRESSION__EXPRESSION: setExpression((SMTTerm)null); return; case SmtLanguagePackage.SMT_QUANTIFIED_EXPRESSION__PATTERN: setPattern((SMTTerm)null); return; } super.eUnset(featureID); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case SmtLanguagePackage.SMT_QUANTIFIED_EXPRESSION__QUANTIFIED_VARIABLES: return quantifiedVariables != null && !quantifiedVariables.isEmpty(); case SmtLanguagePackage.SMT_QUANTIFIED_EXPRESSION__EXPRESSION: return expression != null; case SmtLanguagePackage.SMT_QUANTIFIED_EXPRESSION__PATTERN: return pattern != null; } return super.eIsSet(featureID); } } //SMTQuantifiedExpressionImpl