blob: e25ed53a2b91f15261140ea98c2c42e76199b7b3 [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 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.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
import org.eclipse.osbp.xtext.datainterchange.DataInterchangeGroup;
import org.eclipse.osbp.xtext.signal.SignalDSLPackage;
import org.eclipse.osbp.xtext.signal.SignalExecutionTypeEnum;
import org.eclipse.osbp.xtext.signal.WatcherDefinition;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Watcher Definition</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.osbp.xtext.signal.impl.WatcherDefinitionImpl#getInterchangegroup <em>Interchangegroup</em>}</li>
* <li>{@link org.eclipse.osbp.xtext.signal.impl.WatcherDefinitionImpl#getExecutiontype <em>Executiontype</em>}</li>
* </ul>
*
* @generated
*/
public class WatcherDefinitionImpl extends MinimalEObjectImpl.Container implements WatcherDefinition {
/**
* The cached value of the '{@link #getInterchangegroup() <em>Interchangegroup</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getInterchangegroup()
* @generated
* @ordered
*/
protected DataInterchangeGroup interchangegroup;
/**
* The default value of the '{@link #getExecutiontype() <em>Executiontype</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getExecutiontype()
* @generated
* @ordered
*/
protected static final SignalExecutionTypeEnum EXECUTIONTYPE_EDEFAULT = SignalExecutionTypeEnum.SEQ;
/**
* The cached value of the '{@link #getExecutiontype() <em>Executiontype</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getExecutiontype()
* @generated
* @ordered
*/
protected SignalExecutionTypeEnum executiontype = EXECUTIONTYPE_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected WatcherDefinitionImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return SignalDSLPackage.Literals.WATCHER_DEFINITION;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public DataInterchangeGroup getInterchangegroup() {
if (interchangegroup != null && interchangegroup.eIsProxy()) {
InternalEObject oldInterchangegroup = (InternalEObject)interchangegroup;
interchangegroup = (DataInterchangeGroup)eResolveProxy(oldInterchangegroup);
if (interchangegroup != oldInterchangegroup) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, SignalDSLPackage.WATCHER_DEFINITION__INTERCHANGEGROUP, oldInterchangegroup, interchangegroup));
}
}
return interchangegroup;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public DataInterchangeGroup basicGetInterchangegroup() {
return interchangegroup;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setInterchangegroup(DataInterchangeGroup newInterchangegroup) {
DataInterchangeGroup oldInterchangegroup = interchangegroup;
interchangegroup = newInterchangegroup;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, SignalDSLPackage.WATCHER_DEFINITION__INTERCHANGEGROUP, oldInterchangegroup, interchangegroup));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public SignalExecutionTypeEnum getExecutiontype() {
return executiontype;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setExecutiontype(SignalExecutionTypeEnum newExecutiontype) {
SignalExecutionTypeEnum oldExecutiontype = executiontype;
executiontype = newExecutiontype == null ? EXECUTIONTYPE_EDEFAULT : newExecutiontype;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, SignalDSLPackage.WATCHER_DEFINITION__EXECUTIONTYPE, oldExecutiontype, executiontype));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case SignalDSLPackage.WATCHER_DEFINITION__INTERCHANGEGROUP:
if (resolve) return getInterchangegroup();
return basicGetInterchangegroup();
case SignalDSLPackage.WATCHER_DEFINITION__EXECUTIONTYPE:
return getExecutiontype();
}
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_DEFINITION__INTERCHANGEGROUP:
setInterchangegroup((DataInterchangeGroup)newValue);
return;
case SignalDSLPackage.WATCHER_DEFINITION__EXECUTIONTYPE:
setExecutiontype((SignalExecutionTypeEnum)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case SignalDSLPackage.WATCHER_DEFINITION__INTERCHANGEGROUP:
setInterchangegroup((DataInterchangeGroup)null);
return;
case SignalDSLPackage.WATCHER_DEFINITION__EXECUTIONTYPE:
setExecutiontype(EXECUTIONTYPE_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case SignalDSLPackage.WATCHER_DEFINITION__INTERCHANGEGROUP:
return interchangegroup != null;
case SignalDSLPackage.WATCHER_DEFINITION__EXECUTIONTYPE:
return executiontype != EXECUTIONTYPE_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(" (executiontype: ");
result.append(executiontype);
result.append(')');
return result.toString();
}
} //WatcherDefinitionImpl