/** * <copyright> * </copyright> * * $Id$ */ package org.dresdenocl.language.ocl.impl; import org.dresdenocl.language.ocl.OclPackage; import org.dresdenocl.language.ocl.SimpleNameCS; import org.dresdenocl.language.ocl.VariableDeclarationCS; 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.EObjectImpl; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Variable Declaration CS</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link org.dresdenocl.language.ocl.impl.VariableDeclarationCSImpl#getVariableName <em>Variable Name</em>}</li> * </ul> * </p> * * @generated */ public abstract class VariableDeclarationCSImpl extends EObjectImpl implements VariableDeclarationCS { /** * The cached value of the '{@link #getVariableName() <em>Variable Name</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getVariableName() * @generated * @ordered */ protected SimpleNameCS variableName; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected VariableDeclarationCSImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return OclPackage.Literals.VARIABLE_DECLARATION_CS; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public SimpleNameCS getVariableName() { return variableName; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetVariableName(SimpleNameCS newVariableName, NotificationChain msgs) { SimpleNameCS oldVariableName = variableName; variableName = newVariableName; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OclPackage.VARIABLE_DECLARATION_CS__VARIABLE_NAME, oldVariableName, newVariableName); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setVariableName(SimpleNameCS newVariableName) { if (newVariableName != variableName) { NotificationChain msgs = null; if (variableName != null) msgs = ((InternalEObject)variableName).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OclPackage.VARIABLE_DECLARATION_CS__VARIABLE_NAME, null, msgs); if (newVariableName != null) msgs = ((InternalEObject)newVariableName).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OclPackage.VARIABLE_DECLARATION_CS__VARIABLE_NAME, null, msgs); msgs = basicSetVariableName(newVariableName, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, OclPackage.VARIABLE_DECLARATION_CS__VARIABLE_NAME, newVariableName, newVariableName)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case OclPackage.VARIABLE_DECLARATION_CS__VARIABLE_NAME: return basicSetVariableName(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 OclPackage.VARIABLE_DECLARATION_CS__VARIABLE_NAME: return getVariableName(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case OclPackage.VARIABLE_DECLARATION_CS__VARIABLE_NAME: setVariableName((SimpleNameCS)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case OclPackage.VARIABLE_DECLARATION_CS__VARIABLE_NAME: setVariableName((SimpleNameCS)null); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case OclPackage.VARIABLE_DECLARATION_CS__VARIABLE_NAME: return variableName != null; } return super.eIsSet(featureID); } } //VariableDeclarationCSImpl