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.

@FunctionalInterface public interface BinaryOperatorX<T> extends BinaryOperator<T>, Serializable
BinaryOperatorX
Since:
Java 17+
Author:
Kimi Liu
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    default T
    apply(T t, T u)
    Applies this function to the given arguments.
    applying(T t, T u)
    Applies this function to the given arguments.
    static <T> BinaryOperatorX<T>
    just after
    static <T> BinaryOperatorX<T>
    just before
    static <T> BinaryOperatorX<T>
    maxBy(Comparator<? super T> comparator)
    Returns a BinaryOperatorX which returns the greater of two elements according to the specified Comparator.
    static <T> BinaryOperatorX<T>
    minBy(Comparator<? super T> comparator)
    Returns a BinaryOperatorX which returns the lesser of two elements according to the specified Comparator.

    Methods inherited from interface java.util.function.BiFunction

    andThen
  • Method Details

    • minBy

      static <T> BinaryOperatorX<T> minBy(Comparator<? super T> comparator)
      Returns a BinaryOperatorX which returns the lesser of two elements according to the specified Comparator.
      Type Parameters:
      T - the type of the input arguments of the compare
      Parameters:
      comparator - a Comparator for comparing the two values
      Returns:
      a SerBiUnOp which returns the lesser of its operands, according to the supplied Comparator
      Throws:
      NullPointerException - if the argument is null
    • maxBy

      static <T> BinaryOperatorX<T> maxBy(Comparator<? super T> comparator)
      Returns a BinaryOperatorX which returns the greater of two elements according to the specified Comparator.
      Type Parameters:
      T - the type of the input arguments of the compare
      Parameters:
      comparator - a Comparator for comparing the two values
      Returns:
      a SerBiUnOp which returns the greater of its operands, according to the supplied Comparator
      Throws:
      NullPointerException - if the argument is null
    • justBefore

      static <T> BinaryOperatorX<T> justBefore()
      just before
      Type Parameters:
      T - type
      Returns:
      before
    • justAfter

      static <T> BinaryOperatorX<T> justAfter()
      just after
      Type Parameters:
      T - type
      Returns:
      after
    • applying

      T applying(T t, T u) throws Throwable
      Applies this function to the given arguments.
      Parameters:
      t - the first function argument
      u - the second function argument
      Returns:
      the function result
      Throws:
      Exception - wrapped checked exception
      Throwable
    • apply

      default T apply(T t, T u)
      Applies this function to the given arguments.
      Specified by:
      apply in interface BiFunction<T,T,T>
      Parameters:
      t - the first function argument
      u - the second function argument
      Returns:
      the function result