| /** |
| * ******************************************************************************* |
| * 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.DiscreteValueBoundaries; |
| import org.eclipse.app4mc.amalthea.model.SamplingType; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| |
| import org.eclipse.emf.ecore.EClass; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Discrete Value Boundaries</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.app4mc.amalthea.model.impl.DiscreteValueBoundariesImpl#getSamplingType <em>Sampling Type</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class DiscreteValueBoundariesImpl extends BoundedDiscreteValueDistributionImpl implements DiscreteValueBoundaries { |
| /** |
| * The default value of the '{@link #getSamplingType() <em>Sampling Type</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getSamplingType() |
| * @generated |
| * @ordered |
| */ |
| protected static final SamplingType SAMPLING_TYPE_EDEFAULT = SamplingType.DEFAULT; |
| |
| /** |
| * The cached value of the '{@link #getSamplingType() <em>Sampling Type</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getSamplingType() |
| * @generated |
| * @ordered |
| */ |
| protected SamplingType samplingType = SAMPLING_TYPE_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected DiscreteValueBoundariesImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return AmaltheaPackage.eINSTANCE.getDiscreteValueBoundaries(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public SamplingType getSamplingType() { |
| return samplingType; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setSamplingType(SamplingType newSamplingType) { |
| SamplingType oldSamplingType = samplingType; |
| samplingType = newSamplingType == null ? SAMPLING_TYPE_EDEFAULT : newSamplingType; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, AmaltheaPackage.DISCRETE_VALUE_BOUNDARIES__SAMPLING_TYPE, oldSamplingType, samplingType)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case AmaltheaPackage.DISCRETE_VALUE_BOUNDARIES__SAMPLING_TYPE: |
| return getSamplingType(); |
| } |
| 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.DISCRETE_VALUE_BOUNDARIES__SAMPLING_TYPE: |
| setSamplingType((SamplingType)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case AmaltheaPackage.DISCRETE_VALUE_BOUNDARIES__SAMPLING_TYPE: |
| setSamplingType(SAMPLING_TYPE_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case AmaltheaPackage.DISCRETE_VALUE_BOUNDARIES__SAMPLING_TYPE: |
| return samplingType != SAMPLING_TYPE_EDEFAULT; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String toString() { |
| if (eIsProxy()) return super.toString(); |
| |
| StringBuilder result = new StringBuilder(super.toString()); |
| result.append(" (samplingType: "); |
| result.append(samplingType); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //DiscreteValueBoundariesImpl |