blob: 831e9ce06056b96e9d85431fcc8c32d50c0efa31 [file] [log] [blame]
package org.eclipse.stem.diseasemodels.standard.impl;
/*******************************************************************************
* Copyright (c) 2006 IBM Corporation 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
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.stem.core.graph.IntegrationLabelValue;
import org.eclipse.stem.core.graph.LabelValue;
import org.eclipse.stem.diseasemodels.standard.DiseaseModelLabelValue;
import org.eclipse.stem.diseasemodels.standard.SEIRLabelValue;
import org.eclipse.stem.diseasemodels.standard.StandardPackage;
/**
* <!-- begin-user-doc --> An implementation of the model object '
* <em><b>SEIR Label Value</b></em>'. <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.stem.diseasemodels.standard.impl.SEIRLabelValueImpl#getE <em>E</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class SEIRLabelValueImpl extends SIRLabelValueImpl implements
SEIRLabelValue {
/**
* The default value of the '{@link #getE() <em>E</em>}' attribute. <!--
* begin-user-doc --> <!-- end-user-doc -->
*
* @see #getE()
* @generated
* @ordered
*/
protected static final double E_EDEFAULT = 0.0;
/**
* The cached value of the '{@link #getE() <em>E</em>}' attribute. <!--
* begin-user-doc --> <!-- end-user-doc -->
*
* @see #getE()
* @generated
* @ordered
*/
protected double e = E_EDEFAULT;
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
protected SEIRLabelValueImpl() {
super();
}
/**
* <!-- begin-user-doc -->
*
* This is used to create instances for testing purposes.
*
* @param s
* the number of susceptible population members
* @param e
* the number of exposed population members
* @param iR
* the number of recovering infectious population members
* @param iF
* the number of fatally infectious population members
*
* @param incidence
* the new incidence from the interaction term in the compartment
* model
*
* @param r
* the number of recovered population members
* @param births
* the number of births that have occurred in the population
* @param deaths
* the total number of deaths that have occurred in the
* population
* @param diseaseDeaths
* the number of deaths due to the disease that have occurred in
* the population
*
* <!-- end-user-doc -->
*/
public SEIRLabelValueImpl(final double s, final double e, final double i,
double incidence, final double r, final double diseaseDeaths) {
super(s, i, incidence, r, diseaseDeaths);
this.setE(e);
} // SEIRLabelValueImpl
/**
* <!-- begin-user-doc -->
*
* This is used to create instances for testing purposes.
*
* @param s
* the number of susceptible population members
* @param e
* the number of exposed population members
* @param iR
* the number of recovering infectious population members
* @param iF
* the number of fatally infectious population members
*
* @param r
* the number of recovered population members
* @param births
* the number of births that have occurred in the population
* @param deaths
* the total number of deaths that have occurred in the
* population
* @param diseaseDeaths
* the number of deaths due to the disease that have occurred in
* the population
*
* <!-- end-user-doc -->
*/
public SEIRLabelValueImpl(final double s, final double e, final double i,
final double r, final double diseaseDeaths) {
super(s, i, 0.0, r, diseaseDeaths);
this.setE(e);
} // SEIRLabelValueImpl
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return StandardPackage.Literals.SEIR_LABEL_VALUE;
}
/**
* <!-- begin-user-doc -->
*
* @return
*
* <!-- end-user-doc -->
* @generated
*/
public double getE() {
return e;
}
/**
* <!-- begin-user-doc -->
*
* @param newE
*
* <!-- end-user-doc -->
* @generated
*/
public void setE(double newE) {
double oldE = e;
e = newE;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, StandardPackage.SEIR_LABEL_VALUE__E, oldE, e));
}
/**
* <!-- begin-user-doc -->
*
* @param featureID
* @param resolve
* @param coreType
* @return
*
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case StandardPackage.SEIR_LABEL_VALUE__E:
return getE();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
*
* @param featureID
* @param newValue
*
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case StandardPackage.SEIR_LABEL_VALUE__E:
setE((Double)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
*
* @param featureID
*
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case StandardPackage.SEIR_LABEL_VALUE__E:
setE(E_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
*
* @param featureID
* @return
*
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case StandardPackage.SEIR_LABEL_VALUE__E:
return e != E_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(" (e: "); //$NON-NLS-1$
result.append(e);
result.append(')');
return result.toString();
}
} // SEIRLabelValueImpl