| /** |
| * Copyright (c) 2017 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: |
| * CEA - initial API and implementation and/or initial documentation |
| */ |
| /** |
| * generated by Xtext 2.9.1 |
| */ |
| package org.eclipse.sensinact.studio.language.sensinact.impl; |
| |
| 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.impl.MinimalEObjectImpl; |
| |
| import org.eclipse.emf.ecore.util.EObjectContainmentEList; |
| import org.eclipse.emf.ecore.util.InternalEList; |
| |
| import org.eclipse.sensinact.studio.language.sensinact.DSL_ListActions; |
| import org.eclipse.sensinact.studio.language.sensinact.DSL_ResourceAction; |
| import org.eclipse.sensinact.studio.language.sensinact.SensinactPackage; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>DSL List Actions</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.sensinact.studio.language.sensinact.impl.DSL_ListActionsImpl#getActionList <em>Action List</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class DSL_ListActionsImpl extends MinimalEObjectImpl.Container implements DSL_ListActions |
| { |
| /** |
| * The cached value of the '{@link #getActionList() <em>Action List</em>}' containment reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getActionList() |
| * @generated |
| * @ordered |
| */ |
| protected EList<DSL_ResourceAction> actionList; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected DSL_ListActionsImpl() |
| { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() |
| { |
| return SensinactPackage.Literals.DSL_LIST_ACTIONS; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<DSL_ResourceAction> getActionList() |
| { |
| if (actionList == null) |
| { |
| actionList = new EObjectContainmentEList<DSL_ResourceAction>(DSL_ResourceAction.class, this, SensinactPackage.DSL_LIST_ACTIONS__ACTION_LIST); |
| } |
| return actionList; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) |
| { |
| switch (featureID) |
| { |
| case SensinactPackage.DSL_LIST_ACTIONS__ACTION_LIST: |
| return ((InternalEList<?>)getActionList()).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 SensinactPackage.DSL_LIST_ACTIONS__ACTION_LIST: |
| return getActionList(); |
| } |
| 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.DSL_LIST_ACTIONS__ACTION_LIST: |
| getActionList().clear(); |
| getActionList().addAll((Collection<? extends DSL_ResourceAction>)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) |
| { |
| switch (featureID) |
| { |
| case SensinactPackage.DSL_LIST_ACTIONS__ACTION_LIST: |
| getActionList().clear(); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) |
| { |
| switch (featureID) |
| { |
| case SensinactPackage.DSL_LIST_ACTIONS__ACTION_LIST: |
| return actionList != null && !actionList.isEmpty(); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //DSL_ListActionsImpl |