T - The type of objects being comparedpublic class InstanceComparator<T> extends Object implements Comparator<T>
Numbers such that Longs
occur before Integers.
Only the specified instanceOrder classes are considered during
comparison. If two objects are both instances of the ordered type this
comparator will return a 0. Consider combining with a
CompoundComparator if additional sorting is required.
CompoundComparator| 构造器和说明 |
|---|
InstanceComparator(Class<?>... instanceOrder)
Create a new
InstanceComparator instance. |
public InstanceComparator(Class<?>... instanceOrder)
InstanceComparator instance.instanceOrder - the ordered list of classes that should be used when
comparing objects. Classes earlier in the list will be be given a higher
priority.public int compare(T o1, T o2)
compare 在接口中 Comparator<T>Copyright © 2013 The Skfiy Open Association. All Rights Reserved.