| /** |
| * ******************************************************************************* |
| * 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.PercentageDistribution; |
| import org.eclipse.app4mc.amalthea.generator.configuration.RTMGCPackage; |
| |
| 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>Percentage Distribution</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.app4mc.amalthea.generator.configuration.impl.PercentageDistributionImpl#getMinPercentage <em>Min Percentage</em>}</li> |
| * <li>{@link org.eclipse.app4mc.amalthea.generator.configuration.impl.PercentageDistributionImpl#getAvgPercentage <em>Avg Percentage</em>}</li> |
| * <li>{@link org.eclipse.app4mc.amalthea.generator.configuration.impl.PercentageDistributionImpl#getMaxPercentage <em>Max Percentage</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class PercentageDistributionImpl extends DistributionImpl implements PercentageDistribution { |
| /** |
| * The default value of the '{@link #getMinPercentage() <em>Min Percentage</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getMinPercentage() |
| * @generated |
| * @ordered |
| */ |
| protected static final double MIN_PERCENTAGE_EDEFAULT = 0.0; |
| |
| /** |
| * The cached value of the '{@link #getMinPercentage() <em>Min Percentage</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getMinPercentage() |
| * @generated |
| * @ordered |
| */ |
| protected double minPercentage = MIN_PERCENTAGE_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getAvgPercentage() <em>Avg Percentage</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getAvgPercentage() |
| * @generated |
| * @ordered |
| */ |
| protected static final double AVG_PERCENTAGE_EDEFAULT = 0.0; |
| |
| /** |
| * The cached value of the '{@link #getAvgPercentage() <em>Avg Percentage</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getAvgPercentage() |
| * @generated |
| * @ordered |
| */ |
| protected double avgPercentage = AVG_PERCENTAGE_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getMaxPercentage() <em>Max Percentage</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getMaxPercentage() |
| * @generated |
| * @ordered |
| */ |
| protected static final double MAX_PERCENTAGE_EDEFAULT = 0.0; |
| |
| /** |
| * The cached value of the '{@link #getMaxPercentage() <em>Max Percentage</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getMaxPercentage() |
| * @generated |
| * @ordered |
| */ |
| protected double maxPercentage = MAX_PERCENTAGE_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected PercentageDistributionImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return RTMGCPackage.Literals.PERCENTAGE_DISTRIBUTION; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public double getMinPercentage() { |
| return minPercentage; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setMinPercentage(double newMinPercentage) { |
| double oldMinPercentage = minPercentage; |
| minPercentage = newMinPercentage; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, RTMGCPackage.PERCENTAGE_DISTRIBUTION__MIN_PERCENTAGE, oldMinPercentage, minPercentage)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public double getAvgPercentage() { |
| return avgPercentage; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setAvgPercentage(double newAvgPercentage) { |
| double oldAvgPercentage = avgPercentage; |
| avgPercentage = newAvgPercentage; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, RTMGCPackage.PERCENTAGE_DISTRIBUTION__AVG_PERCENTAGE, oldAvgPercentage, avgPercentage)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public double getMaxPercentage() { |
| return maxPercentage; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setMaxPercentage(double newMaxPercentage) { |
| double oldMaxPercentage = maxPercentage; |
| maxPercentage = newMaxPercentage; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, RTMGCPackage.PERCENTAGE_DISTRIBUTION__MAX_PERCENTAGE, oldMaxPercentage, maxPercentage)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case RTMGCPackage.PERCENTAGE_DISTRIBUTION__MIN_PERCENTAGE: |
| return getMinPercentage(); |
| case RTMGCPackage.PERCENTAGE_DISTRIBUTION__AVG_PERCENTAGE: |
| return getAvgPercentage(); |
| case RTMGCPackage.PERCENTAGE_DISTRIBUTION__MAX_PERCENTAGE: |
| return getMaxPercentage(); |
| } |
| 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.PERCENTAGE_DISTRIBUTION__MIN_PERCENTAGE: |
| setMinPercentage((Double)newValue); |
| return; |
| case RTMGCPackage.PERCENTAGE_DISTRIBUTION__AVG_PERCENTAGE: |
| setAvgPercentage((Double)newValue); |
| return; |
| case RTMGCPackage.PERCENTAGE_DISTRIBUTION__MAX_PERCENTAGE: |
| setMaxPercentage((Double)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case RTMGCPackage.PERCENTAGE_DISTRIBUTION__MIN_PERCENTAGE: |
| setMinPercentage(MIN_PERCENTAGE_EDEFAULT); |
| return; |
| case RTMGCPackage.PERCENTAGE_DISTRIBUTION__AVG_PERCENTAGE: |
| setAvgPercentage(AVG_PERCENTAGE_EDEFAULT); |
| return; |
| case RTMGCPackage.PERCENTAGE_DISTRIBUTION__MAX_PERCENTAGE: |
| setMaxPercentage(MAX_PERCENTAGE_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case RTMGCPackage.PERCENTAGE_DISTRIBUTION__MIN_PERCENTAGE: |
| return minPercentage != MIN_PERCENTAGE_EDEFAULT; |
| case RTMGCPackage.PERCENTAGE_DISTRIBUTION__AVG_PERCENTAGE: |
| return avgPercentage != AVG_PERCENTAGE_EDEFAULT; |
| case RTMGCPackage.PERCENTAGE_DISTRIBUTION__MAX_PERCENTAGE: |
| return maxPercentage != MAX_PERCENTAGE_EDEFAULT; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String toString() { |
| if (eIsProxy()) return super.toString(); |
| |
| StringBuffer result = new StringBuffer(super.toString()); |
| result.append(" (minPercentage: "); |
| result.append(minPercentage); |
| result.append(", avgPercentage: "); |
| result.append(avgPercentage); |
| result.append(", maxPercentage: "); |
| result.append(maxPercentage); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //PercentageDistributionImpl |