Class KeyComparator<T,C extends java.lang.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:
java.util.Comparator<T>
@GwtCompatible public final class KeyComparator<T,C extends java.lang.Comparable<? super C>> extends java.lang.Object implements java.util.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 Constructor Description KeyComparator(Functions.Function1<? super T,C> keyFunction)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(T a, T b)
-
-
-
Constructor Detail
-
KeyComparator
public KeyComparator(Functions.Function1<? super T,C> keyFunction)
- Parameters:
keyFunction
- the key function to use for comparing objects. May not benull
-
-