/** * generated by Xtext 2.23.0 */ package fr.n7.gAME.impl; import fr.n7.gAME.Condition; import fr.n7.gAME.Description; import fr.n7.gAME.GAMEPackage; 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 'Description'. * *

* The following features are implemented: *

* * * @generated */ public class DescriptionImpl extends MinimalEObjectImpl.Container implements Description { /** * The default value of the '{@link #getTexte() Texte}' attribute. * * * @see #getTexte() * @generated * @ordered */ protected static final String TEXTE_EDEFAULT = null; /** * The cached value of the '{@link #getTexte() Texte}' attribute. * * * @see #getTexte() * @generated * @ordered */ protected String texte = TEXTE_EDEFAULT; /** * The cached value of the '{@link #getCondition() Condition}' containment reference. * * * @see #getCondition() * @generated * @ordered */ protected Condition condition; /** * * * @generated */ protected DescriptionImpl() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return GAMEPackage.Literals.DESCRIPTION; } /** * * * @generated */ @Override public String getTexte() { return texte; } /** * * * @generated */ @Override public void setTexte(String newTexte) { String oldTexte = texte; texte = newTexte; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, GAMEPackage.DESCRIPTION__TEXTE, oldTexte, texte)); } /** * * * @generated */ @Override public Condition getCondition() { return condition; } /** * * * @generated */ public NotificationChain basicSetCondition(Condition newCondition, NotificationChain msgs) { Condition oldCondition = condition; condition = newCondition; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, GAMEPackage.DESCRIPTION__CONDITION, oldCondition, newCondition); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * * * @generated */ @Override public void setCondition(Condition newCondition) { if (newCondition != condition) { NotificationChain msgs = null; if (condition != null) msgs = ((InternalEObject)condition).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - GAMEPackage.DESCRIPTION__CONDITION, null, msgs); if (newCondition != null) msgs = ((InternalEObject)newCondition).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - GAMEPackage.DESCRIPTION__CONDITION, null, msgs); msgs = basicSetCondition(newCondition, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, GAMEPackage.DESCRIPTION__CONDITION, newCondition, newCondition)); } /** * * * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case GAMEPackage.DESCRIPTION__CONDITION: return basicSetCondition(null, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case GAMEPackage.DESCRIPTION__TEXTE: return getTexte(); case GAMEPackage.DESCRIPTION__CONDITION: return getCondition(); } return super.eGet(featureID, resolve, coreType); } /** * * * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case GAMEPackage.DESCRIPTION__TEXTE: setTexte((String)newValue); return; case GAMEPackage.DESCRIPTION__CONDITION: setCondition((Condition)newValue); return; } super.eSet(featureID, newValue); } /** * * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case GAMEPackage.DESCRIPTION__TEXTE: setTexte(TEXTE_EDEFAULT); return; case GAMEPackage.DESCRIPTION__CONDITION: setCondition((Condition)null); return; } super.eUnset(featureID); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case GAMEPackage.DESCRIPTION__TEXTE: return TEXTE_EDEFAULT == null ? texte != null : !TEXTE_EDEFAULT.equals(texte); case GAMEPackage.DESCRIPTION__CONDITION: return condition != null; } return super.eIsSet(featureID); } /** * * * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuilder result = new StringBuilder(super.toString()); result.append(" (texte: "); result.append(texte); result.append(')'); return result.toString(); } } //DescriptionImpl