Lines Matching refs:comparator
51 * @param <T> the type of the input arguments of the comparator
52 * @param comparator a {@code Comparator} for comparing the two values
57 public static <T> BinaryOperator<T> minBy(Comparator<? super T> comparator) {
58 Objects.requireNonNull(comparator);
59 return (a, b) -> comparator.compare(a, b) <= 0 ? a : b;
66 * @param <T> the type of the input arguments of the comparator
67 * @param comparator a {@code Comparator} for comparing the two values
72 public static <T> BinaryOperator<T> maxBy(Comparator<? super T> comparator) {
73 Objects.requireNonNull(comparator);
74 return (a, b) -> comparator.compare(a, b) >= 0 ? a : b;