| /** |
| * **************************************************************************** |
| * Copyright (c) 2020 CEA LIST. |
| * |
| * |
| * 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: |
| * Asma Smaoui (CEA LIST) asma.smaoui@cea.fr - Initial API and implementation |
| * |
| * **************************************************************************** |
| */ |
| package io.shell.admin.aas._1._0.impl; |
| |
| import io.shell.admin.aas._1._0.OperationT; |
| import io.shell.admin.aas._1._0.OperationVariableT; |
| import io.shell.admin.aas._1._0._0Package; |
| |
| import java.util.Collection; |
| |
| 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.util.EObjectContainmentEList; |
| import org.eclipse.emf.ecore.util.InternalEList; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Operation T</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link io.shell.admin.aas._1._0.impl.OperationTImpl#getIn <em>In</em>}</li> |
| * <li>{@link io.shell.admin.aas._1._0.impl.OperationTImpl#getOut <em>Out</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class OperationTImpl extends SubmodelElementAbstractTImpl implements OperationT { |
| /** |
| * The cached value of the '{@link #getIn() <em>In</em>}' containment reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getIn() |
| * @generated |
| * @ordered |
| */ |
| protected EList<OperationVariableT> in; |
| |
| /** |
| * The cached value of the '{@link #getOut() <em>Out</em>}' containment reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getOut() |
| * @generated |
| * @ordered |
| */ |
| protected EList<OperationVariableT> out; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected OperationTImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return _0Package.Literals.OPERATION_T; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<OperationVariableT> getIn() { |
| if (in == null) { |
| in = new EObjectContainmentEList<OperationVariableT>(OperationVariableT.class, this, _0Package.OPERATION_T__IN); |
| } |
| return in; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<OperationVariableT> getOut() { |
| if (out == null) { |
| out = new EObjectContainmentEList<OperationVariableT>(OperationVariableT.class, this, _0Package.OPERATION_T__OUT); |
| } |
| return out; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case _0Package.OPERATION_T__IN: |
| return ((InternalEList<?>)getIn()).basicRemove(otherEnd, msgs); |
| case _0Package.OPERATION_T__OUT: |
| return ((InternalEList<?>)getOut()).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 _0Package.OPERATION_T__IN: |
| return getIn(); |
| case _0Package.OPERATION_T__OUT: |
| return getOut(); |
| } |
| 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 _0Package.OPERATION_T__IN: |
| getIn().clear(); |
| getIn().addAll((Collection<? extends OperationVariableT>)newValue); |
| return; |
| case _0Package.OPERATION_T__OUT: |
| getOut().clear(); |
| getOut().addAll((Collection<? extends OperationVariableT>)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case _0Package.OPERATION_T__IN: |
| getIn().clear(); |
| return; |
| case _0Package.OPERATION_T__OUT: |
| getOut().clear(); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case _0Package.OPERATION_T__IN: |
| return in != null && !in.isEmpty(); |
| case _0Package.OPERATION_T__OUT: |
| return out != null && !out.isEmpty(); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //OperationTImpl |