< prev index next >

src/java.base/share/classes/java/lang/Double.java

Print this page
rev 52981 : 8215300: additional changes to constants API


1060      */
1061     public static double max(double a, double b) {
1062         return Math.max(a, b);
1063     }
1064 
1065     /**
1066      * Returns the smaller of two {@code double} values
1067      * as if by calling {@link Math#min(double, double) Math.min}.
1068      *
1069      * @param a the first operand
1070      * @param b the second operand
1071      * @return the smaller of {@code a} and {@code b}.
1072      * @see java.util.function.BinaryOperator
1073      * @since 1.8
1074      */
1075     public static double min(double a, double b) {
1076         return Math.min(a, b);
1077     }
1078 
1079     /**
1080      * Returns a nominal descriptor for this instance, which is the instance
1081      * itself.
1082      *
1083      * @return an {@link Optional} describing the {@linkplain Double} instance
1084      * @since 12
1085      */
1086     @Override
1087     public Optional<Double> describeConstable() {
1088         return Optional.of(this);
1089     }
1090 
1091     /**
1092      * Resolves this instance as a {@link ConstantDesc}, the result of which is
1093      * the instance itself.
1094      *
1095      * @param lookup ignored
1096      * @return the {@linkplain Double} instance
1097      * @since 12
1098      */
1099     @Override
1100     public Double resolveConstantDesc(MethodHandles.Lookup lookup) {
1101         return this;


1060      */
1061     public static double max(double a, double b) {
1062         return Math.max(a, b);
1063     }
1064 
1065     /**
1066      * Returns the smaller of two {@code double} values
1067      * as if by calling {@link Math#min(double, double) Math.min}.
1068      *
1069      * @param a the first operand
1070      * @param b the second operand
1071      * @return the smaller of {@code a} and {@code b}.
1072      * @see java.util.function.BinaryOperator
1073      * @since 1.8
1074      */
1075     public static double min(double a, double b) {
1076         return Math.min(a, b);
1077     }
1078 
1079     /**
1080      * Returns an {@link Optional} containing the nominal descriptor for this
1081      * instance, which is the instance itself.
1082      *
1083      * @return an {@link Optional} describing the {@linkplain Double} instance
1084      * @since 12
1085      */
1086     @Override
1087     public Optional<Double> describeConstable() {
1088         return Optional.of(this);
1089     }
1090 
1091     /**
1092      * Resolves this instance as a {@link ConstantDesc}, the result of which is
1093      * the instance itself.
1094      *
1095      * @param lookup ignored
1096      * @return the {@linkplain Double} instance
1097      * @since 12
1098      */
1099     @Override
1100     public Double resolveConstantDesc(MethodHandles.Lookup lookup) {
1101         return this;
< prev index next >