| /** |
| * ******************************************************************************* |
| * Copyright (c) 2015-2021 Robert Bosch GmbH and others. |
| * |
| * This program and the accompanying materials are made |
| * available under the terms of the Eclipse Public License 2.0 |
| * which is available at https://www.eclipse.org/legal/epl-2.0/ |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| * Generated using Eclipse EMF |
| * |
| * ******************************************************************************* |
| */ |
| package org.eclipse.app4mc.amalthea.model.impl; |
| |
| import java.util.Collection; |
| |
| import org.eclipse.app4mc.amalthea.model.AmaltheaPackage; |
| import org.eclipse.app4mc.amalthea.model.BaseObject; |
| import org.eclipse.app4mc.amalthea.model.IAnnotatable; |
| import org.eclipse.app4mc.amalthea.model.RunnableEntityGroup; |
| import org.eclipse.app4mc.amalthea.model.Value; |
| |
| import org.eclipse.emf.common.notify.NotificationChain; |
| |
| import org.eclipse.emf.common.util.EList; |
| import org.eclipse.emf.common.util.EMap; |
| |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.EStructuralFeature; |
| import org.eclipse.emf.ecore.InternalEObject; |
| |
| import org.eclipse.emf.ecore.util.EObjectResolvingEList; |
| import org.eclipse.emf.ecore.util.EcoreEMap; |
| import org.eclipse.emf.ecore.util.InternalEList; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Runnable Entity Group</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.app4mc.amalthea.model.impl.RunnableEntityGroupImpl#getCustomProperties <em>Custom Properties</em>}</li> |
| * <li>{@link org.eclipse.app4mc.amalthea.model.impl.RunnableEntityGroupImpl#getRunnables <em>Runnables</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class RunnableEntityGroupImpl extends RunnableGroupImpl implements RunnableEntityGroup { |
| /** |
| * The cached value of the '{@link #getCustomProperties() <em>Custom Properties</em>}' map. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getCustomProperties() |
| * @generated |
| * @ordered |
| */ |
| protected EMap<String, Value> customProperties; |
| |
| /** |
| * The cached value of the '{@link #getRunnables() <em>Runnables</em>}' reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getRunnables() |
| * @generated |
| * @ordered |
| */ |
| protected EList<org.eclipse.app4mc.amalthea.model.Runnable> runnables; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected RunnableEntityGroupImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return AmaltheaPackage.eINSTANCE.getRunnableEntityGroup(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EMap<String, Value> getCustomProperties() { |
| if (customProperties == null) { |
| customProperties = new EcoreEMap<String,Value>(AmaltheaPackage.eINSTANCE.getCustomProperty(), CustomPropertyImpl.class, this, AmaltheaPackage.RUNNABLE_ENTITY_GROUP__CUSTOM_PROPERTIES); |
| } |
| return customProperties; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EList<org.eclipse.app4mc.amalthea.model.Runnable> getRunnables() { |
| if (runnables == null) { |
| runnables = new EObjectResolvingEList<org.eclipse.app4mc.amalthea.model.Runnable>(org.eclipse.app4mc.amalthea.model.Runnable.class, this, AmaltheaPackage.RUNNABLE_ENTITY_GROUP__RUNNABLES); |
| } |
| return runnables; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case AmaltheaPackage.RUNNABLE_ENTITY_GROUP__CUSTOM_PROPERTIES: |
| return ((InternalEList<?>)getCustomProperties()).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 AmaltheaPackage.RUNNABLE_ENTITY_GROUP__CUSTOM_PROPERTIES: |
| if (coreType) return getCustomProperties(); |
| else return getCustomProperties().map(); |
| case AmaltheaPackage.RUNNABLE_ENTITY_GROUP__RUNNABLES: |
| return getRunnables(); |
| } |
| 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 AmaltheaPackage.RUNNABLE_ENTITY_GROUP__CUSTOM_PROPERTIES: |
| ((EStructuralFeature.Setting)getCustomProperties()).set(newValue); |
| return; |
| case AmaltheaPackage.RUNNABLE_ENTITY_GROUP__RUNNABLES: |
| getRunnables().clear(); |
| getRunnables().addAll((Collection<? extends org.eclipse.app4mc.amalthea.model.Runnable>)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case AmaltheaPackage.RUNNABLE_ENTITY_GROUP__CUSTOM_PROPERTIES: |
| getCustomProperties().clear(); |
| return; |
| case AmaltheaPackage.RUNNABLE_ENTITY_GROUP__RUNNABLES: |
| getRunnables().clear(); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case AmaltheaPackage.RUNNABLE_ENTITY_GROUP__CUSTOM_PROPERTIES: |
| return customProperties != null && !customProperties.isEmpty(); |
| case AmaltheaPackage.RUNNABLE_ENTITY_GROUP__RUNNABLES: |
| return runnables != null && !runnables.isEmpty(); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) { |
| if (baseClass == IAnnotatable.class) { |
| switch (derivedFeatureID) { |
| case AmaltheaPackage.RUNNABLE_ENTITY_GROUP__CUSTOM_PROPERTIES: return AmaltheaPackage.IANNOTATABLE__CUSTOM_PROPERTIES; |
| default: return -1; |
| } |
| } |
| if (baseClass == BaseObject.class) { |
| switch (derivedFeatureID) { |
| default: return -1; |
| } |
| } |
| return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) { |
| if (baseClass == IAnnotatable.class) { |
| switch (baseFeatureID) { |
| case AmaltheaPackage.IANNOTATABLE__CUSTOM_PROPERTIES: return AmaltheaPackage.RUNNABLE_ENTITY_GROUP__CUSTOM_PROPERTIES; |
| default: return -1; |
| } |
| } |
| if (baseClass == BaseObject.class) { |
| switch (baseFeatureID) { |
| default: return -1; |
| } |
| } |
| return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); |
| } |
| |
| } //RunnableEntityGroupImpl |