/** * Copyright (c) 2007, 2009 Borland Software Corporation and others. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Borland Software Corporation - initial API and implementation * * $Id: EMappingContextImpl.java,v 1.3 2009/05/15 12:07:10 radvorak Exp $ */ package org.eclipse.m2m.internal.qvt.oml.trace.impl; 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; import org.eclipse.m2m.internal.qvt.oml.trace.EMappingContext; import org.eclipse.m2m.internal.qvt.oml.trace.TracePackage; import org.eclipse.m2m.internal.qvt.oml.trace.VarParameterValue; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>EMapping Context</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * </p> * <ul> * <li>{@link org.eclipse.m2m.internal.qvt.oml.trace.impl.EMappingContextImpl#getContext <em>Context</em>}</li> * </ul> * * @generated */ public class EMappingContextImpl extends EObjectImpl implements EMappingContext { /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public static final String copyright = "Copyright (c) 2007 Borland Software Corporation\r\n\r\nAll rights reserved. This program and the accompanying materials\r\nare made available under the terms of the Eclipse Public License v1.0\r\nwhich accompanies this distribution, and is available at\r\nhttp://www.eclipse.org/legal/epl-v10.html\r\n \r\nContributors:\r\n Borland Software Corporation - initial API and implementation"; //$NON-NLS-1$ /** * The cached value of the '{@link #getContext() <em>Context</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getContext() * @generated * @ordered */ protected VarParameterValue context; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected EMappingContextImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return TracePackage.Literals.EMAPPING_CONTEXT; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public VarParameterValue getContext() { return context; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetContext(VarParameterValue newContext, NotificationChain msgs) { VarParameterValue oldContext = context; context = newContext; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, TracePackage.EMAPPING_CONTEXT__CONTEXT, oldContext, newContext); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setContext(VarParameterValue newContext) { if (newContext != context) { NotificationChain msgs = null; if (context != null) msgs = ((InternalEObject)context).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - TracePackage.EMAPPING_CONTEXT__CONTEXT, null, msgs); if (newContext != null) msgs = ((InternalEObject)newContext).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - TracePackage.EMAPPING_CONTEXT__CONTEXT, null, msgs); msgs = basicSetContext(newContext, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, TracePackage.EMAPPING_CONTEXT__CONTEXT, newContext, newContext)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case TracePackage.EMAPPING_CONTEXT__CONTEXT: return basicSetContext(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 TracePackage.EMAPPING_CONTEXT__CONTEXT: return getContext(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case TracePackage.EMAPPING_CONTEXT__CONTEXT: setContext((VarParameterValue)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case TracePackage.EMAPPING_CONTEXT__CONTEXT: setContext((VarParameterValue)null); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case TracePackage.EMAPPING_CONTEXT__CONTEXT: return context != null; } return super.eIsSet(featureID); } } //EMappingContextImpl