blob: e3a52269d262851adbd6bfc3c6f818552a730710 [file] [log] [blame]
/**
* *******************************************************************************
* 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.Label;
import org.eclipse.app4mc.amalthea.model.LabelEntityGroup;
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>Label Entity Group</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.app4mc.amalthea.model.impl.LabelEntityGroupImpl#getCustomProperties <em>Custom Properties</em>}</li>
* <li>{@link org.eclipse.app4mc.amalthea.model.impl.LabelEntityGroupImpl#getLabels <em>Labels</em>}</li>
* </ul>
*
* @generated
*/
public class LabelEntityGroupImpl extends LabelGroupImpl implements LabelEntityGroup {
/**
* 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 #getLabels() <em>Labels</em>}' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getLabels()
* @generated
* @ordered
*/
protected EList<Label> labels;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected LabelEntityGroupImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return AmaltheaPackage.eINSTANCE.getLabelEntityGroup();
}
/**
* <!-- 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.LABEL_ENTITY_GROUP__CUSTOM_PROPERTIES);
}
return customProperties;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EList<Label> getLabels() {
if (labels == null) {
labels = new EObjectResolvingEList<Label>(Label.class, this, AmaltheaPackage.LABEL_ENTITY_GROUP__LABELS);
}
return labels;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case AmaltheaPackage.LABEL_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.LABEL_ENTITY_GROUP__CUSTOM_PROPERTIES:
if (coreType) return getCustomProperties();
else return getCustomProperties().map();
case AmaltheaPackage.LABEL_ENTITY_GROUP__LABELS:
return getLabels();
}
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.LABEL_ENTITY_GROUP__CUSTOM_PROPERTIES:
((EStructuralFeature.Setting)getCustomProperties()).set(newValue);
return;
case AmaltheaPackage.LABEL_ENTITY_GROUP__LABELS:
getLabels().clear();
getLabels().addAll((Collection<? extends Label>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case AmaltheaPackage.LABEL_ENTITY_GROUP__CUSTOM_PROPERTIES:
getCustomProperties().clear();
return;
case AmaltheaPackage.LABEL_ENTITY_GROUP__LABELS:
getLabels().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case AmaltheaPackage.LABEL_ENTITY_GROUP__CUSTOM_PROPERTIES:
return customProperties != null && !customProperties.isEmpty();
case AmaltheaPackage.LABEL_ENTITY_GROUP__LABELS:
return labels != null && !labels.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.LABEL_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.LABEL_ENTITY_GROUP__CUSTOM_PROPERTIES;
default: return -1;
}
}
if (baseClass == BaseObject.class) {
switch (baseFeatureID) {
default: return -1;
}
}
return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
}
} //LabelEntityGroupImpl