net.sourceforge.pebble.comparator
Class CountedUrlByCountComparator

java.lang.Object
  extended by net.sourceforge.pebble.comparator.CountedUrlByCountComparator
All Implemented Interfaces:
java.util.Comparator<CountedUrl>

public class CountedUrlByCountComparator
extends java.lang.Object
implements java.util.Comparator<CountedUrl>

A comparator used to order CountedUrl instances, in reverse order of the count, and then alphabetically if instances have the same count.

Author:
Simon Brown

Constructor Summary
CountedUrlByCountComparator()
           
 
Method Summary
 int compare(CountedUrl c1, CountedUrl c2)
          Compares two objects.
 
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

CountedUrlByCountComparator

public CountedUrlByCountComparator()
Method Detail

compare

public int compare(CountedUrl c1,
                   CountedUrl c2)
Compares two objects.

Specified by:
compare in interface java.util.Comparator<CountedUrl>
Parameters:
c1 - object 1
c2 - object 2
Returns:
-n, 0 or +n if the count of the second visited URL is less than, the same as or greater than the first, respectively. However, if the counts are the same, then -n, 0 or +n is returned if the name of the first is less than, the same as or greater than the second


Copyright © 2003-2006, Simon Brown. All Rights Reserved.