Class AbstractRatioMetric
java.lang.Object
org.somox.metrics.abstractmetrics.AbstractMetric
org.somox.metrics.abstractmetrics.AbstractComposedMetric
org.somox.metrics.abstractmetrics.AbstractRatioMetric
- All Implemented Interfaces:
IMetric
- Direct Known Subclasses:
Abstractness,AdherenceToInterfaceCommunication,ConfigurableRatioMetric,Coupling
A metric which computes itself by dividing a nominator metric by a
denominator metric
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected IMetric[]getChildMetrics(Map<MetricID, IMetric> allMetrics) In a subclass override this method and return the subset of metrics in allMetrics which are needed in this composed metric.protected ICompositionFunctiongetCompositionFunction(SoMoXConfiguration somoxConfiguration) Return the function used to compose the set of child metricsprotected abstract MetricIDprotected abstract MetricIDbooleanbooleanMethods inherited from class org.somox.metrics.abstractmetrics.AbstractComposedMetric
getAllChildMetrics, initialize, internalComputeDirected, metricIDToIMetricMethods inherited from class org.somox.metrics.abstractmetrics.AbstractMetric
calculateUnion, calculateUnion, checkMetricPostCondition, checkMetricPreCondition, computeDirected, getAccessGraphCache, getComponentToClassHelper, getLaunchConfigurationTab, getMetric, getMetricParametersMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.somox.metrics.IMetric
computeDirected, getLaunchConfigurationTab, getMetricParameters, getMID, initialize
-
Constructor Details
-
AbstractRatioMetric
public AbstractRatioMetric()
-
-
Method Details
-
getChildMetrics
Description copied from class:AbstractComposedMetricIn a subclass override this method and return the subset of metrics in allMetrics which are needed in this composed metric.- Specified by:
getChildMetricsin classAbstractComposedMetric- 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
-
getDenominatorMetricID
-
getCompositionFunction
Description copied from class:AbstractComposedMetricReturn the function used to compose the set of child metrics- Specified by:
getCompositionFunctionin classAbstractComposedMetric- 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:
isNormalisedin interfaceIMetric- 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:
isCommutativein interfaceIMetric- Overrides:
isCommutativein classAbstractComposedMetric- Returns:
- true if the metric gives the same result if firstComponent and secondComponent are swapped
-