blob: bf93bcc5e5d246d8c9b09ed9716d619412020798 [file] [log] [blame]
/**
* Copyright (c) 2018 CEA LIST.
*
* 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:
* Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
* - Initial API and Implementation
*/
package org.eclipse.efm.ecore.formalml.infrastructure.impl;
import org.eclipse.efm.ecore.formalml.common.NamedElement;
import org.eclipse.efm.ecore.formalml.common.impl.AbstractElementImpl;
import org.eclipse.efm.ecore.formalml.infrastructure.ComPoint;
import org.eclipse.efm.ecore.formalml.infrastructure.InfrastructurePackage;
import org.eclipse.efm.ecore.formalml.infrastructure.Port;
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>Com Point</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.efm.ecore.formalml.infrastructure.impl.ComPointImpl#getMachine <em>Machine</em>}</li>
* <li>{@link org.eclipse.efm.ecore.formalml.infrastructure.impl.ComPointImpl#getPort <em>Port</em>}</li>
* </ul>
*
* @generated
*/
public class ComPointImpl extends AbstractElementImpl implements ComPoint {
/**
* The cached value of the '{@link #getMachine() <em>Machine</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getMachine()
* @generated
* @ordered
*/
protected NamedElement machine;
/**
* The cached value of the '{@link #getPort() <em>Port</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getPort()
* @generated
* @ordered
*/
protected Port port;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ComPointImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return InfrastructurePackage.Literals.COM_POINT;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NamedElement getMachine() {
if (machine != null && machine.eIsProxy()) {
InternalEObject oldMachine = (InternalEObject)machine;
machine = (NamedElement)eResolveProxy(oldMachine);
if (machine != oldMachine) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, InfrastructurePackage.COM_POINT__MACHINE, oldMachine, machine));
}
}
return machine;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NamedElement basicGetMachine() {
return machine;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setMachine(NamedElement newMachine) {
NamedElement oldMachine = machine;
machine = newMachine;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, InfrastructurePackage.COM_POINT__MACHINE, oldMachine, machine));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Port getPort() {
if (port != null && port.eIsProxy()) {
InternalEObject oldPort = (InternalEObject)port;
port = (Port)eResolveProxy(oldPort);
if (port != oldPort) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, InfrastructurePackage.COM_POINT__PORT, oldPort, port));
}
}
return port;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Port basicGetPort() {
return port;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setPort(Port newPort) {
Port oldPort = port;
port = newPort;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, InfrastructurePackage.COM_POINT__PORT, oldPort, port));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case InfrastructurePackage.COM_POINT__MACHINE:
if (resolve) return getMachine();
return basicGetMachine();
case InfrastructurePackage.COM_POINT__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 InfrastructurePackage.COM_POINT__MACHINE:
setMachine((NamedElement)newValue);
return;
case InfrastructurePackage.COM_POINT__PORT:
setPort((Port)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case InfrastructurePackage.COM_POINT__MACHINE:
setMachine((NamedElement)null);
return;
case InfrastructurePackage.COM_POINT__PORT:
setPort((Port)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case InfrastructurePackage.COM_POINT__MACHINE:
return machine != null;
case InfrastructurePackage.COM_POINT__PORT:
return port != null;
}
return super.eIsSet(featureID);
}
} //ComPointImpl