src/share/classes/java/lang/Long.java

Print this page

        

*** 79,105 **** * or larger than {@code Character.MAX_RADIX}, then the radix * {@code 10} is used instead. * * <p>If the first argument is negative, the first element of the * result is the ASCII minus sign {@code '-'} ! * (<code>'&#92;u002d'</code>). If the first argument is not * negative, no sign character appears in the result. * * <p>The remaining characters of the result represent the magnitude * of the first argument. If the magnitude is zero, it is * represented by a single zero character {@code '0'} ! * (<code>'&#92;u0030'</code>); otherwise, the first character of * the representation of the magnitude will not be the zero * character. The following ASCII characters are used as digits: * * <blockquote> * {@code 0123456789abcdefghijklmnopqrstuvwxyz} * </blockquote> * ! * These are <code>'&#92;u0030'</code> through ! * <code>'&#92;u0039'</code> and <code>'&#92;u0061'</code> through ! * <code>'&#92;u007a'</code>. If {@code radix} is * <var>N</var>, then the first <var>N</var> of these characters * are used as radix-<var>N</var> digits in the order shown. Thus, * the digits for hexadecimal (radix 16) are * {@code 0123456789abcdef}. If uppercase letters are * desired, the {@link java.lang.String#toUpperCase()} method may --- 79,105 ---- * or larger than {@code Character.MAX_RADIX}, then the radix * {@code 10} is used instead. * * <p>If the first argument is negative, the first element of the * result is the ASCII minus sign {@code '-'} ! * ({@code '\u005Cu002d'}). If the first argument is not * negative, no sign character appears in the result. * * <p>The remaining characters of the result represent the magnitude * of the first argument. If the magnitude is zero, it is * represented by a single zero character {@code '0'} ! * ({@code '\u005Cu0030'}); otherwise, the first character of * the representation of the magnitude will not be the zero * character. The following ASCII characters are used as digits: * * <blockquote> * {@code 0123456789abcdefghijklmnopqrstuvwxyz} * </blockquote> * ! * These are {@code '\u005Cu0030'} through ! * {@code '\u005Cu0039'} and {@code '\u005Cu0061'} through ! * {@code '\u005Cu007a'}. If {@code radix} is * <var>N</var>, then the first <var>N</var> of these characters * are used as radix-<var>N</var> digits in the order shown. Thus, * the digits for hexadecimal (radix 16) are * {@code 0123456789abcdef}. If uppercase letters are * desired, the {@link java.lang.String#toUpperCase()} method may
*** 152,162 **** * * <p>Note that since the first argument is treated as an unsigned * value, no leading sign character is printed. * * <p>If the magnitude is zero, it is represented by a single zero ! * character {@code '0'} (<code>'&#92;u0030'</code>); otherwise, * the first character of the representation of the magnitude will * not be the zero character. * * <p>The behavior of radixes and the characters used as digits * are the same as {@link #toString(long, int) toString}. --- 152,162 ---- * * <p>Note that since the first argument is treated as an unsigned * value, no leading sign character is printed. * * <p>If the magnitude is zero, it is represented by a single zero ! * character {@code '0'} ({@code '\u005Cu0030'}); otherwise, * the first character of the representation of the magnitude will * not be the zero character. * * <p>The behavior of radixes and the characters used as digits * are the same as {@link #toString(long, int) toString}.
*** 237,258 **** * string {@code s} by calling {@link * Long#parseUnsignedLong(String, int) Long.parseUnsignedLong(s, * 16)}. * * <p>If the unsigned magnitude is zero, it is represented by a ! * single zero character {@code '0'} (<code>'&#92;u0030'</code>); * otherwise, the first character of the representation of the * unsigned magnitude will not be the zero character. The * following characters are used as hexadecimal digits: * * <blockquote> * {@code 0123456789abcdef} * </blockquote> * ! * These are the characters <code>'&#92;u0030'</code> through ! * <code>'&#92;u0039'</code> and <code>'&#92;u0061'</code> through ! * <code>'&#92;u0066'</code>. If uppercase letters are desired, * the {@link java.lang.String#toUpperCase()} method may be called * on the result: * * <blockquote> * {@code Long.toHexString(n).toUpperCase()} --- 237,258 ---- * string {@code s} by calling {@link * Long#parseUnsignedLong(String, int) Long.parseUnsignedLong(s, * 16)}. * * <p>If the unsigned magnitude is zero, it is represented by a ! * single zero character {@code '0'} ({@code '\u005Cu0030'}); * otherwise, the first character of the representation of the * unsigned magnitude will not be the zero character. The * following characters are used as hexadecimal digits: * * <blockquote> * {@code 0123456789abcdef} * </blockquote> * ! * These are the characters {@code '\u005Cu0030'} through ! * {@code '\u005Cu0039'} and {@code '\u005Cu0061'} through ! * {@code '\u005Cu0066'}. If uppercase letters are desired, * the {@link java.lang.String#toUpperCase()} method may be called * on the result: * * <blockquote> * {@code Long.toHexString(n).toUpperCase()}
*** 284,304 **** * string {@code s} by calling {@link * Long#parseUnsignedLong(String, int) Long.parseUnsignedLong(s, * 8)}. * * <p>If the unsigned magnitude is zero, it is represented by a ! * single zero character {@code '0'} (<code>'&#92;u0030'</code>); * otherwise, the first character of the representation of the * unsigned magnitude will not be the zero character. The * following characters are used as octal digits: * * <blockquote> * {@code 01234567} * </blockquote> * ! * These are the characters <code>'&#92;u0030'</code> through ! * <code>'&#92;u0037'</code>. * * @param i a {@code long} to be converted to a string. * @return the string representation of the unsigned {@code long} * value represented by the argument in octal (base&nbsp;8). * @see #parseUnsignedLong(String, int) --- 284,304 ---- * string {@code s} by calling {@link * Long#parseUnsignedLong(String, int) Long.parseUnsignedLong(s, * 8)}. * * <p>If the unsigned magnitude is zero, it is represented by a ! * single zero character {@code '0'} ({@code '\u005Cu0030'}); * otherwise, the first character of the representation of the * unsigned magnitude will not be the zero character. The * following characters are used as octal digits: * * <blockquote> * {@code 01234567} * </blockquote> * ! * These are the characters {@code '\u005Cu0030'} through ! * {@code '\u005Cu0037'}. * * @param i a {@code long} to be converted to a string. * @return the string representation of the unsigned {@code long} * value represented by the argument in octal (base&nbsp;8). * @see #parseUnsignedLong(String, int)
*** 323,337 **** * string {@code s} by calling {@link * Long#parseUnsignedLong(String, int) Long.parseUnsignedLong(s, * 2)}. * * <p>If the unsigned magnitude is zero, it is represented by a ! * single zero character {@code '0'} (<code>'&#92;u0030'</code>); * otherwise, the first character of the representation of the * unsigned magnitude will not be the zero character. The ! * characters {@code '0'} (<code>'&#92;u0030'</code>) and {@code ! * '1'} (<code>'&#92;u0031'</code>) are used as binary digits. * * @param i a {@code long} to be converted to a string. * @return the string representation of the unsigned {@code long} * value represented by the argument in binary (base&nbsp;2). * @see #parseUnsignedLong(String, int) --- 323,337 ---- * string {@code s} by calling {@link * Long#parseUnsignedLong(String, int) Long.parseUnsignedLong(s, * 2)}. * * <p>If the unsigned magnitude is zero, it is represented by a ! * single zero character {@code '0'} ({@code '\u005Cu0030'}); * otherwise, the first character of the representation of the * unsigned magnitude will not be the zero character. The ! * characters {@code '0'} ({@code '\u005Cu0030'}) and {@code ! * '1'} ({@code '\u005Cu0031'}) are used as binary digits. * * @param i a {@code long} to be converted to a string. * @return the string representation of the unsigned {@code long} * value represented by the argument in binary (base&nbsp;2). * @see #parseUnsignedLong(String, int)
*** 465,482 **** * Parses the string argument as a signed {@code long} in the * radix specified by the second argument. The characters in the * string must all be digits of the specified radix (as determined * by whether {@link java.lang.Character#digit(char, int)} returns * a nonnegative value), except that the first character may be an ! * ASCII minus sign {@code '-'} (<code>'&#92;u002D'</code>) to * indicate a negative value or an ASCII plus sign {@code '+'} ! * (<code>'&#92;u002B'</code>) to indicate a positive value. The * resulting {@code long} value is returned. * * <p>Note that neither the character {@code L} ! * (<code>'&#92;u004C'</code>) nor {@code l} ! * (<code>'&#92;u006C'</code>) is permitted to appear at the end * of the string as a type indicator, as would be permitted in * Java programming language source code - except that either * {@code L} or {@code l} may appear as a digit for a * radix greater than 22. * --- 465,482 ---- * Parses the string argument as a signed {@code long} in the * radix specified by the second argument. The characters in the * string must all be digits of the specified radix (as determined * by whether {@link java.lang.Character#digit(char, int)} returns * a nonnegative value), except that the first character may be an ! * ASCII minus sign {@code '-'} ({@code '\u005Cu002D'}) to * indicate a negative value or an ASCII plus sign {@code '+'} ! * ({@code '\u005Cu002B'}) to indicate a positive value. The * resulting {@code long} value is returned. * * <p>Note that neither the character {@code L} ! * ({@code '\u005Cu004C'}) nor {@code l} ! * ({@code '\u005Cu006C'}) is permitted to appear at the end * of the string as a type indicator, as would be permitted in * Java programming language source code - except that either * {@code L} or {@code l} may appear as a digit for a * radix greater than 22. *
*** 491,502 **** * java.lang.Character#MIN_RADIX} or larger than {@link * java.lang.Character#MAX_RADIX}. * * <li>Any character of the string is not a digit of the specified * radix, except that the first character may be a minus sign ! * {@code '-'} (<code>'&#92;u002d'</code>) or plus sign {@code ! * '+'} (<code>'&#92;u002B'</code>) provided that the string is * longer than length 1. * * <li>The value represented by the string is not a value of type * {@code long}. * </ul> --- 491,502 ---- * java.lang.Character#MIN_RADIX} or larger than {@link * java.lang.Character#MAX_RADIX}. * * <li>Any character of the string is not a digit of the specified * radix, except that the first character may be a minus sign ! * {@code '-'} ({@code '\u005Cu002d'}) or plus sign {@code ! * '+'} ({@code '\u005Cu002B'}) provided that the string is * longer than length 1. * * <li>The value represented by the string is not a value of type * {@code long}. * </ul>
*** 582,601 **** /** * Parses the string argument as a signed decimal {@code long}. * The characters in the string must all be decimal digits, except * that the first character may be an ASCII minus sign {@code '-'} ! * (<code>&#92;u002D'</code>) to indicate a negative value or an ! * ASCII plus sign {@code '+'} (<code>'&#92;u002B'</code>) to * indicate a positive value. The resulting {@code long} value is * returned, exactly as if the argument and the radix {@code 10} * were given as arguments to the {@link * #parseLong(java.lang.String, int)} method. * * <p>Note that neither the character {@code L} ! * (<code>'&#92;u004C'</code>) nor {@code l} ! * (<code>'&#92;u006C'</code>) is permitted to appear at the end * of the string as a type indicator, as would be permitted in * Java programming language source code. * * @param s a {@code String} containing the {@code long} * representation to be parsed --- 582,601 ---- /** * Parses the string argument as a signed decimal {@code long}. * The characters in the string must all be decimal digits, except * that the first character may be an ASCII minus sign {@code '-'} ! * ({@code \u005Cu002D'}) to indicate a negative value or an ! * ASCII plus sign {@code '+'} ({@code '\u005Cu002B'}) to * indicate a positive value. The resulting {@code long} value is * returned, exactly as if the argument and the radix {@code 10} * were given as arguments to the {@link * #parseLong(java.lang.String, int)} method. * * <p>Note that neither the character {@code L} ! * ({@code '\u005Cu004C'}) nor {@code l} ! * ({@code '\u005Cu006C'}) is permitted to appear at the end * of the string as a type indicator, as would be permitted in * Java programming language source code. * * @param s a {@code String} containing the {@code long} * representation to be parsed
*** 616,626 **** * * The characters in the string must all be digits of the * specified radix (as determined by whether {@link * java.lang.Character#digit(char, int)} returns a nonnegative * value), except that the first character may be an ASCII plus ! * sign {@code '+'} (<code>'&#92;u002B'</code>). The resulting * integer value is returned. * * <p>An exception of type {@code NumberFormatException} is * thrown if any of the following situations occurs: * <ul> --- 616,626 ---- * * The characters in the string must all be digits of the * specified radix (as determined by whether {@link * java.lang.Character#digit(char, int)} returns a nonnegative * value), except that the first character may be an ASCII plus ! * sign {@code '+'} ({@code '\u005Cu002B'}). The resulting * integer value is returned. * * <p>An exception of type {@code NumberFormatException} is * thrown if any of the following situations occurs: * <ul>
*** 631,641 **** * {@link java.lang.Character#MIN_RADIX} or * larger than {@link java.lang.Character#MAX_RADIX}. * * <li>Any character of the string is not a digit of the specified * radix, except that the first character may be a plus sign ! * {@code '+'} (<code>'&#92;u002B'</code>) provided that the * string is longer than length 1. * * <li>The value represented by the string is larger than the * largest unsigned {@code long}, 2<sup>64</sup>-1. * --- 631,641 ---- * {@link java.lang.Character#MIN_RADIX} or * larger than {@link java.lang.Character#MAX_RADIX}. * * <li>Any character of the string is not a digit of the specified * radix, except that the first character may be a plus sign ! * {@code '+'} ({@code '\u005Cu002B'}) provided that the * string is longer than length 1. * * <li>The value represented by the string is larger than the * largest unsigned {@code long}, 2<sup>64</sup>-1. *
*** 705,715 **** /** * Parses the string argument as an unsigned decimal {@code long}. The * characters in the string must all be decimal digits, except * that the first character may be an an ASCII plus sign {@code ! * '+'} (<code>'&#92;u002B'</code>). The resulting integer value * is returned, exactly as if the argument and the radix 10 were * given as arguments to the {@link * #parseUnsignedLong(java.lang.String, int)} method. * * @param s a {@code String} containing the unsigned {@code long} --- 705,715 ---- /** * Parses the string argument as an unsigned decimal {@code long}. The * characters in the string must all be decimal digits, except * that the first character may be an an ASCII plus sign {@code ! * '+'} ({@code '\u005Cu002B'}). The resulting integer value * is returned, exactly as if the argument and the radix 10 were * given as arguments to the {@link * #parseUnsignedLong(java.lang.String, int)} method. * * @param s a {@code String} containing the unsigned {@code long}
*** 1146,1157 **** * integer exactly as by the method * {@link #valueOf(java.lang.String, int)} with radix 10. * </ul> * * <p>Note that, in every case, neither {@code L} ! * (<code>'&#92;u004C'</code>) nor {@code l} ! * (<code>'&#92;u006C'</code>) is permitted to appear at the end * of the property value as a type indicator, as would be * permitted in Java programming language source code. * * <p>The second argument is the default value. The default value is * returned if there is no property of the specified name, if the --- 1146,1157 ---- * integer exactly as by the method * {@link #valueOf(java.lang.String, int)} with radix 10. * </ul> * * <p>Note that, in every case, neither {@code L} ! * ({@code '\u005Cu004C'}) nor {@code l} ! * ({@code '\u005Cu006C'}) is permitted to appear at the end * of the property value as a type indicator, as would be * permitted in Java programming language source code. * * <p>The second argument is the default value. The default value is * returned if there is no property of the specified name, if the