Module org.eclipse.xtext.xbase.lib
Class KeyComparator<T,C extends Comparable<? super C>>
java.lang.Object
org.eclipse.xtext.xbase.lib.internal.KeyComparator<T,C>
- Type Parameters:
T- the type to compareC- the type of the comparable key
- All Implemented Interfaces:
Comparator<T>
@GwtCompatible
public final class KeyComparator<T,C extends Comparable<? super C>>
extends Object
implements Comparator<T>
A comparator that compares objects by calling the supplied key function on them and then comparing the resulting
keys. It is null-safe if the key's compareTo method is null-safe.
-
Constructor Summary
Constructors -
Method Summary
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
-
KeyComparator
- Parameters:
keyFunction- the key function to use for comparing objects. May not benull
-
-
Method Details
-
compare
- Specified by:
comparein interfaceComparator<T>
-