echopointng.util.reflect
Class ReflectionKit.MethodComparator
java.lang.Object
echopointng.util.reflect.ReflectionKit.MethodComparator
- All Implemented Interfaces:
- java.util.Comparator
- Direct Known Subclasses:
- ReflectionKit.ClassMethodComparator
- Enclosing class:
- ReflectionKit
public static class ReflectionKit.MethodComparator
- extends java.lang.Object
- implements java.util.Comparator
A Comparator that can be used when comparing and sorting
Method objects by name, modifier and parameter liist order. If they
end the same after that they are sorted in declaring class order
with the most specific class first.
In short it sorts in "Method / Class" order.
|
Method Summary |
int |
compare(java.lang.Object o1,
java.lang.Object o2)
|
protected int |
compareNonNullMethods(java.lang.reflect.Method m1,
java.lang.reflect.Method m2)
Compares 2 non null Methods according to name, modifier and parameter
types. |
| 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 |
ReflectionKit.MethodComparator
public ReflectionKit.MethodComparator()
compare
public int compare(java.lang.Object o1,
java.lang.Object o2)
- Specified by:
compare in interface java.util.Comparator
compareNonNullMethods
protected int compareNonNullMethods(java.lang.reflect.Method m1,
java.lang.reflect.Method m2)
- Compares 2 non null Methods according to name, modifier and parameter
types.
- Parameters:
m1 - - the first methodm2 - - the second method
- Returns:
- -1, 0 or 1 according to Comparator