|
1 | 1 | /*
|
2 |
| - * Copyright (c) 1996, 2024, Oracle and/or its affiliates. All rights reserved. |
| 2 | + * Copyright (c) 1996, 2025, Oracle and/or its affiliates. All rights reserved. |
3 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
4 | 4 | *
|
5 | 5 | * This code is free software; you can redistribute it and/or modify it
|
@@ -883,21 +883,30 @@ public Object clone() {
|
883 | 883 | }
|
884 | 884 |
|
885 | 885 | /**
|
886 |
| - * Returns true if grouping is used in this format. For example, in the |
887 |
| - * English locale, with grouping on, the number 1234567 might be formatted |
888 |
| - * as "1,234,567". The grouping separator as well as the size of each group |
889 |
| - * is locale dependent and is determined by sub-classes of NumberFormat. |
| 886 | + * Returns true if grouping is used in this format. This applies to both |
| 887 | + * formatting and parsing. The grouping separator as well as the size of each |
| 888 | + * group is locale dependent and is determined by sub-classes of NumberFormat. |
| 889 | + * For example, consider a {@code NumberFormat} that expects a "{@code ,}" |
| 890 | + * grouping separator symbol with a grouping size of 3. |
| 891 | + * <ul> |
| 892 | + * <li> Formatting {@code 1234567} with grouping on returns {@code "1,234,567"} |
| 893 | + * <li> Parsing {@code "1,234,567"} with grouping off returns {@code 1} |
| 894 | + * <li> Parsing {@code "1,234,567"} with grouping off when {@link #isStrict()} |
| 895 | + * returns {@code true} throws {@code ParseException} |
| 896 | + * </ul> |
890 | 897 | *
|
891 | 898 | * @return {@code true} if grouping is used;
|
892 | 899 | * {@code false} otherwise
|
893 | 900 | * @see #setGroupingUsed
|
| 901 | + * @see ##leniency Leniency Section |
894 | 902 | */
|
895 | 903 | public boolean isGroupingUsed() {
|
896 | 904 | return groupingUsed;
|
897 | 905 | }
|
898 | 906 |
|
899 | 907 | /**
|
900 | 908 | * Set whether or not grouping will be used in this format.
|
| 909 | + * This applies to both formatting and parsing. |
901 | 910 | *
|
902 | 911 | * @param newValue {@code true} if grouping is used;
|
903 | 912 | * {@code false} otherwise
|
|
0 commit comments