| /** |
| * ******************************************************************************* |
| * Copyright (c) 2017 Timing-Architects Embedded Systems GmbH and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Generated using Eclipse EMF |
| * |
| * ******************************************************************************* |
| */ |
| package org.eclipse.app4mc.amalthea.generator.configuration.impl; |
| |
| import org.eclipse.app4mc.amalthea.generator.configuration.IntegerTimeDistribution; |
| import org.eclipse.app4mc.amalthea.generator.configuration.PercentageDistribution; |
| import org.eclipse.app4mc.amalthea.generator.configuration.RTMGCPackage; |
| import org.eclipse.app4mc.amalthea.generator.configuration.SporadicActivation; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| import org.eclipse.emf.common.notify.NotificationChain; |
| |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.InternalEObject; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Sporadic Activation</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.app4mc.amalthea.generator.configuration.impl.SporadicActivationImpl#getMinValue <em>Min Value</em>}</li> |
| * <li>{@link org.eclipse.app4mc.amalthea.generator.configuration.impl.SporadicActivationImpl#getMaxValueDistance <em>Max Value Distance</em>}</li> |
| * <li>{@link org.eclipse.app4mc.amalthea.generator.configuration.impl.SporadicActivationImpl#getAvgValueDistance <em>Avg Value Distance</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class SporadicActivationImpl extends ActivationImpl implements SporadicActivation { |
| /** |
| * The cached value of the '{@link #getMinValue() <em>Min Value</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getMinValue() |
| * @generated |
| * @ordered |
| */ |
| protected IntegerTimeDistribution minValue; |
| |
| /** |
| * The cached value of the '{@link #getMaxValueDistance() <em>Max Value Distance</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getMaxValueDistance() |
| * @generated |
| * @ordered |
| */ |
| protected PercentageDistribution maxValueDistance; |
| |
| /** |
| * The cached value of the '{@link #getAvgValueDistance() <em>Avg Value Distance</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getAvgValueDistance() |
| * @generated |
| * @ordered |
| */ |
| protected PercentageDistribution avgValueDistance; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected SporadicActivationImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return RTMGCPackage.Literals.SPORADIC_ACTIVATION; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public IntegerTimeDistribution getMinValue() { |
| return minValue; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetMinValue(IntegerTimeDistribution newMinValue, NotificationChain msgs) { |
| IntegerTimeDistribution oldMinValue = minValue; |
| minValue = newMinValue; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, RTMGCPackage.SPORADIC_ACTIVATION__MIN_VALUE, oldMinValue, newMinValue); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setMinValue(IntegerTimeDistribution newMinValue) { |
| if (newMinValue != minValue) { |
| NotificationChain msgs = null; |
| if (minValue != null) |
| msgs = ((InternalEObject)minValue).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - RTMGCPackage.SPORADIC_ACTIVATION__MIN_VALUE, null, msgs); |
| if (newMinValue != null) |
| msgs = ((InternalEObject)newMinValue).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - RTMGCPackage.SPORADIC_ACTIVATION__MIN_VALUE, null, msgs); |
| msgs = basicSetMinValue(newMinValue, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, RTMGCPackage.SPORADIC_ACTIVATION__MIN_VALUE, newMinValue, newMinValue)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public PercentageDistribution getMaxValueDistance() { |
| return maxValueDistance; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetMaxValueDistance(PercentageDistribution newMaxValueDistance, NotificationChain msgs) { |
| PercentageDistribution oldMaxValueDistance = maxValueDistance; |
| maxValueDistance = newMaxValueDistance; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, RTMGCPackage.SPORADIC_ACTIVATION__MAX_VALUE_DISTANCE, oldMaxValueDistance, newMaxValueDistance); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setMaxValueDistance(PercentageDistribution newMaxValueDistance) { |
| if (newMaxValueDistance != maxValueDistance) { |
| NotificationChain msgs = null; |
| if (maxValueDistance != null) |
| msgs = ((InternalEObject)maxValueDistance).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - RTMGCPackage.SPORADIC_ACTIVATION__MAX_VALUE_DISTANCE, null, msgs); |
| if (newMaxValueDistance != null) |
| msgs = ((InternalEObject)newMaxValueDistance).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - RTMGCPackage.SPORADIC_ACTIVATION__MAX_VALUE_DISTANCE, null, msgs); |
| msgs = basicSetMaxValueDistance(newMaxValueDistance, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, RTMGCPackage.SPORADIC_ACTIVATION__MAX_VALUE_DISTANCE, newMaxValueDistance, newMaxValueDistance)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public PercentageDistribution getAvgValueDistance() { |
| return avgValueDistance; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetAvgValueDistance(PercentageDistribution newAvgValueDistance, NotificationChain msgs) { |
| PercentageDistribution oldAvgValueDistance = avgValueDistance; |
| avgValueDistance = newAvgValueDistance; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, RTMGCPackage.SPORADIC_ACTIVATION__AVG_VALUE_DISTANCE, oldAvgValueDistance, newAvgValueDistance); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setAvgValueDistance(PercentageDistribution newAvgValueDistance) { |
| if (newAvgValueDistance != avgValueDistance) { |
| NotificationChain msgs = null; |
| if (avgValueDistance != null) |
| msgs = ((InternalEObject)avgValueDistance).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - RTMGCPackage.SPORADIC_ACTIVATION__AVG_VALUE_DISTANCE, null, msgs); |
| if (newAvgValueDistance != null) |
| msgs = ((InternalEObject)newAvgValueDistance).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - RTMGCPackage.SPORADIC_ACTIVATION__AVG_VALUE_DISTANCE, null, msgs); |
| msgs = basicSetAvgValueDistance(newAvgValueDistance, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, RTMGCPackage.SPORADIC_ACTIVATION__AVG_VALUE_DISTANCE, newAvgValueDistance, newAvgValueDistance)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case RTMGCPackage.SPORADIC_ACTIVATION__MIN_VALUE: |
| return basicSetMinValue(null, msgs); |
| case RTMGCPackage.SPORADIC_ACTIVATION__MAX_VALUE_DISTANCE: |
| return basicSetMaxValueDistance(null, msgs); |
| case RTMGCPackage.SPORADIC_ACTIVATION__AVG_VALUE_DISTANCE: |
| return basicSetAvgValueDistance(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 RTMGCPackage.SPORADIC_ACTIVATION__MIN_VALUE: |
| return getMinValue(); |
| case RTMGCPackage.SPORADIC_ACTIVATION__MAX_VALUE_DISTANCE: |
| return getMaxValueDistance(); |
| case RTMGCPackage.SPORADIC_ACTIVATION__AVG_VALUE_DISTANCE: |
| return getAvgValueDistance(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case RTMGCPackage.SPORADIC_ACTIVATION__MIN_VALUE: |
| setMinValue((IntegerTimeDistribution)newValue); |
| return; |
| case RTMGCPackage.SPORADIC_ACTIVATION__MAX_VALUE_DISTANCE: |
| setMaxValueDistance((PercentageDistribution)newValue); |
| return; |
| case RTMGCPackage.SPORADIC_ACTIVATION__AVG_VALUE_DISTANCE: |
| setAvgValueDistance((PercentageDistribution)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case RTMGCPackage.SPORADIC_ACTIVATION__MIN_VALUE: |
| setMinValue((IntegerTimeDistribution)null); |
| return; |
| case RTMGCPackage.SPORADIC_ACTIVATION__MAX_VALUE_DISTANCE: |
| setMaxValueDistance((PercentageDistribution)null); |
| return; |
| case RTMGCPackage.SPORADIC_ACTIVATION__AVG_VALUE_DISTANCE: |
| setAvgValueDistance((PercentageDistribution)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case RTMGCPackage.SPORADIC_ACTIVATION__MIN_VALUE: |
| return minValue != null; |
| case RTMGCPackage.SPORADIC_ACTIVATION__MAX_VALUE_DISTANCE: |
| return maxValueDistance != null; |
| case RTMGCPackage.SPORADIC_ACTIVATION__AVG_VALUE_DISTANCE: |
| return avgValueDistance != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //SporadicActivationImpl |