| /** |
| * ******************************************************************************* |
| * 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.DataGroupScope; |
| import org.eclipse.app4mc.amalthea.model.DataStabilityGroup; |
| import org.eclipse.app4mc.amalthea.model.Label; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| 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.ENotificationImpl; |
| |
| import org.eclipse.emf.ecore.util.EObjectResolvingEList; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Data Stability Group</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.app4mc.amalthea.model.impl.DataStabilityGroupImpl#getLabels <em>Labels</em>}</li> |
| * <li>{@link org.eclipse.app4mc.amalthea.model.impl.DataStabilityGroupImpl#getScope <em>Scope</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class DataStabilityGroupImpl extends ReferableBaseObjectImpl implements DataStabilityGroup { |
| /** |
| * 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; |
| |
| /** |
| * The cached value of the '{@link #getScope() <em>Scope</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getScope() |
| * @generated |
| * @ordered |
| */ |
| protected DataGroupScope scope; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected DataStabilityGroupImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return AmaltheaPackage.eINSTANCE.getDataStabilityGroup(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EList<Label> getLabels() { |
| if (labels == null) { |
| labels = new EObjectResolvingEList<Label>(Label.class, this, AmaltheaPackage.DATA_STABILITY_GROUP__LABELS); |
| } |
| return labels; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public DataGroupScope getScope() { |
| return scope; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetScope(DataGroupScope newScope, NotificationChain msgs) { |
| DataGroupScope oldScope = scope; |
| scope = newScope; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, AmaltheaPackage.DATA_STABILITY_GROUP__SCOPE, oldScope, newScope); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setScope(DataGroupScope newScope) { |
| if (newScope != scope) { |
| NotificationChain msgs = null; |
| if (scope != null) |
| msgs = ((InternalEObject)scope).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - AmaltheaPackage.DATA_STABILITY_GROUP__SCOPE, null, msgs); |
| if (newScope != null) |
| msgs = ((InternalEObject)newScope).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - AmaltheaPackage.DATA_STABILITY_GROUP__SCOPE, null, msgs); |
| msgs = basicSetScope(newScope, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, AmaltheaPackage.DATA_STABILITY_GROUP__SCOPE, newScope, newScope)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case AmaltheaPackage.DATA_STABILITY_GROUP__SCOPE: |
| return basicSetScope(null, 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.DATA_STABILITY_GROUP__LABELS: |
| return getLabels(); |
| case AmaltheaPackage.DATA_STABILITY_GROUP__SCOPE: |
| return getScope(); |
| } |
| 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.DATA_STABILITY_GROUP__LABELS: |
| getLabels().clear(); |
| getLabels().addAll((Collection<? extends Label>)newValue); |
| return; |
| case AmaltheaPackage.DATA_STABILITY_GROUP__SCOPE: |
| setScope((DataGroupScope)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case AmaltheaPackage.DATA_STABILITY_GROUP__LABELS: |
| getLabels().clear(); |
| return; |
| case AmaltheaPackage.DATA_STABILITY_GROUP__SCOPE: |
| setScope((DataGroupScope)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case AmaltheaPackage.DATA_STABILITY_GROUP__LABELS: |
| return labels != null && !labels.isEmpty(); |
| case AmaltheaPackage.DATA_STABILITY_GROUP__SCOPE: |
| return scope != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //DataStabilityGroupImpl |