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.
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:
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> IOBinaryOperator<T>
maxBy
(Comparator<? super T> comparator) This method is the same asBinaryOperator.maxBy(Comparator)
, but with a support forIOException
.static <T> IOBinaryOperator<T>
minBy
(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 Details
-
minBy
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:
IOException
- if there is an I/O error performing the operation.
-
maxBy
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:
IOException
- if there is an I/O error performing the operation
-