| /** |
| * Copyright (c) 2018 CEA |
| * |
| * 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: |
| * Jérémie Tatibouet (CEA) jeremie.tatibouet@cea.fr - Initial API and implementation |
| * Benoit Maggi (CEA) benoit.maggi@cea.fr - Initial API and implementation |
| * Shuai Li (CEA) shuai.li@cea.fr - Integration of sensiNact and Web of Things Thing Description |
| * |
| */ |
| package org.eclipse.papyrus.iotml.sensinact.impl; |
| |
| import java.util.Collection; |
| |
| import org.eclipse.emf.common.util.EList; |
| |
| import org.eclipse.emf.ecore.EClass; |
| |
| import org.eclipse.emf.ecore.util.EObjectResolvingEList; |
| |
| import org.eclipse.papyrus.iotml.sensinact.Gateway; |
| import org.eclipse.papyrus.iotml.sensinact.SensinactPackage; |
| import org.eclipse.papyrus.iotml.sensinact.ServiceProvider; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Gateway</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.papyrus.iotml.sensinact.impl.GatewayImpl#getDevices <em>Devices</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class GatewayImpl extends org.eclipse.papyrus.iotml.hardware.network.impl.GatewayImpl implements Gateway { |
| /** |
| * The cached value of the '{@link #getDevices() <em>Devices</em>}' reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getDevices() |
| * @generated |
| * @ordered |
| */ |
| protected EList<ServiceProvider> devices; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected GatewayImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return SensinactPackage.Literals.GATEWAY; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EList<ServiceProvider> getDevices() { |
| if (devices == null) { |
| devices = new EObjectResolvingEList<ServiceProvider>(ServiceProvider.class, this, SensinactPackage.GATEWAY__DEVICES); |
| } |
| return devices; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case SensinactPackage.GATEWAY__DEVICES: |
| return getDevices(); |
| } |
| 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 SensinactPackage.GATEWAY__DEVICES: |
| getDevices().clear(); |
| getDevices().addAll((Collection<? extends ServiceProvider>)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case SensinactPackage.GATEWAY__DEVICES: |
| getDevices().clear(); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case SensinactPackage.GATEWAY__DEVICES: |
| return devices != null && !devices.isEmpty(); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //GatewayImpl |