Package org.faktorips.util.collections
Class DistinctElementComparator<T>
java.lang.Object
org.faktorips.util.collections.DistinctElementComparator<T>
- All Implemented Interfaces:
Serializable,Comparator<Collection<T>>
public class DistinctElementComparator<T>
extends Object
implements Comparator<Collection<T>>, Serializable
Compares two collections by sorting the content using the element comparator and then compare one
element after the other. If a collection contains duplicated entries these duplicates will be
removed.
If you need to compare two lists with specific order and duplicated values you may better use
ListComparator- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcompare(Collection<T> o1, Collection<T> o2) static <T> DistinctElementComparator<T> createComparator(Comparator<T> elementComparator) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
DistinctElementComparator
-
-
Method Details
-
createComparator
-
compare
- Specified by:
comparein interfaceComparator<T>
-