/** | |
* 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.expression.impl; | |
import org.eclipse.efm.ecore.formalml.expression.Expression; | |
import org.eclipse.efm.ecore.formalml.expression.ExpressionAsChannel; | |
import org.eclipse.efm.ecore.formalml.expression.ExpressionPackage; | |
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>As Channel</b></em>'. | |
* <!-- end-user-doc --> | |
* <p> | |
* The following features are implemented: | |
* </p> | |
* <ul> | |
* <li>{@link org.eclipse.efm.ecore.formalml.expression.impl.ExpressionAsChannelImpl#getChannel <em>Channel</em>}</li> | |
* </ul> | |
* | |
* @generated | |
*/ | |
public class ExpressionAsChannelImpl extends ExpressionImpl implements ExpressionAsChannel { | |
/** | |
* The cached value of the '{@link #getChannel() <em>Channel</em>}' containment reference. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getChannel() | |
* @generated | |
* @ordered | |
*/ | |
protected Expression channel; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
protected ExpressionAsChannelImpl() { | |
super(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
protected EClass eStaticClass() { | |
return ExpressionPackage.Literals.EXPRESSION_AS_CHANNEL; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public Expression getChannel() { | |
return channel; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public NotificationChain basicSetChannel(Expression newChannel, NotificationChain msgs) { | |
Expression oldChannel = channel; | |
channel = newChannel; | |
if (eNotificationRequired()) { | |
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ExpressionPackage.EXPRESSION_AS_CHANNEL__CHANNEL, oldChannel, newChannel); | |
if (msgs == null) msgs = notification; else msgs.add(notification); | |
} | |
return msgs; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void setChannel(Expression newChannel) { | |
if (newChannel != channel) { | |
NotificationChain msgs = null; | |
if (channel != null) | |
msgs = ((InternalEObject)channel).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ExpressionPackage.EXPRESSION_AS_CHANNEL__CHANNEL, null, msgs); | |
if (newChannel != null) | |
msgs = ((InternalEObject)newChannel).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ExpressionPackage.EXPRESSION_AS_CHANNEL__CHANNEL, null, msgs); | |
msgs = basicSetChannel(newChannel, msgs); | |
if (msgs != null) msgs.dispatch(); | |
} | |
else if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, ExpressionPackage.EXPRESSION_AS_CHANNEL__CHANNEL, newChannel, newChannel)); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | |
switch (featureID) { | |
case ExpressionPackage.EXPRESSION_AS_CHANNEL__CHANNEL: | |
return basicSetChannel(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 ExpressionPackage.EXPRESSION_AS_CHANNEL__CHANNEL: | |
return getChannel(); | |
} | |
return super.eGet(featureID, resolve, coreType); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void eSet(int featureID, Object newValue) { | |
switch (featureID) { | |
case ExpressionPackage.EXPRESSION_AS_CHANNEL__CHANNEL: | |
setChannel((Expression)newValue); | |
return; | |
} | |
super.eSet(featureID, newValue); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void eUnset(int featureID) { | |
switch (featureID) { | |
case ExpressionPackage.EXPRESSION_AS_CHANNEL__CHANNEL: | |
setChannel((Expression)null); | |
return; | |
} | |
super.eUnset(featureID); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public boolean eIsSet(int featureID) { | |
switch (featureID) { | |
case ExpressionPackage.EXPRESSION_AS_CHANNEL__CHANNEL: | |
return channel != null; | |
} | |
return super.eIsSet(featureID); | |
} | |
} //ExpressionAsChannelImpl |