/** * generated by Xtext 2.14.0 */ package ca.mcgill.ecse.dslreasoner.vampireLanguage.impl; import ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnnotation; import ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSTffFormula; import ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSTffTerm; import ca.mcgill.ecse.dslreasoner.vampireLanguage.VampireLanguagePackage; 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 'VLS Tff Formula'. * *

* The following features are implemented: *

* * * @generated */ public class VLSTffFormulaImpl extends MinimalEObjectImpl.Container implements VLSTffFormula { /** * 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 default value of the '{@link #getTffRole() Tff Role}' attribute. * * * @see #getTffRole() * @generated * @ordered */ protected static final String TFF_ROLE_EDEFAULT = null; /** * The cached value of the '{@link #getTffRole() Tff Role}' attribute. * * * @see #getTffRole() * @generated * @ordered */ protected String tffRole = TFF_ROLE_EDEFAULT; /** * The cached value of the '{@link #getFofFormula() Fof Formula}' containment reference. * * * @see #getFofFormula() * @generated * @ordered */ protected VLSTffTerm fofFormula; /** * The cached value of the '{@link #getAnnotations() Annotations}' containment reference. * * * @see #getAnnotations() * @generated * @ordered */ protected VLSAnnotation annotations; /** * * * @generated */ protected VLSTffFormulaImpl() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return VampireLanguagePackage.Literals.VLS_TFF_FORMULA; } /** * * * @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, VampireLanguagePackage.VLS_TFF_FORMULA__NAME, oldName, name)); } /** * * * @generated */ public String getTffRole() { return tffRole; } /** * * * @generated */ public void setTffRole(String newTffRole) { String oldTffRole = tffRole; tffRole = newTffRole; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, VampireLanguagePackage.VLS_TFF_FORMULA__TFF_ROLE, oldTffRole, tffRole)); } /** * * * @generated */ public VLSTffTerm getFofFormula() { return fofFormula; } /** * * * @generated */ public NotificationChain basicSetFofFormula(VLSTffTerm newFofFormula, NotificationChain msgs) { VLSTffTerm oldFofFormula = fofFormula; fofFormula = newFofFormula; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, VampireLanguagePackage.VLS_TFF_FORMULA__FOF_FORMULA, oldFofFormula, newFofFormula); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * * * @generated */ public void setFofFormula(VLSTffTerm newFofFormula) { if (newFofFormula != fofFormula) { NotificationChain msgs = null; if (fofFormula != null) msgs = ((InternalEObject)fofFormula).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - VampireLanguagePackage.VLS_TFF_FORMULA__FOF_FORMULA, null, msgs); if (newFofFormula != null) msgs = ((InternalEObject)newFofFormula).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - VampireLanguagePackage.VLS_TFF_FORMULA__FOF_FORMULA, null, msgs); msgs = basicSetFofFormula(newFofFormula, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, VampireLanguagePackage.VLS_TFF_FORMULA__FOF_FORMULA, newFofFormula, newFofFormula)); } /** * * * @generated */ public VLSAnnotation getAnnotations() { return annotations; } /** * * * @generated */ public NotificationChain basicSetAnnotations(VLSAnnotation newAnnotations, NotificationChain msgs) { VLSAnnotation oldAnnotations = annotations; annotations = newAnnotations; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, VampireLanguagePackage.VLS_TFF_FORMULA__ANNOTATIONS, oldAnnotations, newAnnotations); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * * * @generated */ public void setAnnotations(VLSAnnotation newAnnotations) { if (newAnnotations != annotations) { NotificationChain msgs = null; if (annotations != null) msgs = ((InternalEObject)annotations).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - VampireLanguagePackage.VLS_TFF_FORMULA__ANNOTATIONS, null, msgs); if (newAnnotations != null) msgs = ((InternalEObject)newAnnotations).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - VampireLanguagePackage.VLS_TFF_FORMULA__ANNOTATIONS, null, msgs); msgs = basicSetAnnotations(newAnnotations, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, VampireLanguagePackage.VLS_TFF_FORMULA__ANNOTATIONS, newAnnotations, newAnnotations)); } /** * * * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case VampireLanguagePackage.VLS_TFF_FORMULA__FOF_FORMULA: return basicSetFofFormula(null, msgs); case VampireLanguagePackage.VLS_TFF_FORMULA__ANNOTATIONS: return basicSetAnnotations(null, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case VampireLanguagePackage.VLS_TFF_FORMULA__NAME: return getName(); case VampireLanguagePackage.VLS_TFF_FORMULA__TFF_ROLE: return getTffRole(); case VampireLanguagePackage.VLS_TFF_FORMULA__FOF_FORMULA: return getFofFormula(); case VampireLanguagePackage.VLS_TFF_FORMULA__ANNOTATIONS: return getAnnotations(); } return super.eGet(featureID, resolve, coreType); } /** * * * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case VampireLanguagePackage.VLS_TFF_FORMULA__NAME: setName((String)newValue); return; case VampireLanguagePackage.VLS_TFF_FORMULA__TFF_ROLE: setTffRole((String)newValue); return; case VampireLanguagePackage.VLS_TFF_FORMULA__FOF_FORMULA: setFofFormula((VLSTffTerm)newValue); return; case VampireLanguagePackage.VLS_TFF_FORMULA__ANNOTATIONS: setAnnotations((VLSAnnotation)newValue); return; } super.eSet(featureID, newValue); } /** * * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case VampireLanguagePackage.VLS_TFF_FORMULA__NAME: setName(NAME_EDEFAULT); return; case VampireLanguagePackage.VLS_TFF_FORMULA__TFF_ROLE: setTffRole(TFF_ROLE_EDEFAULT); return; case VampireLanguagePackage.VLS_TFF_FORMULA__FOF_FORMULA: setFofFormula((VLSTffTerm)null); return; case VampireLanguagePackage.VLS_TFF_FORMULA__ANNOTATIONS: setAnnotations((VLSAnnotation)null); return; } super.eUnset(featureID); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case VampireLanguagePackage.VLS_TFF_FORMULA__NAME: return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); case VampireLanguagePackage.VLS_TFF_FORMULA__TFF_ROLE: return TFF_ROLE_EDEFAULT == null ? tffRole != null : !TFF_ROLE_EDEFAULT.equals(tffRole); case VampireLanguagePackage.VLS_TFF_FORMULA__FOF_FORMULA: return fofFormula != null; case VampireLanguagePackage.VLS_TFF_FORMULA__ANNOTATIONS: return annotations != null; } return super.eIsSet(featureID); } /** * * * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuilder result = new StringBuilder(super.toString()); result.append(" (name: "); result.append(name); result.append(", tffRole: "); result.append(tffRole); result.append(')'); return result.toString(); } } //VLSTffFormulaImpl