Java.util.function.BinaryOperator: 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/BinaryOperator.html =Internal= * Java 8 Lambda Expressions#BinaryOperator|Java 8 Lambda Expressi...")
 
 
(3 intermediate revisions by the same user not shown)
Line 8: Line 8:


=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.


<syntaxhighlight lang='java'>
<syntaxhighlight lang='java'>
@FunctionalInterface
public interface BinaryOperator<T> extends BiFunction<T, T, T> {
    T apply(T t, T t2);
}
</syntaxhighlight>
</syntaxhighlight>

Latest revision as of 21:05, 28 March 2018

External

Internal

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.

@FunctionalInterface
public interface BinaryOperator<T> extends BiFunction<T, T, T> {

    T apply(T t, T t2);

}