org.jacoco.core.analysis

## Class NodeComparator

- java.lang.Object
- - org.jacoco.core.analysis.NodeComparator

All Implemented Interfaces:
  Serializable, Comparator<ICoverageNode>

    public class NodeComparator
    extends Object
    implements Comparator<ICoverageNode>, Serializable

Comparator to compare `ICoverageNode` objects by different counter criteria.

See Also:
  `CounterComparator.on(ICoverageNode.CounterEntity)`, Serialized Form

### Method Summary

All Methods Instance Methods Concrete Methods
`int` `compare(ICoverageNode n1, ICoverageNode n2)`
`NodeComparator` `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 of `ICoverageNode` 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

`comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong`

### Method Detail

#### second

    public NodeComparator second(Comparator<ICoverageNode> second)

Creates a new composite comparator with a second search criterion.

Parameters:
  `second` - second criterion comparator
Returns:
  composite comparator

#### sort

    public <T extends ICoverageNode> List<T> sort(Collection<T> summaries)

Returns a sorted copy of the given collection of `ICoverageNode` elements.

Type Parameters:
  `T` - actual type of the elements
Parameters:
  `summaries` - collection to create a copy of
Returns:
  sorted copy

#### compare

    public int compare(ICoverageNode n1,
                       ICoverageNode n2)

Specified by:
  `compare` in interface `Comparator<ICoverageNode>`