blob: c631904105271c1fcbc6e532521686ca95e30f42 [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.IntegerDistribution;
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>Integer Distribution</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.app4mc.amalthea.generator.configuration.impl.IntegerDistributionImpl#getMin <em>Min</em>}</li>
* <li>{@link org.eclipse.app4mc.amalthea.generator.configuration.impl.IntegerDistributionImpl#getAvg <em>Avg</em>}</li>
* <li>{@link org.eclipse.app4mc.amalthea.generator.configuration.impl.IntegerDistributionImpl#getMax <em>Max</em>}</li>
* </ul>
*
* @generated
*/
public class IntegerDistributionImpl extends DistributionImpl implements IntegerDistribution {
/**
* The default value of the '{@link #getMin() <em>Min</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getMin()
* @generated
* @ordered
*/
protected static final long MIN_EDEFAULT = 0L;
/**
* The cached value of the '{@link #getMin() <em>Min</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getMin()
* @generated
* @ordered
*/
protected long 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 long AVG_EDEFAULT = 0L;
/**
* The cached value of the '{@link #getAvg() <em>Avg</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAvg()
* @generated
* @ordered
*/
protected long 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 long MAX_EDEFAULT = 0L;
/**
* The cached value of the '{@link #getMax() <em>Max</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getMax()
* @generated
* @ordered
*/
protected long max = MAX_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected IntegerDistributionImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return RTMGCPackage.Literals.INTEGER_DISTRIBUTION;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public long getMin() {
return min;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setMin(long newMin) {
long oldMin = min;
min = newMin;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, RTMGCPackage.INTEGER_DISTRIBUTION__MIN, oldMin, min));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public long getAvg() {
return avg;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setAvg(long newAvg) {
long oldAvg = avg;
avg = newAvg;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, RTMGCPackage.INTEGER_DISTRIBUTION__AVG, oldAvg, avg));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public long getMax() {
return max;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setMax(long newMax) {
long oldMax = max;
max = newMax;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, RTMGCPackage.INTEGER_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.INTEGER_DISTRIBUTION__MIN:
return getMin();
case RTMGCPackage.INTEGER_DISTRIBUTION__AVG:
return getAvg();
case RTMGCPackage.INTEGER_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.INTEGER_DISTRIBUTION__MIN:
setMin((Long)newValue);
return;
case RTMGCPackage.INTEGER_DISTRIBUTION__AVG:
setAvg((Long)newValue);
return;
case RTMGCPackage.INTEGER_DISTRIBUTION__MAX:
setMax((Long)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case RTMGCPackage.INTEGER_DISTRIBUTION__MIN:
setMin(MIN_EDEFAULT);
return;
case RTMGCPackage.INTEGER_DISTRIBUTION__AVG:
setAvg(AVG_EDEFAULT);
return;
case RTMGCPackage.INTEGER_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.INTEGER_DISTRIBUTION__MIN:
return min != MIN_EDEFAULT;
case RTMGCPackage.INTEGER_DISTRIBUTION__AVG:
return avg != AVG_EDEFAULT;
case RTMGCPackage.INTEGER_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();
}
} //IntegerDistributionImpl