01: /*
02: * Created on Nov 26, 2003
03: *
04: * To change the template for this generated file go to
05: * Window>Preferences>Java>Code Generation>Code and Comments
06: */
07: package org.hammurapi.inspectors.metrics.callertrace;
08:
09: import java.util.Comparator;
10:
11: /**
12: * @author mucbj0
13: *
14: * To change the template for this generated type comment go to
15: * Window>Preferences>Java>Code Generation>Code and Comments
16: */
17: public class TracedMethodLocComparator implements Comparator {
18:
19: /*
20: * (non-Javadoc)
21: *
22: * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
23: */
24: public int compare(Object o1, Object o2) {
25: MethodWrapper m1 = (MethodWrapper) o1;
26: MethodWrapper m2 = (MethodWrapper) o2;
27: if (m1.getLine() > m2.getLine()) {
28: return 1;
29: } else if (m1.getLine() < m2.getLine()) {
30: return -1;
31: } else if (m1.getLine() == m2.getLine()) {
32: return 0;
33: }
34:
35: return 0;
36: }
37:
38: }
|