/** * <copyright> * Copyright (c) 2010-2014 Henshin developers. 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 * </copyright> */ package org.eclipse.emf.henshin.model.impl; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.henshin.model.HenshinPackage; import org.eclipse.emf.henshin.model.Parameter; import org.eclipse.emf.henshin.model.ParameterMapping; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Parameter Mapping</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link org.eclipse.emf.henshin.model.impl.ParameterMappingImpl#getSource <em>Source</em>}</li> * <li>{@link org.eclipse.emf.henshin.model.impl.ParameterMappingImpl#getTarget <em>Target</em>}</li> * </ul> * </p> * * @generated */ public class ParameterMappingImpl extends ModelElementImpl implements ParameterMapping { /** * The cached value of the '{@link #getSource() <em>Source</em>}' reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getSource() * @generated * @ordered */ protected Parameter source; /** * The cached value of the '{@link #getTarget() <em>Target</em>}' reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getTarget() * @generated * @ordered */ protected Parameter target; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public ParameterMappingImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return HenshinPackage.Literals.PARAMETER_MAPPING; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Parameter getSource() { if (source != null && source.eIsProxy()) { InternalEObject oldSource = (InternalEObject)source; source = (Parameter)eResolveProxy(oldSource); if (source != oldSource) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, HenshinPackage.PARAMETER_MAPPING__SOURCE, oldSource, source)); } } return source; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Parameter basicGetSource() { return source; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setSource(Parameter newSource) { Parameter oldSource = source; source = newSource; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, HenshinPackage.PARAMETER_MAPPING__SOURCE, oldSource, source)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Parameter getTarget() { if (target != null && target.eIsProxy()) { InternalEObject oldTarget = (InternalEObject)target; target = (Parameter)eResolveProxy(oldTarget); if (target != oldTarget) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, HenshinPackage.PARAMETER_MAPPING__TARGET, oldTarget, target)); } } return target; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Parameter basicGetTarget() { return target; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setTarget(Parameter newTarget) { Parameter oldTarget = target; target = newTarget; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, HenshinPackage.PARAMETER_MAPPING__TARGET, oldTarget, target)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case HenshinPackage.PARAMETER_MAPPING__SOURCE: if (resolve) return getSource(); return basicGetSource(); case HenshinPackage.PARAMETER_MAPPING__TARGET: if (resolve) return getTarget(); return basicGetTarget(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case HenshinPackage.PARAMETER_MAPPING__SOURCE: setSource((Parameter)newValue); return; case HenshinPackage.PARAMETER_MAPPING__TARGET: setTarget((Parameter)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case HenshinPackage.PARAMETER_MAPPING__SOURCE: setSource((Parameter)null); return; case HenshinPackage.PARAMETER_MAPPING__TARGET: setTarget((Parameter)null); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case HenshinPackage.PARAMETER_MAPPING__SOURCE: return source != null; case HenshinPackage.PARAMETER_MAPPING__TARGET: return target != null; } return super.eIsSet(featureID); } /** * @generated NOT */ @Override public String toString() { return source + " -> " + target; } } //ParameterMappingImpl