jodd.util
Class MultipleComparator<T>
java.lang.Object
jodd.util.MultipleComparator<T>
- All Implemented Interfaces:
- Comparator<T>
public class MultipleComparator<T>
- extends Object
- implements Comparator<T>
Multiple comparators compares using list of comparators.
Method Summary |
int |
compare(T o1,
T o2)
Compares two objects starting with first comparator; if they are equals
proceeds to the next comparator and so on. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
comparators
protected final List<Comparator<T>> comparators
MultipleComparator
public MultipleComparator(List<Comparator<T>> comparators)
compare
public int compare(T o1,
T o2)
- Compares two objects starting with first comparator; if they are equals
proceeds to the next comparator and so on.
- Specified by:
compare
in interface Comparator<T>