org.squirrelframework.foundation.util
Class ClassComparator<T>

java.lang.Object
  extended by org.squirrelframework.foundation.util.ClassComparator<T>
Type Parameters:
T - type of object to compare
All Implemented Interfaces:
Serializable, Comparator<T>

public class ClassComparator<T>
extends Object
implements Comparator<T>, Serializable

Orders classes by assignability, with closest types ordered first.

Author:
Henry.He
See Also:
Serialized Form

Constructor Summary
ClassComparator()
           
 
Method Summary
 int compare(T o1, T o2)
           
 boolean isComparable(Class<?> c1, Class<?> c2)
           
 
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
 

Constructor Detail

ClassComparator

public ClassComparator()
Method Detail

compare

public int compare(T o1,
                   T o2)
Specified by:
compare in interface Comparator<T>

isComparable

public boolean isComparable(Class<?> c1,
                            Class<?> c2)


Copyright © 2013-2014. All Rights Reserved.