org.jacoco.core.analysis
Class CounterComparator

java.lang.Object
  extended by org.jacoco.core.analysis.CounterComparator
All Implemented Interfaces:
Serializable, Comparator<ICounter>

public class CounterComparator
extends Object
implements Comparator<ICounter>, Serializable

Collection of comparators to compare ICounter objects by different criteria.

See Also:
Serialized Form

Field Summary
static CounterComparator COVEREDITEMS
          Compares the absolute number of covered items.
static CounterComparator COVEREDRATIO
          Compares the ratio of covered items.
static CounterComparator MISSEDITEMS
          Compares the absolute number of missed items.
static CounterComparator MISSEDRATIO
          Compares the ratio of missed items.
static CounterComparator TOTALITEMS
          Compares the absolute number of total items.
 
Method Summary
 int compare(ICounter c1, ICounter c2)
           
 NodeComparator on(ICoverageNode.CounterEntity entity)
          Creates a new comparator for ICoverageNode counters of the given entity based on this counter sorting criteria.
 CounterComparator 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
 

Field Detail

TOTALITEMS

public static final CounterComparator TOTALITEMS
Compares the absolute number of total items.


COVEREDITEMS

public static final CounterComparator COVEREDITEMS
Compares the absolute number of covered items.


MISSEDITEMS

public static final CounterComparator MISSEDITEMS
Compares the absolute number of missed items.


COVEREDRATIO

public static final CounterComparator COVEREDRATIO
Compares the ratio of covered items.


MISSEDRATIO

public static final CounterComparator MISSEDRATIO
Compares the ratio of missed items.

Method Detail

compare

public int compare(ICounter c1,
                   ICounter c2)
Specified by:
compare in interface Comparator<ICounter>

reverse

public CounterComparator reverse()
Creates a new version of this comparator that sorts in reverse order.

Returns:
reverse comparator

on

public NodeComparator on(ICoverageNode.CounterEntity entity)
Creates a new comparator for ICoverageNode counters of the given entity based on this counter sorting criteria.

Parameters:
entity - counter entity to sort on
Returns:
comparator for ICoverageNode elements


Copyright © 2009–2024 Mountainminds GmbH & Co. KG. All rights reserved.