/** */ package net.certware.argument.language.l.impl; import net.certware.argument.language.l.LPackage; import net.certware.argument.language.l.TVar; import net.certware.argument.language.l.TypeId; import net.certware.argument.language.l.Variable; 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; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>TVar</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * </p> * <ul> * <li>{@link net.certware.argument.language.l.impl.TVarImpl#getVar <em>Var</em>}</li> * <li>{@link net.certware.argument.language.l.impl.TVarImpl#getId <em>Id</em>}</li> * </ul> * * @generated */ public class TVarImpl extends MinimalEObjectImpl.Container implements TVar { /** * The cached value of the '{@link #getVar() <em>Var</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getVar() * @generated * @ordered */ protected Variable var; /** * The cached value of the '{@link #getId() <em>Id</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getId() * @generated * @ordered */ protected TypeId id; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected TVarImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return LPackage.Literals.TVAR; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Variable getVar() { return var; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetVar(Variable newVar, NotificationChain msgs) { Variable oldVar = var; var = newVar; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, LPackage.TVAR__VAR, oldVar, newVar); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setVar(Variable newVar) { if (newVar != var) { NotificationChain msgs = null; if (var != null) msgs = ((InternalEObject)var).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - LPackage.TVAR__VAR, null, msgs); if (newVar != null) msgs = ((InternalEObject)newVar).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - LPackage.TVAR__VAR, null, msgs); msgs = basicSetVar(newVar, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, LPackage.TVAR__VAR, newVar, newVar)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public TypeId getId() { return id; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetId(TypeId newId, NotificationChain msgs) { TypeId oldId = id; id = newId; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, LPackage.TVAR__ID, oldId, newId); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setId(TypeId newId) { if (newId != id) { NotificationChain msgs = null; if (id != null) msgs = ((InternalEObject)id).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - LPackage.TVAR__ID, null, msgs); if (newId != null) msgs = ((InternalEObject)newId).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - LPackage.TVAR__ID, null, msgs); msgs = basicSetId(newId, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, LPackage.TVAR__ID, newId, newId)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case LPackage.TVAR__VAR: return basicSetVar(null, msgs); case LPackage.TVAR__ID: return basicSetId(null, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case LPackage.TVAR__VAR: return getVar(); case LPackage.TVAR__ID: return getId(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case LPackage.TVAR__VAR: setVar((Variable)newValue); return; case LPackage.TVAR__ID: setId((TypeId)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case LPackage.TVAR__VAR: setVar((Variable)null); return; case LPackage.TVAR__ID: setId((TypeId)null); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case LPackage.TVAR__VAR: return var != null; case LPackage.TVAR__ID: return id != null; } return super.eIsSet(featureID); } } //TVarImpl