blob: df1da6208045391a24106b8548380980e0128855 [file] [log] [blame]
/**
* *******************************************************************************
* 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.DoubleDistribution;
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>Double Distribution</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.app4mc.amalthea.generator.configuration.impl.DoubleDistributionImpl#getMin <em>Min</em>}</li>
* <li>{@link org.eclipse.app4mc.amalthea.generator.configuration.impl.DoubleDistributionImpl#getAvg <em>Avg</em>}</li>
* <li>{@link org.eclipse.app4mc.amalthea.generator.configuration.impl.DoubleDistributionImpl#getMax <em>Max</em>}</li>
* </ul>
*
* @generated
*/
public class DoubleDistributionImpl extends DistributionImpl implements DoubleDistribution {
/**
* The default value of the '{@link #getMin() <em>Min</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getMin()
* @generated
* @ordered
*/
protected static final double MIN_EDEFAULT = 0.0;
/**
* The cached value of the '{@link #getMin() <em>Min</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getMin()
* @generated
* @ordered
*/
protected double min = MIN_EDEFAULT;
/**
* The default value of the '{@link #getAvg() <em>Avg</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAvg()
* @generated
* @ordered
*/
protected static final double AVG_EDEFAULT = 0.0;
/**
* The cached value of the '{@link #getAvg() <em>Avg</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAvg()
* @generated
* @ordered
*/
protected double avg = AVG_EDEFAULT;
/**
* The default value of the '{@link #getMax() <em>Max</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getMax()
* @generated
* @ordered
*/
protected static final double MAX_EDEFAULT = 0.0;
/**
* The cached value of the '{@link #getMax() <em>Max</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getMax()
* @generated
* @ordered
*/
protected double max = MAX_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected DoubleDistributionImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return RTMGCPackage.Literals.DOUBLE_DISTRIBUTION;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public double getMin() {
return min;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setMin(double newMin) {
double oldMin = min;
min = newMin;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, RTMGCPackage.DOUBLE_DISTRIBUTION__MIN, oldMin, min));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public double getAvg() {
return avg;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setAvg(double newAvg) {
double oldAvg = avg;
avg = newAvg;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, RTMGCPackage.DOUBLE_DISTRIBUTION__AVG, oldAvg, avg));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public double getMax() {
return max;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setMax(double newMax) {
double oldMax = max;
max = newMax;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, RTMGCPackage.DOUBLE_DISTRIBUTION__MAX, oldMax, max));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case RTMGCPackage.DOUBLE_DISTRIBUTION__MIN:
return getMin();
case RTMGCPackage.DOUBLE_DISTRIBUTION__AVG:
return getAvg();
case RTMGCPackage.DOUBLE_DISTRIBUTION__MAX:
return getMax();
}
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.DOUBLE_DISTRIBUTION__MIN:
setMin((Double)newValue);
return;
case RTMGCPackage.DOUBLE_DISTRIBUTION__AVG:
setAvg((Double)newValue);
return;
case RTMGCPackage.DOUBLE_DISTRIBUTION__MAX:
setMax((Double)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case RTMGCPackage.DOUBLE_DISTRIBUTION__MIN:
setMin(MIN_EDEFAULT);
return;
case RTMGCPackage.DOUBLE_DISTRIBUTION__AVG:
setAvg(AVG_EDEFAULT);
return;
case RTMGCPackage.DOUBLE_DISTRIBUTION__MAX:
setMax(MAX_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case RTMGCPackage.DOUBLE_DISTRIBUTION__MIN:
return min != MIN_EDEFAULT;
case RTMGCPackage.DOUBLE_DISTRIBUTION__AVG:
return avg != AVG_EDEFAULT;
case RTMGCPackage.DOUBLE_DISTRIBUTION__MAX:
return max != MAX_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(" (min: ");
result.append(min);
result.append(", avg: ");
result.append(avg);
result.append(", max: ");
result.append(max);
result.append(')');
return result.toString();
}
} //DoubleDistributionImpl