1 23 24 29 30 31 package com.sun.appserv.management.util.misc; 32 33 import java.lang.reflect.Method ; 34 35 38 public final class MethodComparator implements java.util.Comparator <Method > 39 { 40 public static final MethodComparator INSTANCE = new MethodComparator(); 41 42 private MethodComparator() {} 43 44 public int 45 compare( Method m1, Method m2 ) 46 { 47 int result = m1.getName().compareTo( m2.getName() ); 48 if ( result == 0 ) 49 { 50 result = m1.toString().compareTo( m2.toString() ); 51 } 52 53 return( result ); 54 } 55 56 public boolean 57 equals( Object other ) 58 { 59 return( other instanceof MethodComparator ); 60 } 61 } 62 63 64 65 66 67 | Popular Tags |