Class FractionValue
java.lang.Object
com.parasoft.findings.jenkins.coverage.model.Value
com.parasoft.findings.jenkins.coverage.model.FractionValue
- All Implemented Interfaces:
Serializable
Represents the value of a rational number based metric. Internally the rational number is stored using a
Fraction instance.- Author:
- Ullrich Hafner
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionFractionValue(Metric metric, int numerator, int denominator) Creates a newFractionValuefrom the specified counters for the given metric.FractionValue(Metric metric, org.apache.commons.lang3.math.Fraction fraction) Creates a newFractionValuewith the specified value for the given metric. -
Method Summary
Modifier and TypeMethodDescriptionAdd the coverage from the specified instance to the coverage of this instance.org.apache.commons.lang3.math.FractionComputes the delta of this value with the specified value.booleanorg.apache.commons.lang3.math.FractioninthashCode()booleanisOutOfValidRange(double threshold) Returns whether this fraction is out of the valid range.Merge this coverage with the specified coverage.Serializes this instance into a String.toString()
-
Constructor Details
-
FractionValue
Creates a newFractionValuewith the specified value for the given metric.- Parameters:
metric- the coverage metricfraction- the value to store
-
FractionValue
Creates a newFractionValuefrom the specified counters for the given metric.- Parameters:
metric- the coverage metricnumerator- the numerator of the rational numberdenominator- the denominator of the rational number
-
-
Method Details
-
getFraction
public org.apache.commons.lang3.math.Fraction getFraction() -
add
Description copied from class:ValueAdd the coverage from the specified instance to the coverage of this instance. -
delta
Description copied from class:ValueComputes the delta of this value with the specified value. -
max
Description copied from class:ValueMerge this coverage with the specified coverage. -
isOutOfValidRange
public boolean isOutOfValidRange(double threshold) Returns whether this fraction is out of the valid range. For values that have a metric that is getting better when values are increasing (e.g., coverage), the method will returntrueif the fraction value is smaller than the threshold. For values that have a metric that is getting better when values are decreasing (e.g., complexity), the method will returntrueif the fraction value is larger than the threshold.- Specified by:
isOutOfValidRangein classValue- Parameters:
threshold- the threshold to compare with- Returns:
true, if this value is larger or smaller than specified threshold (seeMetric.MetricTendency)
-
toString
-
serialize
Description copied from class:ValueSerializes this instance into a String. -
equals
-
hashCode
public int hashCode()
-