blob: ce18dc891c2668ae2b5cfb0b4d1e3208989acffd [file] [log] [blame]
/**
* Copyright (c) 2020 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\n\nContributors:
* Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
* - Initial API and Implementation
*/
package org.eclipse.efm.ecore.formalml.statement.impl;
import org.eclipse.efm.ecore.formalml.expression.Expression;
import org.eclipse.efm.ecore.formalml.infrastructure.Channel;
import org.eclipse.efm.ecore.formalml.statement.AbstractComStatement;
import org.eclipse.efm.ecore.formalml.statement.StatementPackage;
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;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Abstract Com Statement</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.efm.ecore.formalml.statement.impl.AbstractComStatementImpl#getPort <em>Port</em>}</li>
* <li>{@link org.eclipse.efm.ecore.formalml.statement.impl.AbstractComStatementImpl#getRoute <em>Route</em>}</li>
* <li>{@link org.eclipse.efm.ecore.formalml.statement.impl.AbstractComStatementImpl#getTarget <em>Target</em>}</li>
* </ul>
*
* @generated
*/
public abstract class AbstractComStatementImpl extends StatementImpl implements AbstractComStatement {
/**
* The cached value of the '{@link #getPort() <em>Port</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getPort()
* @generated
* @ordered
*/
protected Expression port;
/**
* The cached value of the '{@link #getRoute() <em>Route</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getRoute()
* @generated
* @ordered
*/
protected Channel route;
/**
* The cached value of the '{@link #getTarget() <em>Target</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getTarget()
* @generated
* @ordered
*/
protected Expression target;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected AbstractComStatementImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return StatementPackage.Literals.ABSTRACT_COM_STATEMENT;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Expression getPort() {
return port;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetPort(Expression newPort, NotificationChain msgs) {
Expression oldPort = port;
port = newPort;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, StatementPackage.ABSTRACT_COM_STATEMENT__PORT, oldPort, newPort);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setPort(Expression newPort) {
if (newPort != port) {
NotificationChain msgs = null;
if (port != null)
msgs = ((InternalEObject)port).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - StatementPackage.ABSTRACT_COM_STATEMENT__PORT, null, msgs);
if (newPort != null)
msgs = ((InternalEObject)newPort).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - StatementPackage.ABSTRACT_COM_STATEMENT__PORT, null, msgs);
msgs = basicSetPort(newPort, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, StatementPackage.ABSTRACT_COM_STATEMENT__PORT, newPort, newPort));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Channel getRoute() {
return route;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setRoute(Channel newRoute) {
Channel oldRoute = route;
route = newRoute;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, StatementPackage.ABSTRACT_COM_STATEMENT__ROUTE, oldRoute, route));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Expression getTarget() {
return target;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetTarget(Expression newTarget, NotificationChain msgs) {
Expression oldTarget = target;
target = newTarget;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, StatementPackage.ABSTRACT_COM_STATEMENT__TARGET, oldTarget, newTarget);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setTarget(Expression newTarget) {
if (newTarget != target) {
NotificationChain msgs = null;
if (target != null)
msgs = ((InternalEObject)target).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - StatementPackage.ABSTRACT_COM_STATEMENT__TARGET, null, msgs);
if (newTarget != null)
msgs = ((InternalEObject)newTarget).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - StatementPackage.ABSTRACT_COM_STATEMENT__TARGET, null, msgs);
msgs = basicSetTarget(newTarget, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, StatementPackage.ABSTRACT_COM_STATEMENT__TARGET, newTarget, newTarget));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case StatementPackage.ABSTRACT_COM_STATEMENT__PORT:
return basicSetPort(null, msgs);
case StatementPackage.ABSTRACT_COM_STATEMENT__TARGET:
return basicSetTarget(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 StatementPackage.ABSTRACT_COM_STATEMENT__PORT:
return getPort();
case StatementPackage.ABSTRACT_COM_STATEMENT__ROUTE:
return getRoute();
case StatementPackage.ABSTRACT_COM_STATEMENT__TARGET:
return getTarget();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case StatementPackage.ABSTRACT_COM_STATEMENT__PORT:
setPort((Expression)newValue);
return;
case StatementPackage.ABSTRACT_COM_STATEMENT__ROUTE:
setRoute((Channel)newValue);
return;
case StatementPackage.ABSTRACT_COM_STATEMENT__TARGET:
setTarget((Expression)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case StatementPackage.ABSTRACT_COM_STATEMENT__PORT:
setPort((Expression)null);
return;
case StatementPackage.ABSTRACT_COM_STATEMENT__ROUTE:
setRoute((Channel)null);
return;
case StatementPackage.ABSTRACT_COM_STATEMENT__TARGET:
setTarget((Expression)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case StatementPackage.ABSTRACT_COM_STATEMENT__PORT:
return port != null;
case StatementPackage.ABSTRACT_COM_STATEMENT__ROUTE:
return route != null;
case StatementPackage.ABSTRACT_COM_STATEMENT__TARGET:
return target != null;
}
return super.eIsSet(featureID);
}
} //AbstractComStatementImpl