Interface IOBinaryOperator<T>

  • Type Parameters:
    T - the type of the operands and result of the operator
    All Superinterfaces:
    IOBiFunction<T,​T,​T>
    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 IOBinaryOperator<T>
    extends IOBiFunction<T,​T,​T>
    Represents an operation upon two operands of the same type, producing a result of the same type as the operands. This is a specialization of IOBiFunction for the case where the operands and the result are all of the same type.

    This interface is similar to BinaryOperator except that it is allowed to throw an IOException.

    Author:
    Magno N A Cruz
    See Also:
    IOBiFunction, IOUnaryOperator
    • Method Summary

      Static Methods 
      Modifier and Type Method Description
      static <T> IOBinaryOperator<T> maxBy​(java.util.Comparator<? super T> comparator)
      This method is the same as BinaryOperator.maxBy(Comparator), but with a support for IOException.
      static <T> IOBinaryOperator<T> minBy​(java.util.Comparator<? super T> comparator)
      This method is the same as BinaryOperator.minBy(Comparator), but with a support for IOException.
    • Method Detail

      • minBy

        static <T> IOBinaryOperator<T> minBy​(@Nonnull
                                             java.util.Comparator<? super T> comparator)
                                      throws java.io.IOException

        This method is the same as BinaryOperator.minBy(Comparator), but with a support for IOException.

        Type Parameters:
        T - The type of the input arguments of the comparator.
        Parameters:
        comparator - A Comparator for comparing both values.
        Returns:
        an IOBinaryOperator which returns the lesser of its operands, according to the supplied Comparator.
        Throws:
        java.io.IOException - if there is an I/O error performing the operation.
      • maxBy

        static <T> IOBinaryOperator<T> maxBy​(@Nonnull
                                             java.util.Comparator<? super T> comparator)
                                      throws java.io.IOException

        This method is the same as BinaryOperator.maxBy(Comparator), but with a support for IOException.

        Type Parameters:
        T - The type of the input arguments of the comparator.
        Parameters:
        comparator - A Comparator for comparing both values.
        Returns:
        An IOBinaryOperator which returns the greater of its operands, according to the supplied Comparator.
        Throws:
        java.io.IOException - if there is an I/O error performing the operation