| /** |
| * 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 2.0 |
| * which accompanies this distribution, and is available at |
| * https://www.eclipse.org/legal/epl-2.0/ |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| * 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.WatcherWithFileMask; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Watcher With File Mask</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.osbp.xtext.signal.impl.WatcherWithFileMaskImpl#getFilemask <em>Filemask</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.signal.impl.WatcherWithFileMaskImpl#getInterchange <em>Interchange</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class WatcherWithFileMaskImpl extends WatcherDefinitionImpl implements WatcherWithFileMask { |
| /** |
| * The default value of the '{@link #getFilemask() <em>Filemask</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getFilemask() |
| * @generated |
| * @ordered |
| */ |
| protected static final String FILEMASK_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getFilemask() <em>Filemask</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getFilemask() |
| * @generated |
| * @ordered |
| */ |
| protected String filemask = FILEMASK_EDEFAULT; |
| |
| /** |
| * 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 WatcherWithFileMaskImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return SignalDSLPackage.Literals.WATCHER_WITH_FILE_MASK; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getFilemask() { |
| return filemask; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setFilemask(String newFilemask) { |
| String oldFilemask = filemask; |
| filemask = newFilemask; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, SignalDSLPackage.WATCHER_WITH_FILE_MASK__FILEMASK, oldFilemask, filemask)); |
| } |
| |
| /** |
| * <!-- 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.WATCHER_WITH_FILE_MASK__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.WATCHER_WITH_FILE_MASK__INTERCHANGE, null, msgs); |
| if (newInterchange != null) |
| msgs = ((InternalEObject)newInterchange).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - SignalDSLPackage.WATCHER_WITH_FILE_MASK__INTERCHANGE, null, msgs); |
| msgs = basicSetInterchange(newInterchange, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, SignalDSLPackage.WATCHER_WITH_FILE_MASK__INTERCHANGE, newInterchange, newInterchange)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case SignalDSLPackage.WATCHER_WITH_FILE_MASK__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.WATCHER_WITH_FILE_MASK__FILEMASK: |
| return getFilemask(); |
| case SignalDSLPackage.WATCHER_WITH_FILE_MASK__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.WATCHER_WITH_FILE_MASK__FILEMASK: |
| setFilemask((String)newValue); |
| return; |
| case SignalDSLPackage.WATCHER_WITH_FILE_MASK__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.WATCHER_WITH_FILE_MASK__FILEMASK: |
| setFilemask(FILEMASK_EDEFAULT); |
| return; |
| case SignalDSLPackage.WATCHER_WITH_FILE_MASK__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.WATCHER_WITH_FILE_MASK__FILEMASK: |
| return FILEMASK_EDEFAULT == null ? filemask != null : !FILEMASK_EDEFAULT.equals(filemask); |
| case SignalDSLPackage.WATCHER_WITH_FILE_MASK__INTERCHANGE: |
| return interchange != null; |
| } |
| 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(" (filemask: "); |
| result.append(filemask); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //WatcherWithFileMaskImpl |