blob: 0024caf430c974fc64aff8d43a2f051ec9a7b10f [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 java.util.Collection;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
import org.eclipse.osbp.xtext.signal.ListTransfer;
import org.eclipse.osbp.xtext.signal.SignalDSLPackage;
import org.eclipse.osbp.xtext.signal.SignalDatainterchange;
import org.eclipse.osbp.xtext.signal.SignalExecutionTypeEnum;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>List Transfer</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.osbp.xtext.signal.impl.ListTransferImpl#getExecutiontype <em>Executiontype</em>}</li>
* <li>{@link org.eclipse.osbp.xtext.signal.impl.ListTransferImpl#getInterchanges <em>Interchanges</em>}</li>
* </ul>
*
* @generated
*/
public class ListTransferImpl extends DataTransferImpl implements ListTransfer {
/**
* 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.SYNC;
/**
* 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;
/**
* The cached value of the '{@link #getInterchanges() <em>Interchanges</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getInterchanges()
* @generated
* @ordered
*/
protected EList<SignalDatainterchange> interchanges;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ListTransferImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return SignalDSLPackage.Literals.LIST_TRANSFER;
}
/**
* <!-- 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.LIST_TRANSFER__EXECUTIONTYPE, oldExecutiontype, executiontype));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<SignalDatainterchange> getInterchanges() {
if (interchanges == null) {
interchanges = new EObjectContainmentEList<SignalDatainterchange>(SignalDatainterchange.class, this, SignalDSLPackage.LIST_TRANSFER__INTERCHANGES);
}
return interchanges;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case SignalDSLPackage.LIST_TRANSFER__INTERCHANGES:
return ((InternalEList<?>)getInterchanges()).basicRemove(otherEnd, 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.LIST_TRANSFER__EXECUTIONTYPE:
return getExecutiontype();
case SignalDSLPackage.LIST_TRANSFER__INTERCHANGES:
return getInterchanges();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case SignalDSLPackage.LIST_TRANSFER__EXECUTIONTYPE:
setExecutiontype((SignalExecutionTypeEnum)newValue);
return;
case SignalDSLPackage.LIST_TRANSFER__INTERCHANGES:
getInterchanges().clear();
getInterchanges().addAll((Collection<? extends SignalDatainterchange>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case SignalDSLPackage.LIST_TRANSFER__EXECUTIONTYPE:
setExecutiontype(EXECUTIONTYPE_EDEFAULT);
return;
case SignalDSLPackage.LIST_TRANSFER__INTERCHANGES:
getInterchanges().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case SignalDSLPackage.LIST_TRANSFER__EXECUTIONTYPE:
return executiontype != EXECUTIONTYPE_EDEFAULT;
case SignalDSLPackage.LIST_TRANSFER__INTERCHANGES:
return interchanges != null && !interchanges.isEmpty();
}
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();
}
} //ListTransferImpl