Package com.globalmentor.io.function
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 ofIOBiFunction
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 anIOException
.- 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 asBinaryOperator.maxBy(Comparator)
, but with a support forIOException
.static <T> IOBinaryOperator<T>
minBy(java.util.Comparator<? super T> comparator)
This method is the same asBinaryOperator.minBy(Comparator)
, but with a support forIOException
.-
Methods inherited from interface com.globalmentor.io.function.IOBiFunction
andThen, apply
-
-
-
-
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 forIOException
.- Type Parameters:
T
- The type of the input arguments of the comparator.- Parameters:
comparator
- AComparator
for comparing both values.- Returns:
- an
IOBinaryOperator
which returns the lesser of its operands, according to the suppliedComparator
. - 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 forIOException
.- Type Parameters:
T
- The type of the input arguments of the comparator.- Parameters:
comparator
- AComparator
for comparing both values.- Returns:
- An
IOBinaryOperator
which returns the greater of its operands, according to the suppliedComparator
. - Throws:
java.io.IOException
- if there is an I/O error performing the operation
-
-