/** */ package net.certware.argument.language.l.impl; import net.certware.argument.language.l.LPackage; import net.certware.argument.language.l.SetExpression; import net.certware.argument.language.l.TypeDeclaration; import net.certware.argument.language.l.TypeId; 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; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Type Declaration</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * </p> * <ul> * <li>{@link net.certware.argument.language.l.impl.TypeDeclarationImpl#getName <em>Name</em>}</li> * <li>{@link net.certware.argument.language.l.impl.TypeDeclarationImpl#getExp <em>Exp</em>}</li> * </ul> * * @generated */ public class TypeDeclarationImpl extends StatementImpl implements TypeDeclaration { /** * The cached value of the '{@link #getName() <em>Name</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getName() * @generated * @ordered */ protected TypeId name; /** * The cached value of the '{@link #getExp() <em>Exp</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getExp() * @generated * @ordered */ protected SetExpression exp; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected TypeDeclarationImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return LPackage.Literals.TYPE_DECLARATION; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public TypeId getName() { return name; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetName(TypeId newName, NotificationChain msgs) { TypeId oldName = name; name = newName; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, LPackage.TYPE_DECLARATION__NAME, oldName, newName); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setName(TypeId newName) { if (newName != name) { NotificationChain msgs = null; if (name != null) msgs = ((InternalEObject)name).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - LPackage.TYPE_DECLARATION__NAME, null, msgs); if (newName != null) msgs = ((InternalEObject)newName).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - LPackage.TYPE_DECLARATION__NAME, null, msgs); msgs = basicSetName(newName, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, LPackage.TYPE_DECLARATION__NAME, newName, newName)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public SetExpression getExp() { return exp; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetExp(SetExpression newExp, NotificationChain msgs) { SetExpression oldExp = exp; exp = newExp; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, LPackage.TYPE_DECLARATION__EXP, oldExp, newExp); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setExp(SetExpression newExp) { if (newExp != exp) { NotificationChain msgs = null; if (exp != null) msgs = ((InternalEObject)exp).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - LPackage.TYPE_DECLARATION__EXP, null, msgs); if (newExp != null) msgs = ((InternalEObject)newExp).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - LPackage.TYPE_DECLARATION__EXP, null, msgs); msgs = basicSetExp(newExp, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, LPackage.TYPE_DECLARATION__EXP, newExp, newExp)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case LPackage.TYPE_DECLARATION__NAME: return basicSetName(null, msgs); case LPackage.TYPE_DECLARATION__EXP: return basicSetExp(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.TYPE_DECLARATION__NAME: return getName(); case LPackage.TYPE_DECLARATION__EXP: return getExp(); } 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.TYPE_DECLARATION__NAME: setName((TypeId)newValue); return; case LPackage.TYPE_DECLARATION__EXP: setExp((SetExpression)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case LPackage.TYPE_DECLARATION__NAME: setName((TypeId)null); return; case LPackage.TYPE_DECLARATION__EXP: setExp((SetExpression)null); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case LPackage.TYPE_DECLARATION__NAME: return name != null; case LPackage.TYPE_DECLARATION__EXP: return exp != null; } return super.eIsSet(featureID); } } //TypeDeclarationImpl