/** * <copyright> * Copyright (c) 2009-2012, IETR/INSA of Rennes * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * Neither the name of the IETR/INSA of Rennes nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * </copyright> */ package net.sf.orcc.backends.llvm.tta.architecture.impl; import net.sf.orcc.backends.llvm.tta.architecture.ArchitecturePackage; import net.sf.orcc.backends.llvm.tta.architecture.Link; import net.sf.orcc.backends.llvm.tta.architecture.Port; import net.sf.orcc.graph.impl.EdgeImpl; 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; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Link</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link net.sf.orcc.backends.llvm.tta.architecture.impl.LinkImpl#getSourcePort <em>Source Port</em>}</li> * <li>{@link net.sf.orcc.backends.llvm.tta.architecture.impl.LinkImpl#getTargetPort <em>Target Port</em>}</li> * </ul> * </p> * * @generated */ public abstract class LinkImpl extends EdgeImpl implements Link { /** * The cached value of the '{@link #getSourcePort() <em>Source Port</em>}' reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getSourcePort() * @generated * @ordered */ protected Port sourcePort; /** * The cached value of the '{@link #getTargetPort() <em>Target Port</em>}' reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getTargetPort() * @generated * @ordered */ protected Port targetPort; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected LinkImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return ArchitecturePackage.Literals.LINK; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Port getSourcePort() { if (sourcePort != null && sourcePort.eIsProxy()) { InternalEObject oldSourcePort = (InternalEObject) sourcePort; sourcePort = (Port) eResolveProxy(oldSourcePort); if (sourcePort != oldSourcePort) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, ArchitecturePackage.LINK__SOURCE_PORT, oldSourcePort, sourcePort)); } } return sourcePort; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Port basicGetSourcePort() { return sourcePort; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setSourcePort(Port newSourcePort) { Port oldSourcePort = sourcePort; sourcePort = newSourcePort; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, ArchitecturePackage.LINK__SOURCE_PORT, oldSourcePort, sourcePort)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Port getTargetPort() { if (targetPort != null && targetPort.eIsProxy()) { InternalEObject oldTargetPort = (InternalEObject) targetPort; targetPort = (Port) eResolveProxy(oldTargetPort); if (targetPort != oldTargetPort) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, ArchitecturePackage.LINK__TARGET_PORT, oldTargetPort, targetPort)); } } return targetPort; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Port basicGetTargetPort() { return targetPort; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setTargetPort(Port newTargetPort) { Port oldTargetPort = targetPort; targetPort = newTargetPort; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, ArchitecturePackage.LINK__TARGET_PORT, oldTargetPort, targetPort)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case ArchitecturePackage.LINK__SOURCE_PORT: if (resolve) return getSourcePort(); return basicGetSourcePort(); case ArchitecturePackage.LINK__TARGET_PORT: if (resolve) return getTargetPort(); return basicGetTargetPort(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case ArchitecturePackage.LINK__SOURCE_PORT: setSourcePort((Port) newValue); return; case ArchitecturePackage.LINK__TARGET_PORT: setTargetPort((Port) newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case ArchitecturePackage.LINK__SOURCE_PORT: setSourcePort((Port) null); return; case ArchitecturePackage.LINK__TARGET_PORT: setTargetPort((Port) null); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case ArchitecturePackage.LINK__SOURCE_PORT: return sourcePort != null; case ArchitecturePackage.LINK__TARGET_PORT: return targetPort != null; } return super.eIsSet(featureID); } @Override public boolean isFifo() { return false; } @Override public boolean isSignal() { return false; } } //LinkImpl