Class AbstractRatioMetric

All Implemented Interfaces:
IMetric
Direct Known Subclasses:
Abstractness, AdherenceToInterfaceCommunication, ConfigurableRatioMetric, Coupling

public abstract class AbstractRatioMetric extends AbstractComposedMetric implements IMetric
A metric which computes itself by dividing a nominator metric by a denominator metric
  • Constructor Details

    • AbstractRatioMetric

      public AbstractRatioMetric()
  • Method Details

    • getChildMetrics

      protected IMetric[] getChildMetrics(Map<MetricID,IMetric> allMetrics)
      Description copied from class: AbstractComposedMetric
      In a subclass override this method and return the subset of metrics in allMetrics which are needed in this composed metric.
      Specified by:
      getChildMetrics in class AbstractComposedMetric
      Parameters:
      allMetrics - The set of all metrics registered in the system via the metric extension point
      Returns:
      The subset of all metrics needed in this composed metric
    • getNumeratorMetricID

      protected abstract MetricID getNumeratorMetricID()
    • getDenominatorMetricID

      protected abstract MetricID getDenominatorMetricID()
    • getCompositionFunction

      protected ICompositionFunction getCompositionFunction(SoMoXConfiguration somoxConfiguration)
      Description copied from class: AbstractComposedMetric
      Return the function used to compose the set of child metrics
      Specified by:
      getCompositionFunction in class AbstractComposedMetric
      Parameters:
      somoxConfiguration - The somox configuration object used to initialize the function
      Returns:
      The function used to compute the composed metric
    • isNormalised

      public boolean isNormalised()
      Specified by:
      isNormalised in interface IMetric
      Returns:
      whether the metric is normalized. If it is normalized, values of this metric must be between 0.0 and 1.0.
    • isCommutative

      public boolean isCommutative()
      Specified by:
      isCommutative in interface IMetric
      Overrides:
      isCommutative in class AbstractComposedMetric
      Returns:
      true if the metric gives the same result if firstComponent and secondComponent are swapped