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 CounterComparatorCompares the absolute number of covered items.static final CounterComparatorCompares the ratio of covered items.static final CounterComparatorCompares the absolute number of missed items.static final CounterComparatorCompares the ratio of missed items.private final booleanprivate static final longstatic final CounterComparatorCompares the absolute number of total items.private final ICounter.CounterValue -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateprivateCounterComparator(ICounter.CounterValue value, boolean reverse) -
Method Summary
Modifier and TypeMethodDescriptioninton(ICoverageNode.CounterEntity entity) Creates a new comparator forICoverageNodecounters 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 Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface 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:
comparein interfaceComparator<ICounter>
-
reverse
Creates a new version of this comparator that sorts in reverse order.- Returns:
- reverse comparator
-
on
Creates a new comparator forICoverageNodecounters of the given entity based on this counter sorting criteria.- Parameters:
entity- counter entity to sort on- Returns:
- comparator for
ICoverageNodeelements
-