blob: de306a5b71a52fe4764dfb512cb24506429c5105 [file] [log] [blame]
/**
* *******************************************************************************
* Copyright (c) 2015-2021 Robert Bosch GmbH and others.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Generated using Eclipse EMF
*
* *******************************************************************************
*/
package org.eclipse.app4mc.amalthea.model.impl;
import org.eclipse.app4mc.amalthea.model.AmaltheaPackage;
import org.eclipse.app4mc.amalthea.model.ComponentInstance;
import org.eclipse.app4mc.amalthea.model.ComponentPort;
import org.eclipse.app4mc.amalthea.model.QualifiedPort;
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>Qualified Port</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.app4mc.amalthea.model.impl.QualifiedPortImpl#getInstance <em>Instance</em>}</li>
* <li>{@link org.eclipse.app4mc.amalthea.model.impl.QualifiedPortImpl#getPort <em>Port</em>}</li>
* </ul>
*
* @generated
*/
public class QualifiedPortImpl extends BaseObjectImpl implements QualifiedPort {
/**
* The cached value of the '{@link #getInstance() <em>Instance</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getInstance()
* @generated
* @ordered
*/
protected ComponentInstance instance;
/**
* The cached value of the '{@link #getPort() <em>Port</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getPort()
* @generated
* @ordered
*/
protected ComponentPort port;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected QualifiedPortImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return AmaltheaPackage.eINSTANCE.getQualifiedPort();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public ComponentInstance getInstance() {
if (instance != null && instance.eIsProxy()) {
InternalEObject oldInstance = (InternalEObject)instance;
instance = (ComponentInstance)eResolveProxy(oldInstance);
if (instance != oldInstance) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, AmaltheaPackage.QUALIFIED_PORT__INSTANCE, oldInstance, instance));
}
}
return instance;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ComponentInstance basicGetInstance() {
return instance;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setInstance(ComponentInstance newInstance) {
ComponentInstance oldInstance = instance;
instance = newInstance;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AmaltheaPackage.QUALIFIED_PORT__INSTANCE, oldInstance, instance));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public ComponentPort getPort() {
if (port != null && port.eIsProxy()) {
InternalEObject oldPort = (InternalEObject)port;
port = (ComponentPort)eResolveProxy(oldPort);
if (port != oldPort) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, AmaltheaPackage.QUALIFIED_PORT__PORT, oldPort, port));
}
}
return port;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ComponentPort basicGetPort() {
return port;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setPort(ComponentPort newPort) {
ComponentPort oldPort = port;
port = newPort;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AmaltheaPackage.QUALIFIED_PORT__PORT, oldPort, port));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case AmaltheaPackage.QUALIFIED_PORT__INSTANCE:
if (resolve) return getInstance();
return basicGetInstance();
case AmaltheaPackage.QUALIFIED_PORT__PORT:
if (resolve) return getPort();
return basicGetPort();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case AmaltheaPackage.QUALIFIED_PORT__INSTANCE:
setInstance((ComponentInstance)newValue);
return;
case AmaltheaPackage.QUALIFIED_PORT__PORT:
setPort((ComponentPort)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case AmaltheaPackage.QUALIFIED_PORT__INSTANCE:
setInstance((ComponentInstance)null);
return;
case AmaltheaPackage.QUALIFIED_PORT__PORT:
setPort((ComponentPort)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case AmaltheaPackage.QUALIFIED_PORT__INSTANCE:
return instance != null;
case AmaltheaPackage.QUALIFIED_PORT__PORT:
return port != null;
}
return super.eIsSet(featureID);
}
} //QualifiedPortImpl