| /** |
| * 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.ecore.EClass; |
| import org.eclipse.emf.ecore.InternalEObject; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| import org.eclipse.osbp.xtext.statemachine.FSMActionPeripheralMarqueeUnitWait; |
| import org.eclipse.osbp.xtext.statemachine.FSMPeripheralDeviceLineDisplay; |
| import org.eclipse.osbp.xtext.statemachine.StatemachineDSLPackage; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>FSM Action Peripheral Marquee Unit Wait</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.osbp.xtext.statemachine.impl.FSMActionPeripheralMarqueeUnitWaitImpl#getDevice <em>Device</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.statemachine.impl.FSMActionPeripheralMarqueeUnitWaitImpl#getWait <em>Wait</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class FSMActionPeripheralMarqueeUnitWaitImpl extends FSMLazyResolverImpl implements FSMActionPeripheralMarqueeUnitWait { |
| /** |
| * The cached value of the '{@link #getDevice() <em>Device</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getDevice() |
| * @generated |
| * @ordered |
| */ |
| protected FSMPeripheralDeviceLineDisplay device; |
| |
| /** |
| * The default value of the '{@link #getWait() <em>Wait</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getWait() |
| * @generated |
| * @ordered |
| */ |
| protected static final int WAIT_EDEFAULT = 0; |
| |
| /** |
| * The cached value of the '{@link #getWait() <em>Wait</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getWait() |
| * @generated |
| * @ordered |
| */ |
| protected int wait = WAIT_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected FSMActionPeripheralMarqueeUnitWaitImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return StatemachineDSLPackage.Literals.FSM_ACTION_PERIPHERAL_MARQUEE_UNIT_WAIT; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public FSMPeripheralDeviceLineDisplay getDevice() { |
| if (device != null && device.eIsProxy()) { |
| InternalEObject oldDevice = (InternalEObject)device; |
| device = (FSMPeripheralDeviceLineDisplay)eResolveProxy(oldDevice); |
| if (device != oldDevice) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_MARQUEE_UNIT_WAIT__DEVICE, oldDevice, device)); |
| } |
| } |
| return device; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public FSMPeripheralDeviceLineDisplay basicGetDevice() { |
| return device; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setDevice(FSMPeripheralDeviceLineDisplay newDevice) { |
| FSMPeripheralDeviceLineDisplay oldDevice = device; |
| device = newDevice; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_MARQUEE_UNIT_WAIT__DEVICE, oldDevice, device)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public int getWait() { |
| return wait; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setWait(int newWait) { |
| int oldWait = wait; |
| wait = newWait; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_MARQUEE_UNIT_WAIT__WAIT, oldWait, wait)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_MARQUEE_UNIT_WAIT__DEVICE: |
| if (resolve) return getDevice(); |
| return basicGetDevice(); |
| case StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_MARQUEE_UNIT_WAIT__WAIT: |
| return getWait(); |
| } |
| 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_MARQUEE_UNIT_WAIT__DEVICE: |
| setDevice((FSMPeripheralDeviceLineDisplay)newValue); |
| return; |
| case StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_MARQUEE_UNIT_WAIT__WAIT: |
| setWait((Integer)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_MARQUEE_UNIT_WAIT__DEVICE: |
| setDevice((FSMPeripheralDeviceLineDisplay)null); |
| return; |
| case StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_MARQUEE_UNIT_WAIT__WAIT: |
| setWait(WAIT_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_MARQUEE_UNIT_WAIT__DEVICE: |
| return device != null; |
| case StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_MARQUEE_UNIT_WAIT__WAIT: |
| return wait != WAIT_EDEFAULT; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String toString() { |
| if (eIsProxy()) return super.toString(); |
| |
| StringBuffer result = new StringBuffer(super.toString()); |
| result.append(" (wait: "); |
| result.append(wait); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //FSMActionPeripheralMarqueeUnitWaitImpl |