/** * <copyright> * </copyright> * * $Id$ */ package org.eclipse.amalgam.tutorials.emf.droid.impl; import org.eclipse.amalgam.tutorials.emf.droid.DroidPackage; import org.eclipse.amalgam.tutorials.emf.droid.IntegerRA; import org.eclipse.amalgam.tutorials.emf.droid.IntegerVA; import org.eclipse.amalgam.tutorials.emf.droid.IntegerVD; 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>Integer VA</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link org.eclipse.amalgam.tutorials.emf.droid.impl.IntegerVAImpl#getAccess <em>Access</em>}</li> * <li>{@link org.eclipse.amalgam.tutorials.emf.droid.impl.IntegerVAImpl#getValue <em>Value</em>}</li> * </ul> * </p> * * @generated */ public class IntegerVAImpl extends ValueAccessImpl implements IntegerVA { /** * The cached value of the '{@link #getAccess() <em>Access</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getAccess() * @generated * @ordered */ protected IntegerRA access; /** * The cached value of the '{@link #getValue() <em>Value</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getValue() * @generated * @ordered */ protected IntegerVD value; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected IntegerVAImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return DroidPackage.eINSTANCE.getIntegerVA(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public IntegerRA getAccess() { return access; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetAccess(IntegerRA newAccess, NotificationChain msgs) { IntegerRA oldAccess = access; access = newAccess; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DroidPackage.INTEGER_VA__ACCESS, oldAccess, newAccess); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setAccess(IntegerRA newAccess) { if (newAccess != access) { NotificationChain msgs = null; if (access != null) msgs = ((InternalEObject)access).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DroidPackage.INTEGER_VA__ACCESS, null, msgs); if (newAccess != null) msgs = ((InternalEObject)newAccess).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DroidPackage.INTEGER_VA__ACCESS, null, msgs); msgs = basicSetAccess(newAccess, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, DroidPackage.INTEGER_VA__ACCESS, newAccess, newAccess)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public IntegerVD getValue() { return value; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetValue(IntegerVD newValue, NotificationChain msgs) { IntegerVD oldValue = value; value = newValue; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DroidPackage.INTEGER_VA__VALUE, oldValue, newValue); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setValue(IntegerVD newValue) { if (newValue != value) { NotificationChain msgs = null; if (value != null) msgs = ((InternalEObject)value).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DroidPackage.INTEGER_VA__VALUE, null, msgs); if (newValue != null) msgs = ((InternalEObject)newValue).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DroidPackage.INTEGER_VA__VALUE, null, msgs); msgs = basicSetValue(newValue, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, DroidPackage.INTEGER_VA__VALUE, newValue, newValue)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case DroidPackage.INTEGER_VA__ACCESS: return basicSetAccess(null, msgs); case DroidPackage.INTEGER_VA__VALUE: return basicSetValue(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 DroidPackage.INTEGER_VA__ACCESS: return getAccess(); case DroidPackage.INTEGER_VA__VALUE: return getValue(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case DroidPackage.INTEGER_VA__ACCESS: setAccess((IntegerRA)newValue); return; case DroidPackage.INTEGER_VA__VALUE: setValue((IntegerVD)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case DroidPackage.INTEGER_VA__ACCESS: setAccess((IntegerRA)null); return; case DroidPackage.INTEGER_VA__VALUE: setValue((IntegerVD)null); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case DroidPackage.INTEGER_VA__ACCESS: return access != null; case DroidPackage.INTEGER_VA__VALUE: return value != null; } return super.eIsSet(featureID); } } //IntegerVAImpl