/** */ package hu.bme.mit.inf.dslreasoner.smtLanguage.impl; import hu.bme.mit.inf.dslreasoner.smtLanguage.SMTAssertion; import hu.bme.mit.inf.dslreasoner.smtLanguage.SMTFunctionDeclaration; import hu.bme.mit.inf.dslreasoner.smtLanguage.SMTFunctionDefinition; import hu.bme.mit.inf.dslreasoner.smtLanguage.SMTGetModelCommand; import hu.bme.mit.inf.dslreasoner.smtLanguage.SMTInput; import hu.bme.mit.inf.dslreasoner.smtLanguage.SMTOption; import hu.bme.mit.inf.dslreasoner.smtLanguage.SMTSatCommand; import hu.bme.mit.inf.dslreasoner.smtLanguage.SMTType; 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.impl.MinimalEObjectImpl; import org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.InternalEList; /** * * An implementation of the model object 'SMT Input'. * *

* The following features are implemented: *

*

* * @generated */ public class SMTInputImpl extends MinimalEObjectImpl.Container implements SMTInput { /** * The cached value of the '{@link #getOptions() Options}' containment reference list. * * * @see #getOptions() * @generated * @ordered */ protected EList options; /** * The cached value of the '{@link #getTypeDeclarations() Type Declarations}' containment reference list. * * * @see #getTypeDeclarations() * @generated * @ordered */ protected EList typeDeclarations; /** * The cached value of the '{@link #getFunctionDeclarations() Function Declarations}' containment reference list. * * * @see #getFunctionDeclarations() * @generated * @ordered */ protected EList functionDeclarations; /** * The cached value of the '{@link #getFunctionDefinition() Function Definition}' containment reference list. * * * @see #getFunctionDefinition() * @generated * @ordered */ protected EList functionDefinition; /** * The cached value of the '{@link #getAssertions() Assertions}' containment reference list. * * * @see #getAssertions() * @generated * @ordered */ protected EList assertions; /** * The cached value of the '{@link #getSatCommand() Sat Command}' containment reference. * * * @see #getSatCommand() * @generated * @ordered */ protected SMTSatCommand satCommand; /** * The cached value of the '{@link #getGetModelCommand() Get Model Command}' containment reference. * * * @see #getGetModelCommand() * @generated * @ordered */ protected SMTGetModelCommand getModelCommand; /** * * * @generated */ protected SMTInputImpl() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return SmtLanguagePackage.Literals.SMT_INPUT; } /** * * * @generated */ public EList getOptions() { if (options == null) { options = new EObjectContainmentEList(SMTOption.class, this, SmtLanguagePackage.SMT_INPUT__OPTIONS); } return options; } /** * * * @generated */ public EList getTypeDeclarations() { if (typeDeclarations == null) { typeDeclarations = new EObjectContainmentEList(SMTType.class, this, SmtLanguagePackage.SMT_INPUT__TYPE_DECLARATIONS); } return typeDeclarations; } /** * * * @generated */ public EList getFunctionDeclarations() { if (functionDeclarations == null) { functionDeclarations = new EObjectContainmentEList(SMTFunctionDeclaration.class, this, SmtLanguagePackage.SMT_INPUT__FUNCTION_DECLARATIONS); } return functionDeclarations; } /** * * * @generated */ public EList getFunctionDefinition() { if (functionDefinition == null) { functionDefinition = new EObjectContainmentEList(SMTFunctionDefinition.class, this, SmtLanguagePackage.SMT_INPUT__FUNCTION_DEFINITION); } return functionDefinition; } /** * * * @generated */ public EList getAssertions() { if (assertions == null) { assertions = new EObjectContainmentEList(SMTAssertion.class, this, SmtLanguagePackage.SMT_INPUT__ASSERTIONS); } return assertions; } /** * * * @generated */ public SMTSatCommand getSatCommand() { return satCommand; } /** * * * @generated */ public NotificationChain basicSetSatCommand(SMTSatCommand newSatCommand, NotificationChain msgs) { SMTSatCommand oldSatCommand = satCommand; satCommand = newSatCommand; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SmtLanguagePackage.SMT_INPUT__SAT_COMMAND, oldSatCommand, newSatCommand); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * * * @generated */ public void setSatCommand(SMTSatCommand newSatCommand) { if (newSatCommand != satCommand) { NotificationChain msgs = null; if (satCommand != null) msgs = ((InternalEObject)satCommand).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - SmtLanguagePackage.SMT_INPUT__SAT_COMMAND, null, msgs); if (newSatCommand != null) msgs = ((InternalEObject)newSatCommand).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - SmtLanguagePackage.SMT_INPUT__SAT_COMMAND, null, msgs); msgs = basicSetSatCommand(newSatCommand, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, SmtLanguagePackage.SMT_INPUT__SAT_COMMAND, newSatCommand, newSatCommand)); } /** * * * @generated */ public SMTGetModelCommand getGetModelCommand() { return getModelCommand; } /** * * * @generated */ public NotificationChain basicSetGetModelCommand(SMTGetModelCommand newGetModelCommand, NotificationChain msgs) { SMTGetModelCommand oldGetModelCommand = getModelCommand; getModelCommand = newGetModelCommand; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SmtLanguagePackage.SMT_INPUT__GET_MODEL_COMMAND, oldGetModelCommand, newGetModelCommand); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * * * @generated */ public void setGetModelCommand(SMTGetModelCommand newGetModelCommand) { if (newGetModelCommand != getModelCommand) { NotificationChain msgs = null; if (getModelCommand != null) msgs = ((InternalEObject)getModelCommand).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - SmtLanguagePackage.SMT_INPUT__GET_MODEL_COMMAND, null, msgs); if (newGetModelCommand != null) msgs = ((InternalEObject)newGetModelCommand).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - SmtLanguagePackage.SMT_INPUT__GET_MODEL_COMMAND, null, msgs); msgs = basicSetGetModelCommand(newGetModelCommand, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, SmtLanguagePackage.SMT_INPUT__GET_MODEL_COMMAND, newGetModelCommand, newGetModelCommand)); } /** * * * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case SmtLanguagePackage.SMT_INPUT__OPTIONS: return ((InternalEList)getOptions()).basicRemove(otherEnd, msgs); case SmtLanguagePackage.SMT_INPUT__TYPE_DECLARATIONS: return ((InternalEList)getTypeDeclarations()).basicRemove(otherEnd, msgs); case SmtLanguagePackage.SMT_INPUT__FUNCTION_DECLARATIONS: return ((InternalEList)getFunctionDeclarations()).basicRemove(otherEnd, msgs); case SmtLanguagePackage.SMT_INPUT__FUNCTION_DEFINITION: return ((InternalEList)getFunctionDefinition()).basicRemove(otherEnd, msgs); case SmtLanguagePackage.SMT_INPUT__ASSERTIONS: return ((InternalEList)getAssertions()).basicRemove(otherEnd, msgs); case SmtLanguagePackage.SMT_INPUT__SAT_COMMAND: return basicSetSatCommand(null, msgs); case SmtLanguagePackage.SMT_INPUT__GET_MODEL_COMMAND: return basicSetGetModelCommand(null, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case SmtLanguagePackage.SMT_INPUT__OPTIONS: return getOptions(); case SmtLanguagePackage.SMT_INPUT__TYPE_DECLARATIONS: return getTypeDeclarations(); case SmtLanguagePackage.SMT_INPUT__FUNCTION_DECLARATIONS: return getFunctionDeclarations(); case SmtLanguagePackage.SMT_INPUT__FUNCTION_DEFINITION: return getFunctionDefinition(); case SmtLanguagePackage.SMT_INPUT__ASSERTIONS: return getAssertions(); case SmtLanguagePackage.SMT_INPUT__SAT_COMMAND: return getSatCommand(); case SmtLanguagePackage.SMT_INPUT__GET_MODEL_COMMAND: return getGetModelCommand(); } return super.eGet(featureID, resolve, coreType); } /** * * * @generated */ @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case SmtLanguagePackage.SMT_INPUT__OPTIONS: getOptions().clear(); getOptions().addAll((Collection)newValue); return; case SmtLanguagePackage.SMT_INPUT__TYPE_DECLARATIONS: getTypeDeclarations().clear(); getTypeDeclarations().addAll((Collection)newValue); return; case SmtLanguagePackage.SMT_INPUT__FUNCTION_DECLARATIONS: getFunctionDeclarations().clear(); getFunctionDeclarations().addAll((Collection)newValue); return; case SmtLanguagePackage.SMT_INPUT__FUNCTION_DEFINITION: getFunctionDefinition().clear(); getFunctionDefinition().addAll((Collection)newValue); return; case SmtLanguagePackage.SMT_INPUT__ASSERTIONS: getAssertions().clear(); getAssertions().addAll((Collection)newValue); return; case SmtLanguagePackage.SMT_INPUT__SAT_COMMAND: setSatCommand((SMTSatCommand)newValue); return; case SmtLanguagePackage.SMT_INPUT__GET_MODEL_COMMAND: setGetModelCommand((SMTGetModelCommand)newValue); return; } super.eSet(featureID, newValue); } /** * * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case SmtLanguagePackage.SMT_INPUT__OPTIONS: getOptions().clear(); return; case SmtLanguagePackage.SMT_INPUT__TYPE_DECLARATIONS: getTypeDeclarations().clear(); return; case SmtLanguagePackage.SMT_INPUT__FUNCTION_DECLARATIONS: getFunctionDeclarations().clear(); return; case SmtLanguagePackage.SMT_INPUT__FUNCTION_DEFINITION: getFunctionDefinition().clear(); return; case SmtLanguagePackage.SMT_INPUT__ASSERTIONS: getAssertions().clear(); return; case SmtLanguagePackage.SMT_INPUT__SAT_COMMAND: setSatCommand((SMTSatCommand)null); return; case SmtLanguagePackage.SMT_INPUT__GET_MODEL_COMMAND: setGetModelCommand((SMTGetModelCommand)null); return; } super.eUnset(featureID); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case SmtLanguagePackage.SMT_INPUT__OPTIONS: return options != null && !options.isEmpty(); case SmtLanguagePackage.SMT_INPUT__TYPE_DECLARATIONS: return typeDeclarations != null && !typeDeclarations.isEmpty(); case SmtLanguagePackage.SMT_INPUT__FUNCTION_DECLARATIONS: return functionDeclarations != null && !functionDeclarations.isEmpty(); case SmtLanguagePackage.SMT_INPUT__FUNCTION_DEFINITION: return functionDefinition != null && !functionDefinition.isEmpty(); case SmtLanguagePackage.SMT_INPUT__ASSERTIONS: return assertions != null && !assertions.isEmpty(); case SmtLanguagePackage.SMT_INPUT__SAT_COMMAND: return satCommand != null; case SmtLanguagePackage.SMT_INPUT__GET_MODEL_COMMAND: return getModelCommand != null; } return super.eIsSet(featureID); } } //SMTInputImpl