jodd.util
Class MultipleComparator<T>

java.lang.Object
  extended by 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.


Field Summary
protected  List<Comparator<T>> comparators
           
 
Constructor Summary
MultipleComparator(List<Comparator<T>> 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
 
Methods inherited from interface java.util.Comparator
equals
 

Field Detail

comparators

protected final List<Comparator<T>> comparators
Constructor Detail

MultipleComparator

public MultipleComparator(List<Comparator<T>> comparators)
Method Detail

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>