| /** |
| * ******************************************************************************* |
| * 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 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.ProcessGroup; |
| import org.eclipse.app4mc.amalthea.model.Tag; |
| import org.eclipse.app4mc.amalthea.model.TagGroup; |
| import org.eclipse.app4mc.amalthea.model.Value; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| import org.eclipse.emf.common.notify.NotificationChain; |
| |
| 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.impl.ENotificationImpl; |
| |
| 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>Tag Group</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.app4mc.amalthea.model.impl.TagGroupImpl#getCustomProperties <em>Custom Properties</em>}</li> |
| * <li>{@link org.eclipse.app4mc.amalthea.model.impl.TagGroupImpl#getTag <em>Tag</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class TagGroupImpl extends RunnableGroupImpl implements TagGroup { |
| /** |
| * 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 #getTag() <em>Tag</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getTag() |
| * @generated |
| * @ordered |
| */ |
| protected Tag tag; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected TagGroupImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return AmaltheaPackage.eINSTANCE.getTagGroup(); |
| } |
| |
| /** |
| * <!-- 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.TAG_GROUP__CUSTOM_PROPERTIES); |
| } |
| return customProperties; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Tag getTag() { |
| if (tag != null && tag.eIsProxy()) { |
| InternalEObject oldTag = (InternalEObject)tag; |
| tag = (Tag)eResolveProxy(oldTag); |
| if (tag != oldTag) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, AmaltheaPackage.TAG_GROUP__TAG, oldTag, tag)); |
| } |
| } |
| return tag; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Tag basicGetTag() { |
| return tag; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setTag(Tag newTag) { |
| Tag oldTag = tag; |
| tag = newTag; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, AmaltheaPackage.TAG_GROUP__TAG, oldTag, tag)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case AmaltheaPackage.TAG_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.TAG_GROUP__CUSTOM_PROPERTIES: |
| if (coreType) return getCustomProperties(); |
| else return getCustomProperties().map(); |
| case AmaltheaPackage.TAG_GROUP__TAG: |
| if (resolve) return getTag(); |
| return basicGetTag(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case AmaltheaPackage.TAG_GROUP__CUSTOM_PROPERTIES: |
| ((EStructuralFeature.Setting)getCustomProperties()).set(newValue); |
| return; |
| case AmaltheaPackage.TAG_GROUP__TAG: |
| setTag((Tag)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case AmaltheaPackage.TAG_GROUP__CUSTOM_PROPERTIES: |
| getCustomProperties().clear(); |
| return; |
| case AmaltheaPackage.TAG_GROUP__TAG: |
| setTag((Tag)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case AmaltheaPackage.TAG_GROUP__CUSTOM_PROPERTIES: |
| return customProperties != null && !customProperties.isEmpty(); |
| case AmaltheaPackage.TAG_GROUP__TAG: |
| return tag != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) { |
| if (baseClass == ProcessGroup.class) { |
| switch (derivedFeatureID) { |
| default: return -1; |
| } |
| } |
| if (baseClass == IAnnotatable.class) { |
| switch (derivedFeatureID) { |
| case AmaltheaPackage.TAG_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 == ProcessGroup.class) { |
| switch (baseFeatureID) { |
| default: return -1; |
| } |
| } |
| if (baseClass == IAnnotatable.class) { |
| switch (baseFeatureID) { |
| case AmaltheaPackage.IANNOTATABLE__CUSTOM_PROPERTIES: return AmaltheaPackage.TAG_GROUP__CUSTOM_PROPERTIES; |
| default: return -1; |
| } |
| } |
| if (baseClass == BaseObject.class) { |
| switch (baseFeatureID) { |
| default: return -1; |
| } |
| } |
| return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); |
| } |
| |
| } //TagGroupImpl |