org.eclipse.ohf.stem.diseasemodels.standard.provider
Class StandardRelativeValueProviderAdapterFactory.DiseaseModelLabelValueRelativeValueProvider

java.lang.Object
  extended by org.eclipse.emf.common.notify.impl.AdapterImpl
      extended by org.eclipse.ohf.stem.definitions.adapters.relativevalue.RelativeValueProviderAdapter
          extended by org.eclipse.ohf.stem.diseasemodels.standard.provider.StandardRelativeValueProviderAdapterFactory.DiseaseModelLabelValueRelativeValueProvider
All Implemented Interfaces:
org.eclipse.emf.common.notify.Adapter, org.eclipse.emf.common.notify.Adapter.Internal, RelativeValueProvider
Enclosing class:
StandardRelativeValueProviderAdapterFactory

public static class StandardRelativeValueProviderAdapterFactory.DiseaseModelLabelValueRelativeValueProvider
extends RelativeValueProviderAdapter
implements RelativeValueProvider

This class is a Relative Value Provider for DiseaseModelLabelValue instances. It provides a collection of the properites that can have relative values and will compute the value between 0.0 and 1.0 for any of those properties.

The StandardRelativeValueProviderAdapterFactory.DiseaseModelLabelValueRelativeValueProvider instance that we create here filters out the properties that are not relative and can reflectively compute the relative value, with respect to the population count for the disease model label value, for the remaining properties. If a new sub-class of DiseaseModelLabelValue is introduced that has other non-relative properties, they would not be filtered out by this RelativeValueProvider so a coresponding sub-class of StandardRelativeValueProviderAdapterFactory.DiseaseModelLabelValueRelativeValueProvider would need to be defined that implemented RelativeValueProvider.getProperties() such that it first called its super-class super.getProperties (i.e., getProperties()) to get the list of filtered properties. Then, it would need to remove any non-relative properties that it knows about from that list.

There would probably be no need for the new class to override getRelativeValue(EStructuralFeature) as the relative values are computed such that the new property values are obtained reflexively, so they should be found. This assumes that the new values are relative to the population count (i.e., DiseaseModelLabelValue.getPopulationCount()). If they're relative to some other value then an override would be necessary.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.emf.common.notify.Adapter
org.eclipse.emf.common.notify.Adapter.Internal
 
Constructor Summary
StandardRelativeValueProviderAdapterFactory.DiseaseModelLabelValueRelativeValueProvider()
           
 
Method Summary
 java.util.List<org.eclipse.emf.edit.provider.IItemPropertyDescriptor> getProperties()
           
 double getRelativeValue(org.eclipse.emf.ecore.EStructuralFeature feature)
          Determine the relative (0.0 to 1.0) value of the property as compared to the other properties.
 
Methods inherited from class org.eclipse.ohf.stem.definitions.adapters.relativevalue.RelativeValueProviderAdapter
getRelativeValue, isAdapterForType
 
Methods inherited from class org.eclipse.emf.common.notify.impl.AdapterImpl
getTarget, notifyChanged, setTarget, unsetTarget
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.ohf.stem.definitions.adapters.relativevalue.RelativeValueProvider
getRelativeValue
 

Constructor Detail

StandardRelativeValueProviderAdapterFactory.DiseaseModelLabelValueRelativeValueProvider

public StandardRelativeValueProviderAdapterFactory.DiseaseModelLabelValueRelativeValueProvider()
Method Detail

getProperties

public java.util.List<org.eclipse.emf.edit.provider.IItemPropertyDescriptor> getProperties()
Specified by:
getProperties in interface RelativeValueProvider
Specified by:
getProperties in class RelativeValueProviderAdapter
Returns:
the properties of the provider
See Also:
RelativeValueProviderAdapter.getProperties()

getRelativeValue

public double getRelativeValue(org.eclipse.emf.ecore.EStructuralFeature feature)
Description copied from interface: RelativeValueProvider
Determine the relative (0.0 to 1.0) value of the property as compared to the other properties.

Specified by:
getRelativeValue in interface RelativeValueProvider
Specified by:
getRelativeValue in class RelativeValueProviderAdapter
Parameters:
feature - feature of the property whose relative value is to be determined
Returns:
relative (0.0-1.0) value of the property as compared to the other properties.
See Also:
RelativeValueProvider.getRelativeValue(EStructuralFeature)