blob: af1f67117736773c1b40921e6093c70a5db21919 [file] [log] [blame]
/**
* Copyright (c) 2011, 2017 - 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 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Based on ideas from Xtext, Xtend, Xcore
*
* Contributors:
* Joerg Riegel - Initial implementation
*
*/
package org.eclipse.osbp.xtext.statemachine.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.statemachine.FSMActionFieldConcatenation;
import org.eclipse.osbp.xtext.statemachine.FSMActionPeripheralPTOpen;
import org.eclipse.osbp.xtext.statemachine.FSMPeripheralDevicePT;
import org.eclipse.osbp.xtext.statemachine.StatemachineDSLPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>FSM Action Peripheral PT Open</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.osbp.xtext.statemachine.impl.FSMActionPeripheralPTOpenImpl#getDevice <em>Device</em>}</li>
* <li>{@link org.eclipse.osbp.xtext.statemachine.impl.FSMActionPeripheralPTOpenImpl#getHost <em>Host</em>}</li>
* <li>{@link org.eclipse.osbp.xtext.statemachine.impl.FSMActionPeripheralPTOpenImpl#getPort <em>Port</em>}</li>
* </ul>
*
* @generated
*/
public class FSMActionPeripheralPTOpenImpl extends FSMLazyResolverImpl implements FSMActionPeripheralPTOpen {
/**
* The cached value of the '{@link #getDevice() <em>Device</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDevice()
* @generated
* @ordered
*/
protected FSMPeripheralDevicePT device;
/**
* The cached value of the '{@link #getHost() <em>Host</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getHost()
* @generated
* @ordered
*/
protected FSMActionFieldConcatenation host;
/**
* The cached value of the '{@link #getPort() <em>Port</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getPort()
* @generated
* @ordered
*/
protected FSMActionFieldConcatenation port;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected FSMActionPeripheralPTOpenImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return StatemachineDSLPackage.Literals.FSM_ACTION_PERIPHERAL_PT_OPEN;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public FSMPeripheralDevicePT getDevice() {
if (device != null && device.eIsProxy()) {
InternalEObject oldDevice = (InternalEObject)device;
device = (FSMPeripheralDevicePT)eResolveProxy(oldDevice);
if (device != oldDevice) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_PT_OPEN__DEVICE, oldDevice, device));
}
}
return device;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public FSMPeripheralDevicePT basicGetDevice() {
return device;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setDevice(FSMPeripheralDevicePT newDevice) {
FSMPeripheralDevicePT oldDevice = device;
device = newDevice;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_PT_OPEN__DEVICE, oldDevice, device));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public FSMActionFieldConcatenation getHost() {
return host;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetHost(FSMActionFieldConcatenation newHost, NotificationChain msgs) {
FSMActionFieldConcatenation oldHost = host;
host = newHost;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_PT_OPEN__HOST, oldHost, newHost);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setHost(FSMActionFieldConcatenation newHost) {
if (newHost != host) {
NotificationChain msgs = null;
if (host != null)
msgs = ((InternalEObject)host).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_PT_OPEN__HOST, null, msgs);
if (newHost != null)
msgs = ((InternalEObject)newHost).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_PT_OPEN__HOST, null, msgs);
msgs = basicSetHost(newHost, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_PT_OPEN__HOST, newHost, newHost));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public FSMActionFieldConcatenation getPort() {
return port;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetPort(FSMActionFieldConcatenation newPort, NotificationChain msgs) {
FSMActionFieldConcatenation oldPort = port;
port = newPort;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_PT_OPEN__PORT, oldPort, newPort);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setPort(FSMActionFieldConcatenation newPort) {
if (newPort != port) {
NotificationChain msgs = null;
if (port != null)
msgs = ((InternalEObject)port).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_PT_OPEN__PORT, null, msgs);
if (newPort != null)
msgs = ((InternalEObject)newPort).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_PT_OPEN__PORT, null, msgs);
msgs = basicSetPort(newPort, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_PT_OPEN__PORT, newPort, newPort));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_PT_OPEN__HOST:
return basicSetHost(null, msgs);
case StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_PT_OPEN__PORT:
return basicSetPort(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 StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_PT_OPEN__DEVICE:
if (resolve) return getDevice();
return basicGetDevice();
case StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_PT_OPEN__HOST:
return getHost();
case StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_PT_OPEN__PORT:
return getPort();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_PT_OPEN__DEVICE:
setDevice((FSMPeripheralDevicePT)newValue);
return;
case StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_PT_OPEN__HOST:
setHost((FSMActionFieldConcatenation)newValue);
return;
case StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_PT_OPEN__PORT:
setPort((FSMActionFieldConcatenation)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_PT_OPEN__DEVICE:
setDevice((FSMPeripheralDevicePT)null);
return;
case StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_PT_OPEN__HOST:
setHost((FSMActionFieldConcatenation)null);
return;
case StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_PT_OPEN__PORT:
setPort((FSMActionFieldConcatenation)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_PT_OPEN__DEVICE:
return device != null;
case StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_PT_OPEN__HOST:
return host != null;
case StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_PT_OPEN__PORT:
return port != null;
}
return super.eIsSet(featureID);
}
} //FSMActionPeripheralPTOpenImpl