blob: 71daf7c491311ebe7dfce6d253077db1b403efd2 [file] [log] [blame]
/**
* <copyright>
* </copyright>
*
* $Id$
*/
package comrel.impl;
import comrel.ComrelPackage;
import comrel.MultiFeatureHelper;
import comrel.MultiOutputPort;
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>Multi Feature Helper</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link comrel.impl.MultiFeatureHelperImpl#getOutputPort <em>Output Port</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class MultiFeatureHelperImpl extends FeatureHelperImpl implements MultiFeatureHelper {
/**
* The cached value of the '{@link #getOutputPort() <em>Output Port</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getOutputPort()
* @generated
* @ordered
*/
protected MultiOutputPort outputPort;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected MultiFeatureHelperImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return ComrelPackage.Literals.MULTI_FEATURE_HELPER;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public MultiOutputPort getOutputPort() {
return outputPort;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetOutputPort(MultiOutputPort newOutputPort, NotificationChain msgs) {
MultiOutputPort oldOutputPort = outputPort;
outputPort = newOutputPort;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ComrelPackage.MULTI_FEATURE_HELPER__OUTPUT_PORT, oldOutputPort, newOutputPort);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setOutputPort(MultiOutputPort newOutputPort) {
if (newOutputPort != outputPort) {
NotificationChain msgs = null;
if (outputPort != null)
msgs = ((InternalEObject)outputPort).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ComrelPackage.MULTI_FEATURE_HELPER__OUTPUT_PORT, null, msgs);
if (newOutputPort != null)
msgs = ((InternalEObject)newOutputPort).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ComrelPackage.MULTI_FEATURE_HELPER__OUTPUT_PORT, null, msgs);
msgs = basicSetOutputPort(newOutputPort, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ComrelPackage.MULTI_FEATURE_HELPER__OUTPUT_PORT, newOutputPort, newOutputPort));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case ComrelPackage.MULTI_FEATURE_HELPER__OUTPUT_PORT:
return basicSetOutputPort(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 ComrelPackage.MULTI_FEATURE_HELPER__OUTPUT_PORT:
return getOutputPort();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case ComrelPackage.MULTI_FEATURE_HELPER__OUTPUT_PORT:
setOutputPort((MultiOutputPort)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case ComrelPackage.MULTI_FEATURE_HELPER__OUTPUT_PORT:
setOutputPort((MultiOutputPort)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ComrelPackage.MULTI_FEATURE_HELPER__OUTPUT_PORT:
return outputPort != null;
}
return super.eIsSet(featureID);
}
} //MultiFeatureHelperImpl