src/share/classes/java/util/Formatter.java

Print this page




 901  *     FormatFlagsConversionMismatchException} will be thrown.
 902  *
 903  * <tr><td valign="top"> {@code 'o'}
 904  *     <td valign="top"> <tt>'&#92;u006f'</tt>
 905  *     <td> Formats the argument as an integer in base eight.  No localization
 906  *     is applied.
 907  *
 908  *     <p> If <i>x</i> is negative then the result will be an unsigned value
 909  *     generated by adding 2<sup>n</sup> to the value where {@code n} is the
 910  *     number of bits in the type as returned by the static {@code SIZE} field
 911  *     in the {@linkplain Byte#SIZE Byte}, {@linkplain Short#SIZE Short},
 912  *     {@linkplain Integer#SIZE Integer}, or {@linkplain Long#SIZE Long}
 913  *     classes as appropriate.
 914  *
 915  *     <p> If the {@code '#'} flag is given then the output will always begin
 916  *     with the radix indicator {@code '0'}.
 917  *
 918  *     <p> If the {@code '0'} flag is given then the output will be padded
 919  *     with leading zeros to the field width following any indication of sign.
 920  *
 921  *     <p> If {@code '('}, {@code '+'}, '&nbsp&nbsp;', or {@code ','} flags
 922  *     are given then a {@link FormatFlagsConversionMismatchException} will be
 923  *     thrown.
 924  *
 925  * <tr><td valign="top"> {@code 'x'}
 926  *     <td valign="top"> <tt>'&#92;u0078'</tt>
 927  *     <td> Formats the argument as an integer in base sixteen. No
 928  *     localization is applied.
 929  *
 930  *     <p> If <i>x</i> is negative then the result will be an unsigned value
 931  *     generated by adding 2<sup>n</sup> to the value where {@code n} is the
 932  *     number of bits in the type as returned by the static {@code SIZE} field
 933  *     in the {@linkplain Byte#SIZE Byte}, {@linkplain Short#SIZE Short},
 934  *     {@linkplain Integer#SIZE Integer}, or {@linkplain Long#SIZE Long}
 935  *     classes as appropriate.
 936  *
 937  *     <p> If the {@code '#'} flag is given then the output will always begin
 938  *     with the radix indicator {@code "0x"}.
 939  *
 940  *     <p> If the {@code '0'} flag is given then the output will be padded to
 941  *     the field width with leading zeros after the radix indicator or sign (if




 901  *     FormatFlagsConversionMismatchException} will be thrown.
 902  *
 903  * <tr><td valign="top"> {@code 'o'}
 904  *     <td valign="top"> <tt>'&#92;u006f'</tt>
 905  *     <td> Formats the argument as an integer in base eight.  No localization
 906  *     is applied.
 907  *
 908  *     <p> If <i>x</i> is negative then the result will be an unsigned value
 909  *     generated by adding 2<sup>n</sup> to the value where {@code n} is the
 910  *     number of bits in the type as returned by the static {@code SIZE} field
 911  *     in the {@linkplain Byte#SIZE Byte}, {@linkplain Short#SIZE Short},
 912  *     {@linkplain Integer#SIZE Integer}, or {@linkplain Long#SIZE Long}
 913  *     classes as appropriate.
 914  *
 915  *     <p> If the {@code '#'} flag is given then the output will always begin
 916  *     with the radix indicator {@code '0'}.
 917  *
 918  *     <p> If the {@code '0'} flag is given then the output will be padded
 919  *     with leading zeros to the field width following any indication of sign.
 920  *
 921  *     <p> If {@code '('}, {@code '+'}, '&nbsp;&nbsp;', or {@code ','} flags
 922  *     are given then a {@link FormatFlagsConversionMismatchException} will be
 923  *     thrown.
 924  *
 925  * <tr><td valign="top"> {@code 'x'}
 926  *     <td valign="top"> <tt>'&#92;u0078'</tt>
 927  *     <td> Formats the argument as an integer in base sixteen. No
 928  *     localization is applied.
 929  *
 930  *     <p> If <i>x</i> is negative then the result will be an unsigned value
 931  *     generated by adding 2<sup>n</sup> to the value where {@code n} is the
 932  *     number of bits in the type as returned by the static {@code SIZE} field
 933  *     in the {@linkplain Byte#SIZE Byte}, {@linkplain Short#SIZE Short},
 934  *     {@linkplain Integer#SIZE Integer}, or {@linkplain Long#SIZE Long}
 935  *     classes as appropriate.
 936  *
 937  *     <p> If the {@code '#'} flag is given then the output will always begin
 938  *     with the radix indicator {@code "0x"}.
 939  *
 940  *     <p> If the {@code '0'} flag is given then the output will be padded to
 941  *     the field width with leading zeros after the radix indicator or sign (if