Package org.jacoco.core.analysis
Class CounterComparator
java.lang.Object
org.jacoco.core.analysis.CounterComparator
- All Implemented Interfaces:
Serializable
,Comparator<ICounter>
Collection of comparators to compare
ICounter
objects by different
criteria.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final CounterComparator
Compares the absolute number of covered items.static final CounterComparator
Compares the ratio of covered items.static final CounterComparator
Compares the absolute number of missed items.static final CounterComparator
Compares the ratio of missed items.private final boolean
private static final long
static final CounterComparator
Compares the absolute number of total items.private final ICounter.CounterValue
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
private
CounterComparator
(ICounter.CounterValue value, boolean reverse) -
Method Summary
Modifier and TypeMethodDescriptionint
on
(ICoverageNode.CounterEntity entity) Creates a new comparator forICoverageNode
counters of the given entity based on this counter sorting criteria.reverse()
Creates a new version of this comparator that sorts in reverse order.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
TOTALITEMS
Compares the absolute number of total items. -
COVEREDITEMS
Compares the absolute number of covered items. -
MISSEDITEMS
Compares the absolute number of missed items. -
COVEREDRATIO
Compares the ratio of covered items. -
MISSEDRATIO
Compares the ratio of missed items. -
value
-
reverse
private final boolean reverse
-
-
Constructor Details
-
CounterComparator
-
CounterComparator
-
-
Method Details
-
compare
- Specified by:
compare
in interfaceComparator<ICounter>
-
reverse
Creates a new version of this comparator that sorts in reverse order.- Returns:
- reverse comparator
-
on
Creates a new comparator forICoverageNode
counters of the given entity based on this counter sorting criteria.- Parameters:
entity
- counter entity to sort on- Returns:
- comparator for
ICoverageNode
elements
-