equal
deleted
inserted
replaced
23 * questions. |
23 * questions. |
24 */ |
24 */ |
25 package java.util.function; |
25 package java.util.function; |
26 |
26 |
27 /** |
27 /** |
28 * An operation upon two operands yielding a result. The operands and the result |
28 * An operation upon two operands yielding a result. This is a specialization of |
29 * are all of the same type. |
29 * {@code BiFunction} where the operands and the result are all of the same type. |
30 * |
30 * |
31 * @param <T> the type of operands to {@code operate} and of the result |
31 * @param <T> the type of operands to {@code apply} and of the result |
32 * |
32 * |
|
33 * @see BiFunction. |
33 * @since 1.8 |
34 * @since 1.8 |
34 */ |
35 */ |
35 @FunctionalInterface |
36 @FunctionalInterface |
36 public interface BinaryOperator<T> { |
37 public interface BinaryOperator<T> extends BiFunction<T,T,T> { |
37 |
|
38 /** |
|
39 * Returns the result of the operation upon the operands. |
|
40 * The operands are named {@code left} and {@code right} for operations |
|
41 * where the order of operands matters. |
|
42 * |
|
43 * @param left the left operand |
|
44 * @param right the right operand |
|
45 * @return the result of the operation |
|
46 */ |
|
47 public T operate(T left, T right); |
|
48 } |
38 } |