blob: 8aa21c9f3d192c874c9b5abf68abf68fb11177b6 [file] [log] [blame]
/**
* Copyright (c) 2011, 2018 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
* 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:
* Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation
*
* generated from SignalDSL.xcore
*
*
*/
package org.eclipse.osbp.xtext.signal.impl;
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;
import org.eclipse.osbp.xtext.signal.SignalDSLPackage;
import org.eclipse.osbp.xtext.signal.SignalDatainterchange;
import org.eclipse.osbp.xtext.signal.SingleTransfer;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Single Transfer</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.osbp.xtext.signal.impl.SingleTransferImpl#getInterchange <em>Interchange</em>}</li>
* </ul>
*
* @generated
*/
public class SingleTransferImpl extends DataTransferImpl implements SingleTransfer {
/**
* The cached value of the '{@link #getInterchange() <em>Interchange</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getInterchange()
* @generated
* @ordered
*/
protected SignalDatainterchange interchange;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected SingleTransferImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return SignalDSLPackage.Literals.SINGLE_TRANSFER;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public SignalDatainterchange getInterchange() {
return interchange;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetInterchange(SignalDatainterchange newInterchange, NotificationChain msgs) {
SignalDatainterchange oldInterchange = interchange;
interchange = newInterchange;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SignalDSLPackage.SINGLE_TRANSFER__INTERCHANGE, oldInterchange, newInterchange);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setInterchange(SignalDatainterchange newInterchange) {
if (newInterchange != interchange) {
NotificationChain msgs = null;
if (interchange != null)
msgs = ((InternalEObject)interchange).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - SignalDSLPackage.SINGLE_TRANSFER__INTERCHANGE, null, msgs);
if (newInterchange != null)
msgs = ((InternalEObject)newInterchange).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - SignalDSLPackage.SINGLE_TRANSFER__INTERCHANGE, null, msgs);
msgs = basicSetInterchange(newInterchange, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, SignalDSLPackage.SINGLE_TRANSFER__INTERCHANGE, newInterchange, newInterchange));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case SignalDSLPackage.SINGLE_TRANSFER__INTERCHANGE:
return basicSetInterchange(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 SignalDSLPackage.SINGLE_TRANSFER__INTERCHANGE:
return getInterchange();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case SignalDSLPackage.SINGLE_TRANSFER__INTERCHANGE:
setInterchange((SignalDatainterchange)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case SignalDSLPackage.SINGLE_TRANSFER__INTERCHANGE:
setInterchange((SignalDatainterchange)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case SignalDSLPackage.SINGLE_TRANSFER__INTERCHANGE:
return interchange != null;
}
return super.eIsSet(featureID);
}
} //SingleTransferImpl