org.eclipse.ohf.stem.diseasemodels.standard.impl
Class StandardDiseaseModelLabelValueImpl

java.lang.Object
  extended by org.eclipse.emf.common.notify.impl.BasicNotifierImpl
      extended by org.eclipse.emf.ecore.impl.BasicEObjectImpl
          extended by org.eclipse.emf.ecore.impl.EObjectImpl
              extended by org.eclipse.ohf.stem.core.graph.impl.LabelValueImpl
                  extended by org.eclipse.ohf.stem.diseasemodels.standard.impl.DiseaseModelLabelValueImpl
                      extended by org.eclipse.ohf.stem.diseasemodels.standard.impl.StandardDiseaseModelLabelValueImpl
All Implemented Interfaces:
org.eclipse.emf.common.notify.Notifier, org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.InternalEObject, SanityChecker, LabelValue, DiseaseModelLabelValue, StandardDiseaseModelLabelValue
Direct Known Subclasses:
SILabelValueImpl

public abstract class StandardDiseaseModelLabelValueImpl
extends DiseaseModelLabelValueImpl
implements StandardDiseaseModelLabelValue

An implementation of the model object 'Disease Model Label Value'.

The following features are implemented:


Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.emf.common.notify.impl.BasicNotifierImpl
org.eclipse.emf.common.notify.impl.BasicNotifierImpl.EAdapterList<E extends java.lang.Object & org.eclipse.emf.common.notify.Adapter>
 
Nested classes/interfaces inherited from interface org.eclipse.emf.ecore.InternalEObject
org.eclipse.emf.ecore.InternalEObject.EStore
 
Field Summary
 
Fields inherited from class org.eclipse.emf.ecore.impl.EObjectImpl
ELAST_EOBJECT_FLAG
 
Fields inherited from interface org.eclipse.emf.ecore.InternalEObject
EOPPOSITE_FEATURE_BASE
 
Constructor Summary
StandardDiseaseModelLabelValueImpl(double s, double births, double deaths, double diseaseDeaths)
          This is used to create instances for testing purposes.
 
Method Summary
 DiseaseModelLabelValue add(DiseaseModelLabelValue value)
           
abstract  StandardDiseaseModelLabelValue convertToSourceStates()
           
 java.lang.Object eGet(int featureID, boolean resolve, boolean coreType)
           
 boolean eIsSet(int featureID)
           
 void eSet(int featureID, java.lang.Object newValue)
           
 void eUnset(int featureID)
           
 double getPopulationCount()
           
 double getS()
           
 void reset()
           
 boolean sane()
          This method is for ongoing development and testing purposes.
 DiseaseModelLabelValue scale(double scaleFactor)
           
 DiseaseModelLabelValue set(DiseaseModelLabelValue value)
           
 void setS(double newS)
           
 DiseaseModelLabelValue sub(DiseaseModelLabelValue value)
           
 java.lang.String toString()
           
 void zeroOutPopulationCount()
           
 
Methods inherited from class org.eclipse.ohf.stem.diseasemodels.standard.impl.DiseaseModelLabelValueImpl
getBirths, getDeaths, getDiseaseDeaths, setBirths, setDeaths, setDiseaseDeaths
 
Methods inherited from class org.eclipse.emf.ecore.impl.EObjectImpl
eAdapters, eClass, eContainerFeatureID, eDeliver, eInternalContainer, eIsProxy, eSetClass, eSetDeliver, eSetProxyURI
 
Methods inherited from class org.eclipse.emf.ecore.impl.BasicEObjectImpl
eAllContents, eBaseStructuralFeatureID, eBasicRemoveFromContainer, eBasicRemoveFromContainerFeature, eBasicSetContainer, eContainer, eContainingFeature, eContainmentFeature, eContains, eContents, eCrossReferences, eDerivedStructuralFeatureID, eDerivedStructuralFeatureID, eDirectResource, eDynamicBasicRemoveFromContainer, eDynamicGet, eDynamicGet, eDynamicInverseAdd, eDynamicInverseRemove, eDynamicIsSet, eDynamicIsSet, eDynamicSet, eDynamicSet, eDynamicUnset, eDynamicUnset, eGet, eGet, eGet, eInternalResource, eInverseAdd, eInverseAdd, eInverseRemove, eInverseRemove, eIsSet, eObjectForURIFragmentSegment, eOpenGet, eOpenIsSet, eOpenSet, eOpenUnset, eProxyURI, eResolveProxy, eResource, eSet, eSetResource, eSetStore, eSetting, eStore, eUnset, eURIFragmentSegment, eVirtualGet, eVirtualGet, eVirtualIsSet, eVirtualSet, eVirtualUnset
 
Methods inherited from class org.eclipse.emf.common.notify.impl.BasicNotifierImpl
eNotificationRequired, eNotify
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.ohf.stem.diseasemodels.standard.DiseaseModelLabelValue
getBirths, getDeaths, getDiseaseDeaths, setBirths, setDeaths, setDiseaseDeaths
 
Methods inherited from interface org.eclipse.emf.ecore.EObject
eAllContents, eClass, eContainer, eContainingFeature, eContainmentFeature, eContents, eCrossReferences, eGet, eGet, eIsProxy, eIsSet, eResource, eSet, eUnset
 
Methods inherited from interface org.eclipse.emf.common.notify.Notifier
eAdapters, eDeliver, eNotify, eSetDeliver
 
Methods inherited from interface org.eclipse.emf.ecore.InternalEObject
eNotificationRequired
 

Constructor Detail

StandardDiseaseModelLabelValueImpl

public StandardDiseaseModelLabelValueImpl(double s,
                                          double births,
                                          double deaths,
                                          double diseaseDeaths)
This is used to create instances for testing purposes.

Parameters:
s - the number of susceptible population members
births - the number of births that have occured in the population
deaths - the total number of deaths that have occured in the population
diseaseDeaths - the number of deaths due to the disease that have occured in the population
Method Detail

getS

public double getS()

Specified by:
getS in interface StandardDiseaseModelLabelValue
Returns:

setS

public void setS(double newS)

Specified by:
setS in interface StandardDiseaseModelLabelValue
Parameters:
newS -
See Also:
StandardDiseaseModelLabelValue.getS()

convertToSourceStates

public abstract StandardDiseaseModelLabelValue convertToSourceStates()

Specified by:
convertToSourceStates in interface StandardDiseaseModelLabelValue
Returns:

getPopulationCount

public double getPopulationCount()
Description copied from class: DiseaseModelLabelValueImpl

Specified by:
getPopulationCount in interface DiseaseModelLabelValue
Specified by:
getPopulationCount in class DiseaseModelLabelValueImpl
Returns:
See Also:
DiseaseModelLabelValueImpl.getPopulationCount()

zeroOutPopulationCount

public void zeroOutPopulationCount()
Description copied from class: DiseaseModelLabelValueImpl

Specified by:
zeroOutPopulationCount in interface DiseaseModelLabelValue
Specified by:
zeroOutPopulationCount in class DiseaseModelLabelValueImpl

set

public DiseaseModelLabelValue set(DiseaseModelLabelValue value)
Description copied from class: DiseaseModelLabelValueImpl

Specified by:
set in interface DiseaseModelLabelValue
Overrides:
set in class DiseaseModelLabelValueImpl
Parameters:
value - the new value for this disease model value
Returns:
See Also:
DiseaseModelLabelValueImpl.set(org.eclipse.ohf.stem.diseasemodels.standard.DiseaseModelLabelValue)

add

public DiseaseModelLabelValue add(DiseaseModelLabelValue value)
Description copied from class: DiseaseModelLabelValueImpl

Specified by:
add in interface DiseaseModelLabelValue
Overrides:
add in class DiseaseModelLabelValueImpl
Parameters:
value - the value to be added to this disease model value
Returns:
See Also:
DiseaseModelLabelValueImpl.add(org.eclipse.ohf.stem.diseasemodels.standard.DiseaseModelLabelValue)

sub

public DiseaseModelLabelValue sub(DiseaseModelLabelValue value)
Description copied from class: DiseaseModelLabelValueImpl

Specified by:
sub in interface DiseaseModelLabelValue
Overrides:
sub in class DiseaseModelLabelValueImpl
Parameters:
value - the value to be added to this disease model value
Returns:
See Also:
DiseaseModelLabelValueImpl.sub(org.eclipse.ohf.stem.diseasemodels.standard.DiseaseModelLabelValue)

scale

public DiseaseModelLabelValue scale(double scaleFactor)
Description copied from class: DiseaseModelLabelValueImpl

Specified by:
scale in interface DiseaseModelLabelValue
Overrides:
scale in class DiseaseModelLabelValueImpl
Parameters:
scaleFactor - the mulitplier
Returns:
this instance with the new scaled values

reset

public void reset()
Description copied from class: LabelValueImpl

Specified by:
reset in interface LabelValue
Overrides:
reset in class DiseaseModelLabelValueImpl
See Also:
DiseaseModelLabelValueImpl.reset()

sane

public boolean sane()
Description copied from interface: SanityChecker
This method is for ongoing development and testing purposes. It performs a "self-check" on the instance of the class. The checking consists of combination of boolean tests and assertions using the Java "assert" facillity. Assertions must be enabled using the "-ea" JVM flag for the assertions to be enabled.

This method is intended to be overridden by extending sub-classes. These classes should first call the method in the super class (i.e., super.sane()) to ensure that the super class is "ok" and then it can issue its own assertions.

 void sane() {
        boolean retValue = super.sane();
 
        // If foo references bar, then bar should reference foo!
        retValue = retValue && (foo.a == bar && bar.a == foo);
        assert(retValue);
 
        return retValue;
 } // sane
 

The idiom retValue = retValue && <boolean test> followed by an assertion of the value of retValue is a typical pattern. If followed, then once a problem is detected, an assertion will be thrown, or the rest of the tests will be skipped and the value of false returned. By having sane return a value rather than simply relying upon the assert keyword sanity testing can occur even if assertions are not enabled.

The sane method should be called when the instance is known to be "stable" so the consistency checks should complete with no problems (if all is well).

Specified by:
sane in interface SanityChecker
Overrides:
sane in class DiseaseModelLabelValueImpl
Returns:
true
See Also:
DiseaseModelLabelValueImpl.sane()

eGet

public java.lang.Object eGet(int featureID,
                             boolean resolve,
                             boolean coreType)

Specified by:
eGet in interface org.eclipse.emf.ecore.InternalEObject
Overrides:
eGet in class DiseaseModelLabelValueImpl
Parameters:
featureID -
resolve -
coreType -
Returns:

eSet

public void eSet(int featureID,
                 java.lang.Object newValue)

Specified by:
eSet in interface org.eclipse.emf.ecore.InternalEObject
Overrides:
eSet in class DiseaseModelLabelValueImpl
Parameters:
featureID -
newValue -

eUnset

public void eUnset(int featureID)

Specified by:
eUnset in interface org.eclipse.emf.ecore.InternalEObject
Overrides:
eUnset in class DiseaseModelLabelValueImpl
Parameters:
featureID -

eIsSet

public boolean eIsSet(int featureID)

Specified by:
eIsSet in interface org.eclipse.emf.ecore.InternalEObject
Overrides:
eIsSet in class DiseaseModelLabelValueImpl
Parameters:
featureID -
Returns:

toString

public java.lang.String toString()

Overrides:
toString in class DiseaseModelLabelValueImpl
Returns: