src/share/classes/java/lang/Double.java
Print this page
@@ -451,12 +451,11 @@
*
* <p>To avoid calling this method on an invalid string and having
* a {@code NumberFormatException} be thrown, the regular
* expression below can be used to screen the input string:
*
- * <code>
- * <pre>
+ * <pre>{@code
* final String Digits = "(\\p{Digit}+)";
* final String HexDigits = "(\\p{XDigit}+)";
* // an exponent is 'e' or 'E' followed by an optionally
* // signed decimal integer.
* final String Exp = "[eE][+-]?"+Digits;
@@ -472,11 +471,11 @@
* //
* // Since this method allows integer-only strings as input
* // in addition to strings of floating-point literals, the
* // two sub-patterns below are simplifications of the grammar
* // productions from section 3.10.2 of
- * // <cite>The Java™ Language Specification</cite>.
+ * // The Java Language Specification.
*
* // Digits ._opt Digits_opt ExponentPart_opt FloatTypeSuffix_opt
* "((("+Digits+"(\\.)?("+Digits+"?)("+Exp+")?)|"+
*
* // . Digits ExponentPart_opt FloatTypeSuffix_opt
@@ -497,12 +496,11 @@
* if (Pattern.matches(fpRegex, myString))
* Double.valueOf(myString); // Will not throw NumberFormatException
* else {
* // Perform suitable alternative action
* }
- * </pre>
- * </code>
+ * }</pre>
*
* @param s the string to be parsed.
* @return a {@code Double} object holding the value
* represented by the {@code String} argument.
* @throws NumberFormatException if the string does not contain a
@@ -754,13 +752,13 @@
/**
* Returns a hash code for a {@code double} value; compatible with
* {@code Double.hashCode()}.
*
- * @since 1.8
- *
+ * @param value the value to hash
* @return a hash code value for a {@code double} value.
+ * @since 1.8
*/
public static int hashCode(double value) {
long bits = doubleToLongBits(value);
return (int)(bits ^ (bits >>> 32));
}