ronnie
2022-10-14 1504bb53e29d3d46222c0b3ea994fc494b48e153
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package jdiff;
 
import java.util.*;
 
/** 
 * Class to compare two ClassDiff objects.
 *
 * See the file LICENSE.txt for copyright details.
 * @author Matthew Doar, mdoar@pobox.com
 */
class CompareClassPdiffs implements Comparator {
    /** 
     * Compare two class diffs by their percentage difference,
     * and then by name.
     */
    public int compare(Object obj1, Object obj2){
        ClassDiff c1 = (ClassDiff)obj1;
        ClassDiff c2 = (ClassDiff)obj2;
        if (c1.pdiff < c2.pdiff)
            return 1;
        if (c1.pdiff > c2.pdiff)
            return -1;
        return c1.name_.compareTo(c2.name_);
    }
}