T - 操作数的类型和运算符的结果
@FunctionalInterface public interface BinaryOperator<T> extends BiFunction<T,T,T>
BiFunction的专业化 。
这是一个functional interface的功能方法是BiFunction.apply(Object, Object) 。
BiFunction , UnaryOperator
| Modifier and Type | Method and Description |
|---|---|
static <T> BinaryOperator<T> |
maxBy(Comparator<? super T> comparator)
返回一个 BinaryOperator ,它根据指定的Comparator返回两个元素中的较大Comparator 。
|
static <T> BinaryOperator<T> |
minBy(Comparator<? super T> comparator)
返回 BinaryOperator返回根据指定的两个元件的较小的Comparator 。
|
andThen, applystatic <T> BinaryOperator<T> minBy(Comparator<? super T> comparator)
BinaryOperator返回根据指定的两个元件的较小的Comparator 。
T - 比较器的输入参数的类型
comparator - a
Comparator用于比较两个值
BinaryOperator返回其操作数中的较小者,根据所供给的
Comparator
NullPointerException - 如果参数为空
static <T> BinaryOperator<T> maxBy(Comparator<? super T> comparator)
BinaryOperator返回根据指定的两个元件的更大的Comparator 。
T - 比较器输入参数的类型
comparator - a
Comparator用于比较两个值
BinaryOperator ,返回其操作数的较大值,根据提供的
Comparator
NullPointerException - 如果参数为空
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.