org.apache.mahout.fpm.pfpgrowth
Class CountDescendingPairComparator<A extends Comparable<? super A>,B extends Comparable<? super B>>

java.lang.Object
  extended by org.apache.mahout.fpm.pfpgrowth.CountDescendingPairComparator<A,B>
All Implemented Interfaces:
Serializable, Comparator<Pair<A,B>>

public final class CountDescendingPairComparator<A extends Comparable<? super A>,B extends Comparable<? super B>>
extends Object
implements Comparator<Pair<A,B>>, Serializable

Defines an ordering on Pairs whose second element is a count. The ordering places those with high count first (that is, descending), and for those of equal count, orders by the first element in the pair, ascending. It is used in several places in the FPM code.

See Also:
Serialized Form

Constructor Summary
CountDescendingPairComparator()
           
 
Method Summary
 int compare(Pair<A,B> a, Pair<A,B> b)
           
 
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
 

Constructor Detail

CountDescendingPairComparator

public CountDescendingPairComparator()
Method Detail

compare

public int compare(Pair<A,B> a,
                   Pair<A,B> b)
Specified by:
compare in interface Comparator<Pair<A extends Comparable<? super A>,B extends Comparable<? super B>>>


Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.