Serializable
, Comparator<T>
, SerializableComparator<T>
public class FunctionComparator<T,V> extends Object implements SerializableComparator<T>
Comparator
that uses a Function
to select a value from the underlying object and compare it against a known value to determine ordering.Constructor | Description |
---|---|
FunctionComparator(Function<? super T,? extends V> function,
Comparator<V> comparator) |
Modifier and Type | Method | Description |
---|---|---|
int |
compare(T o1,
T o2) |
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public FunctionComparator(Function<? super T,? extends V> function, Comparator<V> comparator)
public int compare(T o1, T o2)
compare
in interface Comparator<T>
Copyright © 2004–2019. All rights reserved.