/Users/lyon/j4p/src/collections/sortable/ComparableMethod.java

1    package collections.sortable; 
2     
3    import java.lang.reflect.Method; 
4     
5    public class ComparableMethod 
6            implements Comparable2 { 
7        Method m; 
8        String s1 = this.toString(); 
9     
10       ComparableMethod(Method _m) { 
11           m = _m; 
12       } 
13    
14       public String toString() { 
15           return m + ""; 
16       } 
17    
18       public Method getMethod() { 
19           return m; 
20       } 
21    
22       public boolean equals(Object other) { 
23           return (s1.compareTo(other.toString()) == 0); 
24    
25       } 
26    
27       public int hashCode() { 
28           return s1.hashCode(); 
29       } 
30    
31       public boolean isLess(Object other) { 
32           return (s1.compareTo(other.toString()) < 0); 
33       } 
34    
35       public boolean isGreater(Object other) { 
36           return (s1.compareTo(other.toString()) > 0); 
37       } 
38    
39    
40   }