Interface BinaryOperatorX<T>
- Type Parameters:
T- 参数和返回值类型
- All Superinterfaces:
BiFunction<T,,T, T> BinaryOperator<T>,Serializable
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
BinaryOperatorX
- Since:
- Java 17+
- Author:
- Kimi Liu
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault TApplies this function to the given arguments.Applies this function to the given arguments.static <T> BinaryOperatorX<T> just afterstatic <T> BinaryOperatorX<T> just beforestatic <T> BinaryOperatorX<T> maxBy(Comparator<? super T> comparator) Returns aBinaryOperatorXwhich returns the greater of two elements according to the specifiedComparator.static <T> BinaryOperatorX<T> minBy(Comparator<? super T> comparator) Returns aBinaryOperatorXwhich returns the lesser of two elements according to the specifiedComparator.Methods inherited from interface java.util.function.BiFunction
andThen
-
Method Details
-
minBy
Returns aBinaryOperatorXwhich returns the lesser of two elements according to the specifiedComparator.- Type Parameters:
T- the type of the input arguments of the compare- Parameters:
comparator- aComparatorfor comparing the two values- Returns:
- a
SerBiUnOpwhich returns the lesser of its operands, according to the suppliedComparator - Throws:
NullPointerException- if the argument is null
-
maxBy
Returns aBinaryOperatorXwhich returns the greater of two elements according to the specifiedComparator.- Type Parameters:
T- the type of the input arguments of the compare- Parameters:
comparator- aComparatorfor comparing the two values- Returns:
- a
SerBiUnOpwhich returns the greater of its operands, according to the suppliedComparator - Throws:
NullPointerException- if the argument is null
-
justBefore
just before- Type Parameters:
T- type- Returns:
- before
-
justAfter
just after- Type Parameters:
T- type- Returns:
- after
-
applying
Applies this function to the given arguments. -
apply
Applies this function to the given arguments.- Specified by:
applyin interfaceBiFunction<T,T, T> - Parameters:
t- the first function argumentu- the second function argument- Returns:
- the function result
-