Package org.jacoco.core.analysis
Class NodeComparator
java.lang.Object
org.jacoco.core.analysis.NodeComparator
- All Implemented Interfaces:
Serializable
,Comparator<ICoverageNode>
Comparator to compare
ICoverageNode
objects by different counter
criteria.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Comparator
<ICounter> private final ICoverageNode.CounterEntity
private static final long
-
Constructor Summary
ConstructorsConstructorDescriptionNodeComparator
(Comparator<ICounter> counterComparator, ICoverageNode.CounterEntity entity) -
Method Summary
Modifier and TypeMethodDescriptionint
compare
(ICoverageNode n1, ICoverageNode n2) second
(Comparator<ICoverageNode> second) Creates a new composite comparator with a second search criterion.<T extends ICoverageNode>
List<T> sort
(Collection<T> summaries) Returns a sorted copy of the given collection ofICoverageNode
elements.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:
-
counterComparator
-
entity
-
-
Constructor Details
-
NodeComparator
NodeComparator(Comparator<ICounter> counterComparator, ICoverageNode.CounterEntity entity)
-
-
Method Details
-
second
Creates a new composite comparator with a second search criterion.- Parameters:
second
- second criterion comparator- Returns:
- composite comparator
-
sort
Returns a sorted copy of the given collection ofICoverageNode
elements.- Type Parameters:
T
- actual type of the elements- Parameters:
summaries
- collection to create a copy of- Returns:
- sorted copy
-
compare
- Specified by:
compare
in interfaceComparator<ICoverageNode>
-