/** */ package hu.bme.mit.inf.dslreasoner.smtLanguage.impl; import hu.bme.mit.inf.dslreasoner.smtLanguage.SMTAtomicTerm; import hu.bme.mit.inf.dslreasoner.smtLanguage.SMTOption; import hu.bme.mit.inf.dslreasoner.smtLanguage.SmtLanguagePackage; 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; /** * * An implementation of the model object 'SMT Option'. * *

* The following features are implemented: *

*

* * @generated */ public class SMTOptionImpl extends MinimalEObjectImpl.Container implements SMTOption { /** * The default value of the '{@link #getName() Name}' attribute. * * * @see #getName() * @generated * @ordered */ protected static final String NAME_EDEFAULT = null; /** * The cached value of the '{@link #getName() Name}' attribute. * * * @see #getName() * @generated * @ordered */ protected String name = NAME_EDEFAULT; /** * The cached value of the '{@link #getValue() Value}' containment reference. * * * @see #getValue() * @generated * @ordered */ protected SMTAtomicTerm value; /** * * * @generated */ protected SMTOptionImpl() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return SmtLanguagePackage.Literals.SMT_OPTION; } /** * * * @generated */ public String getName() { return name; } /** * * * @generated */ public void setName(String newName) { String oldName = name; name = newName; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, SmtLanguagePackage.SMT_OPTION__NAME, oldName, name)); } /** * * * @generated */ public SMTAtomicTerm getValue() { return value; } /** * * * @generated */ public NotificationChain basicSetValue(SMTAtomicTerm newValue, NotificationChain msgs) { SMTAtomicTerm oldValue = value; value = newValue; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SmtLanguagePackage.SMT_OPTION__VALUE, oldValue, newValue); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * * * @generated */ public void setValue(SMTAtomicTerm newValue) { if (newValue != value) { NotificationChain msgs = null; if (value != null) msgs = ((InternalEObject)value).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - SmtLanguagePackage.SMT_OPTION__VALUE, null, msgs); if (newValue != null) msgs = ((InternalEObject)newValue).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - SmtLanguagePackage.SMT_OPTION__VALUE, null, msgs); msgs = basicSetValue(newValue, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, SmtLanguagePackage.SMT_OPTION__VALUE, newValue, newValue)); } /** * * * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case SmtLanguagePackage.SMT_OPTION__VALUE: return basicSetValue(null, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case SmtLanguagePackage.SMT_OPTION__NAME: return getName(); case SmtLanguagePackage.SMT_OPTION__VALUE: return getValue(); } return super.eGet(featureID, resolve, coreType); } /** * * * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case SmtLanguagePackage.SMT_OPTION__NAME: setName((String)newValue); return; case SmtLanguagePackage.SMT_OPTION__VALUE: setValue((SMTAtomicTerm)newValue); return; } super.eSet(featureID, newValue); } /** * * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case SmtLanguagePackage.SMT_OPTION__NAME: setName(NAME_EDEFAULT); return; case SmtLanguagePackage.SMT_OPTION__VALUE: setValue((SMTAtomicTerm)null); return; } super.eUnset(featureID); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case SmtLanguagePackage.SMT_OPTION__NAME: return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); case SmtLanguagePackage.SMT_OPTION__VALUE: return value != null; } return super.eIsSet(featureID); } /** * * * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuffer result = new StringBuffer(super.toString()); result.append(" (name: "); result.append(name); result.append(')'); return result.toString(); } } //SMTOptionImpl