src/share/classes/java/util/function/DoubleBinaryOperator.java

Print this page
rev 6189 : 8004015: Add Extends and deaults for basic functional interface types
Summary: Adds the appropriate extends and default methods for  core functional interfaces used by the JSR335 libraries.
Reviewed-by: duke

*** 25,40 **** package java.util.function; /** * An operation on two {@code double} operands yielding a {@code double} result. * * @since 1.8 */ ! public interface DoubleBinaryOperator /* extends BinaryOperator<Double> */ { ! // ! // @Override ! // public default Double operate(Double left, Double right) { return operateAsDouble((double) left, (double) right); } /** * Returns the {@code double} result of the operation upon the * {@code double} operands. The parameters are named {@code left} and * {@code right} for operations where the order of parameters matters. --- 25,55 ---- package java.util.function; /** * An operation on two {@code double} operands yielding a {@code double} result. * + * <p>This is the primitive type specialization of {@link BinaryOperator} for + * {@code double} and also may be used as a {@code BinaryOperator<Double>}. When + * used as a {@code BinaryOperator} the default {@code operate} implementation + * provided by this interface neither accepts null parameters nor does it return + * null results. + * * @since 1.8 */ ! public interface DoubleBinaryOperator extends BinaryOperator<Double> { ! ! /** ! * {@inheritDoc} ! * ! * @param left {@inheritDoc}, must be non-null ! * @param right {@inheritDoc}, must be non-null ! * @return {@inheritDoc}, always non-null ! */ ! @Override ! public default Double operate(Double left, Double right) { ! return operateAsDouble((double)left, (double)right); ! } /** * Returns the {@code double} result of the operation upon the * {@code double} operands. The parameters are named {@code left} and * {@code right} for operations where the order of parameters matters.