Java.util.function.BiFunction: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
(Created page with "=External= * https://docs.oracle.com/javase/8/docs/api/java/util/function/BiFunction.html =Internal= * Java 8 Lambda Expressions =...")
 
 
Line 9: Line 9:
=Overview=
=Overview=


Combines two values of the same type: 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 BiFunction for the case where the operands and the result are all of the same type.
Represents a function that accepts two arguments and produces a result. This is the two-arity specialization of [[java.util.function.Function#Overview|Function]].


<syntaxhighlight lang='java'>
<syntaxhighlight lang='java'>
@FunctionalInterface
@FunctionalInterface
public interface BinaryOperator<T> extends BiFunction<T, T, T> {
public interface BiFunction<T, U, R> {


     T apply(T t, T t2);
     R apply(T t, U u)


}
}
</syntaxhighlight>
</syntaxhighlight>

Latest revision as of 01:11, 29 March 2018

External

Internal

Overview

Represents a function that accepts two arguments and produces a result. This is the two-arity specialization of Function.

@FunctionalInterface
public interface BiFunction<T, U, R> {

    R apply(T t, U u)

}