提交 26c1b30e 编写于 作者: B bpb

8020409: Clean up doclint problems in java.util package, part 1

Summary: Clean up doclint problems in java.util package, part 1
Reviewed-by: darcy
Contributed-by: NBrian Burkhalter <brian.burkhalter@oracle.com>
上级 3f4a9197
...@@ -70,9 +70,9 @@ import java.util.function.UnaryOperator; ...@@ -70,9 +70,9 @@ import java.util.function.UnaryOperator;
* unsynchronized access to the list:<pre> * unsynchronized access to the list:<pre>
* List list = Collections.synchronizedList(new ArrayList(...));</pre> * List list = Collections.synchronizedList(new ArrayList(...));</pre>
* *
* <p><a name="fail-fast"/> * <p><a name="fail-fast">
* The iterators returned by this class's {@link #iterator() iterator} and * The iterators returned by this class's {@link #iterator() iterator} and
* {@link #listIterator(int) listIterator} methods are <em>fail-fast</em>: * {@link #listIterator(int) listIterator} methods are <em>fail-fast</em>:</a>
* if the list is structurally modified at any time after the iterator is * if the list is structurally modified at any time after the iterator is
* created, in any way except through the iterator's own * created, in any way except through the iterator's own
* {@link ListIterator#remove() remove} or * {@link ListIterator#remove() remove} or
......
...@@ -984,6 +984,7 @@ public class Arrays { ...@@ -984,6 +984,7 @@ public class Arrays {
* {@link ForkJoinPool#commonPool() ForkJoin common pool} is used to * {@link ForkJoinPool#commonPool() ForkJoin common pool} is used to
* execute any parallel tasks. * execute any parallel tasks.
* *
* @param <T> the class of the objects to be sorted
* @param a the array to be sorted * @param a the array to be sorted
* *
* @throws ClassCastException if the array contains elements that are not * @throws ClassCastException if the array contains elements that are not
...@@ -1035,6 +1036,7 @@ public class Arrays { ...@@ -1035,6 +1036,7 @@ public class Arrays {
* array. The {@link ForkJoinPool#commonPool() ForkJoin common pool} is * array. The {@link ForkJoinPool#commonPool() ForkJoin common pool} is
* used to execute any parallel tasks. * used to execute any parallel tasks.
* *
* @param <T> the class of the objects to be sorted
* @param a the array to be sorted * @param a the array to be sorted
* @param fromIndex the index of the first element (inclusive) to be * @param fromIndex the index of the first element (inclusive) to be
* sorted * sorted
...@@ -1087,6 +1089,7 @@ public class Arrays { ...@@ -1087,6 +1089,7 @@ public class Arrays {
* {@link ForkJoinPool#commonPool() ForkJoin common pool} is used to * {@link ForkJoinPool#commonPool() ForkJoin common pool} is used to
* execute any parallel tasks. * execute any parallel tasks.
* *
* @param <T> the class of the objects to be sorted
* @param a the array to be sorted * @param a the array to be sorted
* @param cmp the comparator to determine the order of the array. A * @param cmp the comparator to determine the order of the array. A
* {@code null} value indicates that the elements' * {@code null} value indicates that the elements'
...@@ -1138,6 +1141,7 @@ public class Arrays { ...@@ -1138,6 +1141,7 @@ public class Arrays {
* array. The {@link ForkJoinPool#commonPool() ForkJoin common pool} is * array. The {@link ForkJoinPool#commonPool() ForkJoin common pool} is
* used to execute any parallel tasks. * used to execute any parallel tasks.
* *
* @param <T> the class of the objects to be sorted
* @param a the array to be sorted * @param a the array to be sorted
* @param fromIndex the index of the first element (inclusive) to be * @param fromIndex the index of the first element (inclusive) to be
* sorted * sorted
...@@ -1412,6 +1416,7 @@ public class Arrays { ...@@ -1412,6 +1416,7 @@ public class Arrays {
* Fourth Annual ACM-SIAM Symposium on Discrete Algorithms, pp 467-474, * Fourth Annual ACM-SIAM Symposium on Discrete Algorithms, pp 467-474,
* January 1993. * January 1993.
* *
* @param <T> the class of the objects to be sorted
* @param a the array to be sorted * @param a the array to be sorted
* @param c the comparator to determine the order of the array. A * @param c the comparator to determine the order of the array. A
* {@code null} value indicates that the elements' * {@code null} value indicates that the elements'
...@@ -1475,6 +1480,7 @@ public class Arrays { ...@@ -1475,6 +1480,7 @@ public class Arrays {
* Fourth Annual ACM-SIAM Symposium on Discrete Algorithms, pp 467-474, * Fourth Annual ACM-SIAM Symposium on Discrete Algorithms, pp 467-474,
* January 1993. * January 1993.
* *
* @param <T> the class of the objects to be sorted
* @param a the array to be sorted * @param a the array to be sorted
* @param fromIndex the index of the first element (inclusive) to be * @param fromIndex the index of the first element (inclusive) to be
* sorted * sorted
...@@ -1569,6 +1575,7 @@ public class Arrays { ...@@ -1569,6 +1575,7 @@ public class Arrays {
* Parallel prefix computation is usually more efficient than * Parallel prefix computation is usually more efficient than
* sequential loops for large arrays. * sequential loops for large arrays.
* *
* @param <T> the class of the objects in the array
* @param array the array, which is modified in-place by this method * @param array the array, which is modified in-place by this method
* @param op a side-effect-free, associative function to perform the * @param op a side-effect-free, associative function to perform the
* cumulation * cumulation
...@@ -1585,6 +1592,7 @@ public class Arrays { ...@@ -1585,6 +1592,7 @@ public class Arrays {
* Performs {@link #parallelPrefix(Object[], BinaryOperator)} * Performs {@link #parallelPrefix(Object[], BinaryOperator)}
* for the given subrange of the array. * for the given subrange of the array.
* *
* @param <T> the class of the objects in the array
* @param array the array * @param array the array
* @param fromIndex the index of the first element, inclusive * @param fromIndex the index of the first element, inclusive
* @param toIndex the index of the last element, exclusive * @param toIndex the index of the last element, exclusive
...@@ -2437,6 +2445,7 @@ public class Arrays { ...@@ -2437,6 +2445,7 @@ public class Arrays {
* elements equal to the specified object, there is no guarantee which one * elements equal to the specified object, there is no guarantee which one
* will be found. * will be found.
* *
* @param <T> the class of the objects in the array
* @param a the array to be searched * @param a the array to be searched
* @param key the value to be searched for * @param key the value to be searched for
* @param c the comparator by which the array is ordered. A * @param c the comparator by which the array is ordered. A
...@@ -2472,6 +2481,7 @@ public class Arrays { ...@@ -2472,6 +2481,7 @@ public class Arrays {
* If the range contains multiple elements equal to the specified object, * If the range contains multiple elements equal to the specified object,
* there is no guarantee which one will be found. * there is no guarantee which one will be found.
* *
* @param <T> the class of the objects in the array
* @param a the array to be searched * @param a the array to be searched
* @param fromIndex the index of the first element (inclusive) to be * @param fromIndex the index of the first element (inclusive) to be
* searched * searched
...@@ -3143,6 +3153,7 @@ public class Arrays { ...@@ -3143,6 +3153,7 @@ public class Arrays {
* is greater than that of the original array. * is greater than that of the original array.
* The resulting array is of exactly the same class as the original array. * The resulting array is of exactly the same class as the original array.
* *
* @param <T> the class of the objects in the array
* @param original the array to be copied * @param original the array to be copied
* @param newLength the length of the copy to be returned * @param newLength the length of the copy to be returned
* @return a copy of the original array, truncated or padded with nulls * @return a copy of the original array, truncated or padded with nulls
...@@ -3166,6 +3177,8 @@ public class Arrays { ...@@ -3166,6 +3177,8 @@ public class Arrays {
* is greater than that of the original array. * is greater than that of the original array.
* The resulting array is of the class <tt>newType</tt>. * The resulting array is of the class <tt>newType</tt>.
* *
* @param <U> the class of the objects in the original array
* @param <T> the class of the objects in the returned array
* @param original the array to be copied * @param original the array to be copied
* @param newLength the length of the copy to be returned * @param newLength the length of the copy to be returned
* @param newType the class of the copy to be returned * @param newType the class of the copy to be returned
...@@ -3396,6 +3409,7 @@ public class Arrays { ...@@ -3396,6 +3409,7 @@ public class Arrays {
* <p> * <p>
* The resulting array is of exactly the same class as the original array. * The resulting array is of exactly the same class as the original array.
* *
* @param <T> the class of the objects in the array
* @param original the array from which a range is to be copied * @param original the array from which a range is to be copied
* @param from the initial index of the range to be copied, inclusive * @param from the initial index of the range to be copied, inclusive
* @param to the final index of the range to be copied, exclusive. * @param to the final index of the range to be copied, exclusive.
...@@ -3428,6 +3442,8 @@ public class Arrays { ...@@ -3428,6 +3442,8 @@ public class Arrays {
* of the returned array will be <tt>to - from</tt>. * of the returned array will be <tt>to - from</tt>.
* The resulting array is of the class <tt>newType</tt>. * The resulting array is of the class <tt>newType</tt>.
* *
* @param <U> the class of the objects in the original array
* @param <T> the class of the objects in the returned array
* @param original the array from which a range is to be copied * @param original the array from which a range is to be copied
* @param from the initial index of the range to be copied, inclusive * @param from the initial index of the range to be copied, inclusive
* @param to the final index of the range to be copied, exclusive. * @param to the final index of the range to be copied, exclusive.
...@@ -3760,6 +3776,7 @@ public class Arrays { ...@@ -3760,6 +3776,7 @@ public class Arrays {
* List&lt;String&gt; stooges = Arrays.asList("Larry", "Moe", "Curly"); * List&lt;String&gt; stooges = Arrays.asList("Larry", "Moe", "Curly");
* </pre> * </pre>
* *
* @param <T> the class of the objects in the array
* @param a the array by which the list will be backed * @param a the array by which the list will be backed
* @return a list view of the specified array * @return a list view of the specified array
*/ */
......
...@@ -42,24 +42,21 @@ import java.nio.charset.StandardCharsets; ...@@ -42,24 +42,21 @@ import java.nio.charset.StandardCharsets;
* *
* <p> * <p>
* <ul> * <ul>
* <a name="basic"> * <li><a name="basic"><b>Basic</b></a>
* <li><b>Basic</b>
* <p> Uses "The Base64 Alphabet" as specified in Table 1 of * <p> Uses "The Base64 Alphabet" as specified in Table 1 of
* RFC 4648 and RFC 2045 for encoding and decoding operation. * RFC 4648 and RFC 2045 for encoding and decoding operation.
* The encoder does not add any line feed (line separator) * The encoder does not add any line feed (line separator)
* character. The decoder rejects data that contains characters * character. The decoder rejects data that contains characters
* outside the base64 alphabet.</p></li> * outside the base64 alphabet.</p></li>
* *
* <a name="url"> * <li><a name="url"><b>URL and Filename safe</b></a>
* <li><b>URL and Filename safe</b>
* <p> Uses the "URL and Filename safe Base64 Alphabet" as specified * <p> Uses the "URL and Filename safe Base64 Alphabet" as specified
* in Table 2 of RFC 4648 for encoding and decoding. The * in Table 2 of RFC 4648 for encoding and decoding. The
* encoder does not add any line feed (line separator) character. * encoder does not add any line feed (line separator) character.
* The decoder rejects data that contains characters outside the * The decoder rejects data that contains characters outside the
* base64 alphabet.</p></li> * base64 alphabet.</p></li>
* *
* <a name="mime"> * <li><a name="mime"><b>MIME</b></a>
* <li><b>MIME</b>
* <p> Uses the "The Base64 Alphabet" as specified in Table 1 of * <p> Uses the "The Base64 Alphabet" as specified in Table 1 of
* RFC 2045 for encoding and decoding operation. The encoded output * RFC 2045 for encoding and decoding operation. The encoded output
* must be represented in lines of no more than 76 characters each * must be represented in lines of no more than 76 characters each
......
...@@ -189,6 +189,7 @@ public class BitSet implements Cloneable, java.io.Serializable { ...@@ -189,6 +189,7 @@ public class BitSet implements Cloneable, java.io.Serializable {
* @param longs a long array containing a little-endian representation * @param longs a long array containing a little-endian representation
* of a sequence of bits to be used as the initial bits of the * of a sequence of bits to be used as the initial bits of the
* new bit set * new bit set
* @return a {@code BitSet} containing all the bits in the long array
* @since 1.7 * @since 1.7
*/ */
public static BitSet valueOf(long[] longs) { public static BitSet valueOf(long[] longs) {
...@@ -212,6 +213,8 @@ public class BitSet implements Cloneable, java.io.Serializable { ...@@ -212,6 +213,8 @@ public class BitSet implements Cloneable, java.io.Serializable {
* @param lb a long buffer containing a little-endian representation * @param lb a long buffer containing a little-endian representation
* of a sequence of bits between its position and limit, to be * of a sequence of bits between its position and limit, to be
* used as the initial bits of the new bit set * used as the initial bits of the new bit set
* @return a {@code BitSet} containing all the bits in the buffer in the
* specified range
* @since 1.7 * @since 1.7
*/ */
public static BitSet valueOf(LongBuffer lb) { public static BitSet valueOf(LongBuffer lb) {
...@@ -237,6 +240,7 @@ public class BitSet implements Cloneable, java.io.Serializable { ...@@ -237,6 +240,7 @@ public class BitSet implements Cloneable, java.io.Serializable {
* @param bytes a byte array containing a little-endian * @param bytes a byte array containing a little-endian
* representation of a sequence of bits to be used as the * representation of a sequence of bits to be used as the
* initial bits of the new bit set * initial bits of the new bit set
* @return a {@code BitSet} containing all the bits in the byte array
* @since 1.7 * @since 1.7
*/ */
public static BitSet valueOf(byte[] bytes) { public static BitSet valueOf(byte[] bytes) {
...@@ -257,6 +261,8 @@ public class BitSet implements Cloneable, java.io.Serializable { ...@@ -257,6 +261,8 @@ public class BitSet implements Cloneable, java.io.Serializable {
* @param bb a byte buffer containing a little-endian representation * @param bb a byte buffer containing a little-endian representation
* of a sequence of bits between its position and limit, to be * of a sequence of bits between its position and limit, to be
* used as the initial bits of the new bit set * used as the initial bits of the new bit set
* @return a {@code BitSet} containing all the bits in the buffer in the
* specified range
* @since 1.7 * @since 1.7
*/ */
public static BitSet valueOf(ByteBuffer bb) { public static BitSet valueOf(ByteBuffer bb) {
......
...@@ -96,7 +96,7 @@ import sun.util.spi.CalendarProvider; ...@@ -96,7 +96,7 @@ import sun.util.spi.CalendarProvider;
* concrete subclass, such as <code>ERA</code>. See individual field * concrete subclass, such as <code>ERA</code>. See individual field
* documentation and subclass documentation for details. * documentation and subclass documentation for details.
* *
* <h4>Getting and Setting Calendar Field Values</h4> * <h3>Getting and Setting Calendar Field Values</h3>
* *
* <p>The calendar field values can be set by calling the <code>set</code> * <p>The calendar field values can be set by calling the <code>set</code>
* methods. Any field values set in a <code>Calendar</code> will not be * methods. Any field values set in a <code>Calendar</code> will not be
...@@ -207,7 +207,7 @@ import sun.util.spi.CalendarProvider; ...@@ -207,7 +207,7 @@ import sun.util.spi.CalendarProvider;
* <h4>Field Manipulation</h4> * <h4>Field Manipulation</h4>
* *
* The calendar fields can be changed using three methods: * The calendar fields can be changed using three methods:
* <code>set()</code>, <code>add()</code>, and <code>roll()</code>.</p> * <code>set()</code>, <code>add()</code>, and <code>roll()</code>.
* *
* <p><strong><code>set(f, value)</code></strong> changes calendar field * <p><strong><code>set(f, value)</code></strong> changes calendar field
* <code>f</code> to <code>value</code>. In addition, it sets an * <code>f</code> to <code>value</code>. In addition, it sets an
...@@ -2024,6 +2024,7 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable<Ca ...@@ -2024,6 +2024,7 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable<Ca
* including cases that the value has been set by internal fields * including cases that the value has been set by internal fields
* calculations triggered by a <code>get</code> method call. * calculations triggered by a <code>get</code> method call.
* *
* @param field the calendar field to test
* @return <code>true</code> if the given calendar field has a value set; * @return <code>true</code> if the given calendar field has a value set;
* <code>false</code> otherwise. * <code>false</code> otherwise.
*/ */
......
...@@ -64,9 +64,9 @@ import java.util.stream.StreamSupport; ...@@ -64,9 +64,9 @@ import java.util.stream.StreamSupport;
* but is not required to, throw the exception if the collection to be added * but is not required to, throw the exception if the collection to be added
* is empty. * is empty.
* *
* <p><a name="optional-restrictions"/> * <p><a name="optional-restrictions">
* Some collection implementations have restrictions on the elements that * Some collection implementations have restrictions on the elements that
* they may contain. For example, some implementations prohibit null elements, * they may contain.</a> For example, some implementations prohibit null elements,
* and some have restrictions on the types of their elements. Attempting to * and some have restrictions on the types of their elements. Attempting to
* add an ineligible element throws an unchecked exception, typically * add an ineligible element throws an unchecked exception, typically
* <tt>NullPointerException</tt> or <tt>ClassCastException</tt>. Attempting * <tt>NullPointerException</tt> or <tt>ClassCastException</tt>. Attempting
...@@ -232,6 +232,7 @@ public interface Collection<E> extends Iterable<E> { ...@@ -232,6 +232,7 @@ public interface Collection<E> extends Iterable<E> {
* Note that <tt>toArray(new Object[0])</tt> is identical in function to * Note that <tt>toArray(new Object[0])</tt> is identical in function to
* <tt>toArray()</tt>. * <tt>toArray()</tt>.
* *
* @param <T> the runtime type of the array to contain the collection
* @param a the array into which the elements of this collection are to be * @param a the array into which the elements of this collection are to be
* stored, if it is big enough; otherwise, a new array of the same * stored, if it is big enough; otherwise, a new array of the same
* runtime type is allocated for this purpose. * runtime type is allocated for this purpose.
...@@ -537,7 +538,6 @@ public interface Collection<E> extends Iterable<E> { ...@@ -537,7 +538,6 @@ public interface Collection<E> extends Iterable<E> {
* @return a {@code Spliterator} over the elements in this collection * @return a {@code Spliterator} over the elements in this collection
* @since 1.8 * @since 1.8
*/ */
@Override
default Spliterator<E> spliterator() { default Spliterator<E> spliterator() {
return Spliterators.spliterator(this, 0); return Spliterators.spliterator(this, 0);
} }
......
...@@ -100,8 +100,10 @@ public abstract class EnumSet<E extends Enum<E>> extends AbstractSet<E> ...@@ -100,8 +100,10 @@ public abstract class EnumSet<E extends Enum<E>> extends AbstractSet<E>
/** /**
* Creates an empty enum set with the specified element type. * Creates an empty enum set with the specified element type.
* *
* @param <E> The class of the elements in the set
* @param elementType the class object of the element type for this enum * @param elementType the class object of the element type for this enum
* set * set
* @return An empty enum set of the specified type.
* @throws NullPointerException if <tt>elementType</tt> is null * @throws NullPointerException if <tt>elementType</tt> is null
*/ */
public static <E extends Enum<E>> EnumSet<E> noneOf(Class<E> elementType) { public static <E extends Enum<E>> EnumSet<E> noneOf(Class<E> elementType) {
...@@ -119,8 +121,10 @@ public abstract class EnumSet<E extends Enum<E>> extends AbstractSet<E> ...@@ -119,8 +121,10 @@ public abstract class EnumSet<E extends Enum<E>> extends AbstractSet<E>
* Creates an enum set containing all of the elements in the specified * Creates an enum set containing all of the elements in the specified
* element type. * element type.
* *
* @param <E> The class of the elements in the set
* @param elementType the class object of the element type for this enum * @param elementType the class object of the element type for this enum
* set * set
* @return An enum set containing all the elements in the specified type.
* @throws NullPointerException if <tt>elementType</tt> is null * @throws NullPointerException if <tt>elementType</tt> is null
*/ */
public static <E extends Enum<E>> EnumSet<E> allOf(Class<E> elementType) { public static <E extends Enum<E>> EnumSet<E> allOf(Class<E> elementType) {
...@@ -139,7 +143,9 @@ public abstract class EnumSet<E extends Enum<E>> extends AbstractSet<E> ...@@ -139,7 +143,9 @@ public abstract class EnumSet<E extends Enum<E>> extends AbstractSet<E>
* Creates an enum set with the same element type as the specified enum * Creates an enum set with the same element type as the specified enum
* set, initially containing the same elements (if any). * set, initially containing the same elements (if any).
* *
* @param <E> The class of the elements in the set
* @param s the enum set from which to initialize this enum set * @param s the enum set from which to initialize this enum set
* @return A copy of the specified enum set.
* @throws NullPointerException if <tt>s</tt> is null * @throws NullPointerException if <tt>s</tt> is null
*/ */
public static <E extends Enum<E>> EnumSet<E> copyOf(EnumSet<E> s) { public static <E extends Enum<E>> EnumSet<E> copyOf(EnumSet<E> s) {
...@@ -153,7 +159,9 @@ public abstract class EnumSet<E extends Enum<E>> extends AbstractSet<E> ...@@ -153,7 +159,9 @@ public abstract class EnumSet<E extends Enum<E>> extends AbstractSet<E>
* Otherwise, the specified collection must contain at least one element * Otherwise, the specified collection must contain at least one element
* (in order to determine the new enum set's element type). * (in order to determine the new enum set's element type).
* *
* @param <E> The class of the elements in the collection
* @param c the collection from which to initialize this enum set * @param c the collection from which to initialize this enum set
* @return An enum set initialized from the given collection.
* @throws IllegalArgumentException if <tt>c</tt> is not an * @throws IllegalArgumentException if <tt>c</tt> is not an
* <tt>EnumSet</tt> instance and contains no elements * <tt>EnumSet</tt> instance and contains no elements
* @throws NullPointerException if <tt>c</tt> is null * @throws NullPointerException if <tt>c</tt> is null
...@@ -178,7 +186,9 @@ public abstract class EnumSet<E extends Enum<E>> extends AbstractSet<E> ...@@ -178,7 +186,9 @@ public abstract class EnumSet<E extends Enum<E>> extends AbstractSet<E>
* set, initially containing all the elements of this type that are * set, initially containing all the elements of this type that are
* <i>not</i> contained in the specified set. * <i>not</i> contained in the specified set.
* *
* @param <E> The class of the elements in the enum set
* @param s the enum set from whose complement to initialize this enum set * @param s the enum set from whose complement to initialize this enum set
* @return The complement of the specified set in this set
* @throws NullPointerException if <tt>s</tt> is null * @throws NullPointerException if <tt>s</tt> is null
*/ */
public static <E extends Enum<E>> EnumSet<E> complementOf(EnumSet<E> s) { public static <E extends Enum<E>> EnumSet<E> complementOf(EnumSet<E> s) {
...@@ -196,6 +206,7 @@ public abstract class EnumSet<E extends Enum<E>> extends AbstractSet<E> ...@@ -196,6 +206,7 @@ public abstract class EnumSet<E extends Enum<E>> extends AbstractSet<E>
* an enum set initially containing an arbitrary number of elements, but * an enum set initially containing an arbitrary number of elements, but
* is likely to run slower than the overloadings that do not use varargs. * is likely to run slower than the overloadings that do not use varargs.
* *
* @param <E> The class of the specified element and of the set
* @param e the element that this set is to contain initially * @param e the element that this set is to contain initially
* @throws NullPointerException if <tt>e</tt> is null * @throws NullPointerException if <tt>e</tt> is null
* @return an enum set initially containing the specified element * @return an enum set initially containing the specified element
...@@ -215,6 +226,7 @@ public abstract class EnumSet<E extends Enum<E>> extends AbstractSet<E> ...@@ -215,6 +226,7 @@ public abstract class EnumSet<E extends Enum<E>> extends AbstractSet<E>
* an enum set initially containing an arbitrary number of elements, but * an enum set initially containing an arbitrary number of elements, but
* is likely to run slower than the overloadings that do not use varargs. * is likely to run slower than the overloadings that do not use varargs.
* *
* @param <E> The class of the parameter elements and of the set
* @param e1 an element that this set is to contain initially * @param e1 an element that this set is to contain initially
* @param e2 another element that this set is to contain initially * @param e2 another element that this set is to contain initially
* @throws NullPointerException if any parameters are null * @throws NullPointerException if any parameters are null
...@@ -236,6 +248,7 @@ public abstract class EnumSet<E extends Enum<E>> extends AbstractSet<E> ...@@ -236,6 +248,7 @@ public abstract class EnumSet<E extends Enum<E>> extends AbstractSet<E>
* an enum set initially containing an arbitrary number of elements, but * an enum set initially containing an arbitrary number of elements, but
* is likely to run slower than the overloadings that do not use varargs. * is likely to run slower than the overloadings that do not use varargs.
* *
* @param <E> The class of the parameter elements and of the set
* @param e1 an element that this set is to contain initially * @param e1 an element that this set is to contain initially
* @param e2 another element that this set is to contain initially * @param e2 another element that this set is to contain initially
* @param e3 another element that this set is to contain initially * @param e3 another element that this set is to contain initially
...@@ -259,6 +272,7 @@ public abstract class EnumSet<E extends Enum<E>> extends AbstractSet<E> ...@@ -259,6 +272,7 @@ public abstract class EnumSet<E extends Enum<E>> extends AbstractSet<E>
* an enum set initially containing an arbitrary number of elements, but * an enum set initially containing an arbitrary number of elements, but
* is likely to run slower than the overloadings that do not use varargs. * is likely to run slower than the overloadings that do not use varargs.
* *
* @param <E> The class of the parameter elements and of the set
* @param e1 an element that this set is to contain initially * @param e1 an element that this set is to contain initially
* @param e2 another element that this set is to contain initially * @param e2 another element that this set is to contain initially
* @param e3 another element that this set is to contain initially * @param e3 another element that this set is to contain initially
...@@ -284,6 +298,7 @@ public abstract class EnumSet<E extends Enum<E>> extends AbstractSet<E> ...@@ -284,6 +298,7 @@ public abstract class EnumSet<E extends Enum<E>> extends AbstractSet<E>
* an enum set initially containing an arbitrary number of elements, but * an enum set initially containing an arbitrary number of elements, but
* is likely to run slower than the overloadings that do not use varargs. * is likely to run slower than the overloadings that do not use varargs.
* *
* @param <E> The class of the parameter elements and of the set
* @param e1 an element that this set is to contain initially * @param e1 an element that this set is to contain initially
* @param e2 another element that this set is to contain initially * @param e2 another element that this set is to contain initially
* @param e3 another element that this set is to contain initially * @param e3 another element that this set is to contain initially
...@@ -311,6 +326,7 @@ public abstract class EnumSet<E extends Enum<E>> extends AbstractSet<E> ...@@ -311,6 +326,7 @@ public abstract class EnumSet<E extends Enum<E>> extends AbstractSet<E>
* number of elements, but it is likely to run slower than the overloadings * number of elements, but it is likely to run slower than the overloadings
* that do not use varargs. * that do not use varargs.
* *
* @param <E> The class of the parameter elements and of the set
* @param first an element that the set is to contain initially * @param first an element that the set is to contain initially
* @param rest the remaining elements the set is to contain initially * @param rest the remaining elements the set is to contain initially
* @throws NullPointerException if any of the specified elements are null, * @throws NullPointerException if any of the specified elements are null,
...@@ -332,6 +348,7 @@ public abstract class EnumSet<E extends Enum<E>> extends AbstractSet<E> ...@@ -332,6 +348,7 @@ public abstract class EnumSet<E extends Enum<E>> extends AbstractSet<E>
* contain the endpoints themselves, which may be identical but must not * contain the endpoints themselves, which may be identical but must not
* be out of order. * be out of order.
* *
* @param <E> The class of the parameter elements and of the set
* @param from the first element in the range * @param from the first element in the range
* @param to the last element in the range * @param to the last element in the range
* @throws NullPointerException if {@code from} or {@code to} are null * @throws NullPointerException if {@code from} or {@code to} are null
......
...@@ -94,7 +94,7 @@ import sun.util.calendar.ZoneInfo; ...@@ -94,7 +94,7 @@ import sun.util.calendar.ZoneInfo;
* adjustment may be made if desired for dates that are prior to the Gregorian * adjustment may be made if desired for dates that are prior to the Gregorian
* changeover and which fall between January 1 and March 24. * changeover and which fall between January 1 and March 24.
* *
* <h4><a name="week_and_year">Week Of Year and Week Year</a></h4> * <h3><a name="week_and_year">Week Of Year and Week Year</a></h3>
* *
* <p>Values calculated for the {@link Calendar#WEEK_OF_YEAR * <p>Values calculated for the {@link Calendar#WEEK_OF_YEAR
* WEEK_OF_YEAR} field range from 1 to 53. The first week of a * WEEK_OF_YEAR} field range from 1 to 53. The first week of a
......
...@@ -84,7 +84,7 @@ import sun.util.locale.provider.ResourceBundleBasedAdapter; ...@@ -84,7 +84,7 @@ import sun.util.locale.provider.ResourceBundleBasedAdapter;
* described below. * described below.
* *
* <dl> * <dl>
* <dt><a name="def_language"/><b>language</b></dt> * <dt><a name="def_language"><b>language</b></a></dt>
* *
* <dd>ISO 639 alpha-2 or alpha-3 language code, or registered * <dd>ISO 639 alpha-2 or alpha-3 language code, or registered
* language subtags up to 8 alpha letters (for future enhancements). * language subtags up to 8 alpha letters (for future enhancements).
...@@ -92,51 +92,51 @@ import sun.util.locale.provider.ResourceBundleBasedAdapter; ...@@ -92,51 +92,51 @@ import sun.util.locale.provider.ResourceBundleBasedAdapter;
* alpha-2 code must be used. You can find a full list of valid * alpha-2 code must be used. You can find a full list of valid
* language codes in the IANA Language Subtag Registry (search for * language codes in the IANA Language Subtag Registry (search for
* "Type: language"). The language field is case insensitive, but * "Type: language"). The language field is case insensitive, but
* <code>Locale</code> always canonicalizes to lower case.</dd><br> * <code>Locale</code> always canonicalizes to lower case.</dd>
* *
* <dd>Well-formed language values have the form * <dd>Well-formed language values have the form
* <code>[a-zA-Z]{2,8}</code>. Note that this is not the the full * <code>[a-zA-Z]{2,8}</code>. Note that this is not the the full
* BCP47 language production, since it excludes extlang. They are * BCP47 language production, since it excludes extlang. They are
* not needed since modern three-letter language codes replace * not needed since modern three-letter language codes replace
* them.</dd><br> * them.</dd>
* *
* <dd>Example: "en" (English), "ja" (Japanese), "kok" (Konkani)</dd><br> * <dd>Example: "en" (English), "ja" (Japanese), "kok" (Konkani)</dd>
* *
* <dt><a name="def_script"/><b>script</b></dt> * <dt><a name="def_script"><b>script</b></a></dt>
* *
* <dd>ISO 15924 alpha-4 script code. You can find a full list of * <dd>ISO 15924 alpha-4 script code. You can find a full list of
* valid script codes in the IANA Language Subtag Registry (search * valid script codes in the IANA Language Subtag Registry (search
* for "Type: script"). The script field is case insensitive, but * for "Type: script"). The script field is case insensitive, but
* <code>Locale</code> always canonicalizes to title case (the first * <code>Locale</code> always canonicalizes to title case (the first
* letter is upper case and the rest of the letters are lower * letter is upper case and the rest of the letters are lower
* case).</dd><br> * case).</dd>
* *
* <dd>Well-formed script values have the form * <dd>Well-formed script values have the form
* <code>[a-zA-Z]{4}</code></dd><br> * <code>[a-zA-Z]{4}</code></dd>
* *
* <dd>Example: "Latn" (Latin), "Cyrl" (Cyrillic)</dd><br> * <dd>Example: "Latn" (Latin), "Cyrl" (Cyrillic)</dd>
* *
* <dt><a name="def_region"/><b>country (region)</b></dt> * <dt><a name="def_region"><b>country (region)</b></a></dt>
* *
* <dd>ISO 3166 alpha-2 country code or UN M.49 numeric-3 area code. * <dd>ISO 3166 alpha-2 country code or UN M.49 numeric-3 area code.
* You can find a full list of valid country and region codes in the * You can find a full list of valid country and region codes in the
* IANA Language Subtag Registry (search for "Type: region"). The * IANA Language Subtag Registry (search for "Type: region"). The
* country (region) field is case insensitive, but * country (region) field is case insensitive, but
* <code>Locale</code> always canonicalizes to upper case.</dd><br> * <code>Locale</code> always canonicalizes to upper case.</dd>
* *
* <dd>Well-formed country/region values have * <dd>Well-formed country/region values have
* the form <code>[a-zA-Z]{2} | [0-9]{3}</code></dd><br> * the form <code>[a-zA-Z]{2} | [0-9]{3}</code></dd>
* *
* <dd>Example: "US" (United States), "FR" (France), "029" * <dd>Example: "US" (United States), "FR" (France), "029"
* (Caribbean)</dd><br> * (Caribbean)</dd>
* *
* <dt><a name="def_variant"/><b>variant</b></dt> * <dt><a name="def_variant"><b>variant</b></a></dt>
* *
* <dd>Any arbitrary value used to indicate a variation of a * <dd>Any arbitrary value used to indicate a variation of a
* <code>Locale</code>. Where there are two or more variant values * <code>Locale</code>. Where there are two or more variant values
* each indicating its own semantics, these values should be ordered * each indicating its own semantics, these values should be ordered
* by importance, with most important first, separated by * by importance, with most important first, separated by
* underscore('_'). The variant field is case sensitive.</dd><br> * underscore('_'). The variant field is case sensitive.</dd>
* *
* <dd>Note: IETF BCP 47 places syntactic restrictions on variant * <dd>Note: IETF BCP 47 places syntactic restrictions on variant
* subtags. Also BCP 47 subtags are strictly used to indicate * subtags. Also BCP 47 subtags are strictly used to indicate
...@@ -152,16 +152,16 @@ import sun.util.locale.provider.ResourceBundleBasedAdapter; ...@@ -152,16 +152,16 @@ import sun.util.locale.provider.ResourceBundleBasedAdapter;
* cultural behaviors such as calendar type or number script. In * cultural behaviors such as calendar type or number script. In
* BCP 47 this kind of information, which does not identify the * BCP 47 this kind of information, which does not identify the
* language, is supported by extension subtags or private use * language, is supported by extension subtags or private use
* subtags.</dd><br> * subtags.</dd>
* *
* <dd>Well-formed variant values have the form <code>SUBTAG * <dd>Well-formed variant values have the form <code>SUBTAG
* (('_'|'-') SUBTAG)*</code> where <code>SUBTAG = * (('_'|'-') SUBTAG)*</code> where <code>SUBTAG =
* [0-9][0-9a-zA-Z]{3} | [0-9a-zA-Z]{5,8}</code>. (Note: BCP 47 only * [0-9][0-9a-zA-Z]{3} | [0-9a-zA-Z]{5,8}</code>. (Note: BCP 47 only
* uses hyphen ('-') as a delimiter, this is more lenient).</dd><br> * uses hyphen ('-') as a delimiter, this is more lenient).</dd>
* *
* <dd>Example: "polyton" (Polytonic Greek), "POSIX"</dd><br> * <dd>Example: "polyton" (Polytonic Greek), "POSIX"</dd>
* *
* <dt><a name="def_extensions"/><b>extensions</b></dt> * <dt><a name="def_extensions"><b>extensions</b></a></dt>
* *
* <dd>A map from single character keys to string values, indicating * <dd>A map from single character keys to string values, indicating
* extensions apart from language identification. The extensions in * extensions apart from language identification. The extensions in
...@@ -169,14 +169,14 @@ import sun.util.locale.provider.ResourceBundleBasedAdapter; ...@@ -169,14 +169,14 @@ import sun.util.locale.provider.ResourceBundleBasedAdapter;
* extension subtags and private use subtags. The extensions are * extension subtags and private use subtags. The extensions are
* case insensitive, but <code>Locale</code> canonicalizes all * case insensitive, but <code>Locale</code> canonicalizes all
* extension keys and values to lower case. Note that extensions * extension keys and values to lower case. Note that extensions
* cannot have empty values.</dd><br> * cannot have empty values.</dd>
* *
* <dd>Well-formed keys are single characters from the set * <dd>Well-formed keys are single characters from the set
* <code>[0-9a-zA-Z]</code>. Well-formed values have the form * <code>[0-9a-zA-Z]</code>. Well-formed values have the form
* <code>SUBTAG ('-' SUBTAG)*</code> where for the key 'x' * <code>SUBTAG ('-' SUBTAG)*</code> where for the key 'x'
* <code>SUBTAG = [0-9a-zA-Z]{1,8}</code> and for other keys * <code>SUBTAG = [0-9a-zA-Z]{1,8}</code> and for other keys
* <code>SUBTAG = [0-9a-zA-Z]{2,8}</code> (that is, 'x' allows * <code>SUBTAG = [0-9a-zA-Z]{2,8}</code> (that is, 'x' allows
* single-character subtags).</dd><br> * single-character subtags).</dd>
* *
* <dd>Example: key="u"/value="ca-japanese" (Japanese Calendar), * <dd>Example: key="u"/value="ca-japanese" (Japanese Calendar),
* key="x"/value="java-1-7"</dd> * key="x"/value="java-1-7"</dd>
...@@ -189,7 +189,7 @@ import sun.util.locale.provider.ResourceBundleBasedAdapter; ...@@ -189,7 +189,7 @@ import sun.util.locale.provider.ResourceBundleBasedAdapter;
* requirement (is well-formed), but does not validate the value * requirement (is well-formed), but does not validate the value
* itself. See {@link Builder} for details. * itself. See {@link Builder} for details.
* *
* <h4><a name="def_locale_extension">Unicode locale/language extension</h4> * <h3><a name="def_locale_extension">Unicode locale/language extension</a></h3>
* *
* <p>UTS#35, "Unicode Locale Data Markup Language" defines optional * <p>UTS#35, "Unicode Locale Data Markup Language" defines optional
* attributes and keywords to override or refine the default behavior * attributes and keywords to override or refine the default behavior
...@@ -409,7 +409,7 @@ import sun.util.locale.provider.ResourceBundleBasedAdapter; ...@@ -409,7 +409,7 @@ import sun.util.locale.provider.ResourceBundleBasedAdapter;
* Clients desiring a string representation of the complete locale can * Clients desiring a string representation of the complete locale can
* then always rely on <code>toLanguageTag</code> for this purpose. * then always rely on <code>toLanguageTag</code> for this purpose.
* *
* <h5><a name="special_cases_constructor"/>Special cases</h5> * <h5><a name="special_cases_constructor">Special cases</a></h5>
* *
* <p>For compatibility reasons, two * <p>For compatibility reasons, two
* non-conforming locales are treated as special cases. These are * non-conforming locales are treated as special cases. These are
...@@ -1007,6 +1007,8 @@ public final class Locale implements Cloneable, Serializable { ...@@ -1007,6 +1007,8 @@ public final class Locale implements Cloneable, Serializable {
* country (region), such as 3-letter numeric UN M.49 area codes. * country (region), such as 3-letter numeric UN M.49 area codes.
* Therefore, the list returned by this method does not contain ALL valid * Therefore, the list returned by this method does not contain ALL valid
* codes that can be used to create Locales. * codes that can be used to create Locales.
*
* @return An array of ISO 3166 two-letter country codes.
*/ */
public static String[] getISOCountries() { public static String[] getISOCountries() {
if (isoCountries == null) { if (isoCountries == null) {
...@@ -1030,6 +1032,8 @@ public final class Locale implements Cloneable, Serializable { ...@@ -1030,6 +1032,8 @@ public final class Locale implements Cloneable, Serializable {
* 8 characters in length. Therefore, the list returned by this method does * 8 characters in length. Therefore, the list returned by this method does
* not contain ALL valid codes that can be used to create Locales. * not contain ALL valid codes that can be used to create Locales.
* </ul> * </ul>
*
* @return Am array of ISO 639 two-letter language codes.
*/ */
public static String[] getISOLanguages() { public static String[] getISOLanguages() {
if (isoLanguages == null) { if (isoLanguages == null) {
...@@ -1268,15 +1272,15 @@ public final class Locale implements Cloneable, Serializable { ...@@ -1268,15 +1272,15 @@ public final class Locale implements Cloneable, Serializable {
* fields only. To represent a Locale as a String for interchange purposes, use * fields only. To represent a Locale as a String for interchange purposes, use
* {@link #toLanguageTag}. * {@link #toLanguageTag}.
* *
* <p>Examples: <ul><tt> * <p>Examples: <ul>
* <li>en * <li><tt>en</tt></li>
* <li>de_DE * <li><tt>de_DE</tt></li>
* <li>_GB * <li><tt>_GB</tt></li>
* <li>en_US_WIN * <li><tt>en_US_WIN</tt></li>
* <li>de__POSIX * <li><tt>de__POSIX</tt></li>
* <li>zh_CN_#Hans * <li><tt>zh_CN_#Hans</tt></li>
* <li>zh_TW_#Hant-x-java * <li><tt>zh_TW_#Hant-x-java</tt></li>
* <li>th_TH_TH_#u-nu-thai</tt></ul> * <li><tt>th_TH_TH_#u-nu-thai</tt></li></ul>
* *
* @return A string representation of the Locale, for debugging. * @return A string representation of the Locale, for debugging.
* @see #getDisplayName * @see #getDisplayName
...@@ -1506,7 +1510,7 @@ public final class Locale implements Cloneable, Serializable { ...@@ -1506,7 +1510,7 @@ public final class Locale implements Cloneable, Serializable {
* *
* <p>Grandfathered tags with canonical replacements are as follows: * <p>Grandfathered tags with canonical replacements are as follows:
* *
* <table> * <table summary="Grandfathered tags with canonical replacements">
* <tbody align="center"> * <tbody align="center">
* <tr><th>grandfathered tag</th><th>&nbsp;</th><th>modern replacement</th></tr> * <tr><th>grandfathered tag</th><th>&nbsp;</th><th>modern replacement</th></tr>
* <tr><td>art-lojban</td><td>&nbsp;</td><td>jbo</td></tr> * <tr><td>art-lojban</td><td>&nbsp;</td><td>jbo</td></tr>
...@@ -1535,7 +1539,7 @@ public final class Locale implements Cloneable, Serializable { ...@@ -1535,7 +1539,7 @@ public final class Locale implements Cloneable, Serializable {
* <p>Grandfathered tags with no modern replacement will be * <p>Grandfathered tags with no modern replacement will be
* converted as follows: * converted as follows:
* *
* <table> * <table summary="Grandfathered tags with no modern replacement">
* <tbody align="center"> * <tbody align="center">
* <tr><th>grandfathered tag</th><th>&nbsp;</th><th>converts to</th></tr> * <tr><th>grandfathered tag</th><th>&nbsp;</th><th>converts to</th></tr>
* <tr><td>cel-gaulish</td><td>&nbsp;</td><td>xtg-x-cel-gaulish</td></tr> * <tr><td>cel-gaulish</td><td>&nbsp;</td><td>xtg-x-cel-gaulish</td></tr>
...@@ -1659,6 +1663,8 @@ public final class Locale implements Cloneable, Serializable { ...@@ -1659,6 +1663,8 @@ public final class Locale implements Cloneable, Serializable {
* (say, we don't have a Japanese name for Croatian), * (say, we don't have a Japanese name for Croatian),
* this function falls back on the English name, and uses the ISO code as a last-resort * this function falls back on the English name, and uses the ISO code as a last-resort
* value. If the locale doesn't specify a language, this function returns the empty string. * value. If the locale doesn't specify a language, this function returns the empty string.
*
* @return The name of the display language.
*/ */
public final String getDisplayLanguage() { public final String getDisplayLanguage() {
return getDisplayLanguage(getDefault(Category.DISPLAY)); return getDisplayLanguage(getDefault(Category.DISPLAY));
...@@ -1677,6 +1683,8 @@ public final class Locale implements Cloneable, Serializable { ...@@ -1677,6 +1683,8 @@ public final class Locale implements Cloneable, Serializable {
* on the ISO code as a last-resort value. If the locale doesn't specify a language, * on the ISO code as a last-resort value. If the locale doesn't specify a language,
* this function returns the empty string. * this function returns the empty string.
* *
* @param inLocale The locale for which to retrieve the display language.
* @return The name of the display language appropriate to the given locale.
* @exception NullPointerException if <code>inLocale</code> is <code>null</code> * @exception NullPointerException if <code>inLocale</code> is <code>null</code>
*/ */
public String getDisplayLanguage(Locale inLocale) { public String getDisplayLanguage(Locale inLocale) {
...@@ -1703,6 +1711,7 @@ public final class Locale implements Cloneable, Serializable { ...@@ -1703,6 +1711,7 @@ public final class Locale implements Cloneable, Serializable {
* localized for the given locale. Returns the empty string if * localized for the given locale. Returns the empty string if
* this locale doesn't specify a script code. * this locale doesn't specify a script code.
* *
* @param inLocale The locale for which to retrieve the display script.
* @return the display name of the script code for the current default * @return the display name of the script code for the current default
* {@link Locale.Category#DISPLAY DISPLAY} locale * {@link Locale.Category#DISPLAY DISPLAY} locale
* @throws NullPointerException if <code>inLocale</code> is <code>null</code> * @throws NullPointerException if <code>inLocale</code> is <code>null</code>
...@@ -1727,6 +1736,8 @@ public final class Locale implements Cloneable, Serializable { ...@@ -1727,6 +1736,8 @@ public final class Locale implements Cloneable, Serializable {
* (say, we don't have a Japanese name for Croatia), * (say, we don't have a Japanese name for Croatia),
* this function falls back on the English name, and uses the ISO code as a last-resort * this function falls back on the English name, and uses the ISO code as a last-resort
* value. If the locale doesn't specify a country, this function returns the empty string. * value. If the locale doesn't specify a country, this function returns the empty string.
*
* @return The name of the country appropriate to the locale.
*/ */
public final String getDisplayCountry() { public final String getDisplayCountry() {
return getDisplayCountry(getDefault(Category.DISPLAY)); return getDisplayCountry(getDefault(Category.DISPLAY));
...@@ -1745,6 +1756,8 @@ public final class Locale implements Cloneable, Serializable { ...@@ -1745,6 +1756,8 @@ public final class Locale implements Cloneable, Serializable {
* on the ISO code as a last-resort value. If the locale doesn't specify a country, * on the ISO code as a last-resort value. If the locale doesn't specify a country,
* this function returns the empty string. * this function returns the empty string.
* *
* @param inLocale The locale for which to retrieve the display country.
* @return The name of the country appropriate to the given locale.
* @exception NullPointerException if <code>inLocale</code> is <code>null</code> * @exception NullPointerException if <code>inLocale</code> is <code>null</code>
*/ */
public String getDisplayCountry(Locale inLocale) { public String getDisplayCountry(Locale inLocale) {
...@@ -1778,6 +1791,8 @@ public final class Locale implements Cloneable, Serializable { ...@@ -1778,6 +1791,8 @@ public final class Locale implements Cloneable, Serializable {
* user. If possible, the name will be localized for the default * user. If possible, the name will be localized for the default
* {@link Locale.Category#DISPLAY DISPLAY} locale. If the locale * {@link Locale.Category#DISPLAY DISPLAY} locale. If the locale
* doesn't specify a variant code, this function returns the empty string. * doesn't specify a variant code, this function returns the empty string.
*
* @return The name of the display variant code appropriate to the locale.
*/ */
public final String getDisplayVariant() { public final String getDisplayVariant() {
return getDisplayVariant(getDefault(Category.DISPLAY)); return getDisplayVariant(getDefault(Category.DISPLAY));
...@@ -1788,6 +1803,8 @@ public final class Locale implements Cloneable, Serializable { ...@@ -1788,6 +1803,8 @@ public final class Locale implements Cloneable, Serializable {
* user. If possible, the name will be localized for inLocale. If the locale * user. If possible, the name will be localized for inLocale. If the locale
* doesn't specify a variant code, this function returns the empty string. * doesn't specify a variant code, this function returns the empty string.
* *
* @param inLocale The locale for which to retrieve the display variant code.
* @return The name of the display variant code appropriate to the given locale.
* @exception NullPointerException if <code>inLocale</code> is <code>null</code> * @exception NullPointerException if <code>inLocale</code> is <code>null</code>
*/ */
public String getDisplayVariant(Locale inLocale) { public String getDisplayVariant(Locale inLocale) {
...@@ -1821,6 +1838,8 @@ public final class Locale implements Cloneable, Serializable { ...@@ -1821,6 +1838,8 @@ public final class Locale implements Cloneable, Serializable {
* depending on which fields are specified in the locale. If the * depending on which fields are specified in the locale. If the
* language, sacript, country, and variant fields are all empty, * language, sacript, country, and variant fields are all empty,
* this function returns the empty string. * this function returns the empty string.
*
* @return The name of the locale appropriate to display.
*/ */
public final String getDisplayName() { public final String getDisplayName() {
return getDisplayName(getDefault(Category.DISPLAY)); return getDisplayName(getDefault(Category.DISPLAY));
...@@ -1844,6 +1863,8 @@ public final class Locale implements Cloneable, Serializable { ...@@ -1844,6 +1863,8 @@ public final class Locale implements Cloneable, Serializable {
* language, script, country, and variant fields are all empty, * language, script, country, and variant fields are all empty,
* this function returns the empty string. * this function returns the empty string.
* *
* @param inLocale The locale for which to retrieve the display name.
* @return The name of the locale appropriate to display.
* @throws NullPointerException if <code>inLocale</code> is <code>null</code> * @throws NullPointerException if <code>inLocale</code> is <code>null</code>
*/ */
public String getDisplayName(Locale inLocale) { public String getDisplayName(Locale inLocale) {
...@@ -2672,7 +2693,7 @@ public final class Locale implements Cloneable, Serializable { ...@@ -2672,7 +2693,7 @@ public final class Locale implements Cloneable, Serializable {
* *
* The filtering method will behave as follows: * The filtering method will behave as follows:
* *
* <table cellpadding=2> * <table cellpadding=2 summary="Filtering method behavior">
* <tr> * <tr>
* <th>Filtering Mode</th> * <th>Filtering Mode</th>
* <th>Language Priority List: {@code "de-DE"}</th> * <th>Language Priority List: {@code "de-DE"}</th>
......
...@@ -74,7 +74,7 @@ import sun.util.locale.LocaleObjectCache; ...@@ -74,7 +74,7 @@ import sun.util.locale.LocaleObjectCache;
* *
* <p> * <p>
* This allows you to write programs that can: * This allows you to write programs that can:
* <UL type=SQUARE> * <UL>
* <LI> be easily localized, or translated, into different languages * <LI> be easily localized, or translated, into different languages
* <LI> handle multiple locales at once * <LI> handle multiple locales at once
* <LI> be easily modified later to support even more locales * <LI> be easily modified later to support even more locales
...@@ -184,7 +184,7 @@ import sun.util.locale.LocaleObjectCache; ...@@ -184,7 +184,7 @@ import sun.util.locale.LocaleObjectCache;
* subclass. Your subclasses must override two methods: <code>handleGetObject</code> * subclass. Your subclasses must override two methods: <code>handleGetObject</code>
* and <code>getKeys()</code>. * and <code>getKeys()</code>.
* *
* <h4>ResourceBundle.Control</h4> * <h3>ResourceBundle.Control</h3>
* *
* The {@link ResourceBundle.Control} class provides information necessary * The {@link ResourceBundle.Control} class provides information necessary
* to perform the bundle loading process by the <code>getBundle</code> * to perform the bundle loading process by the <code>getBundle</code>
...@@ -195,7 +195,7 @@ import sun.util.locale.LocaleObjectCache; ...@@ -195,7 +195,7 @@ import sun.util.locale.LocaleObjectCache;
* {@link #getBundle(String, Locale, ClassLoader, Control) getBundle} * {@link #getBundle(String, Locale, ClassLoader, Control) getBundle}
* factory method for details. * factory method for details.
* *
* <p><a name="modify_default_behavior">For the {@code getBundle} factory * <p><a name="modify_default_behavior">For the {@code getBundle} factory</a>
* methods that take no {@link Control} instance, their <a * methods that take no {@link Control} instance, their <a
* href="#default_behavior"> default behavior</a> of resource bundle loading * href="#default_behavior"> default behavior</a> of resource bundle loading
* can be modified with <em>installed</em> {@link * can be modified with <em>installed</em> {@link
...@@ -206,7 +206,7 @@ import sun.util.locale.LocaleObjectCache; ...@@ -206,7 +206,7 @@ import sun.util.locale.LocaleObjectCache;
* more than one service provider installed for supporting the same base name, * more than one service provider installed for supporting the same base name,
* the first one returned from {@link ServiceLoader} will be used. * the first one returned from {@link ServiceLoader} will be used.
* *
* <h4>Cache Management</h4> * <h3>Cache Management</h3>
* *
* Resource bundle instances created by the <code>getBundle</code> factory * Resource bundle instances created by the <code>getBundle</code> factory
* methods are cached by default, and the factory methods return the same * methods are cached by default, and the factory methods return the same
...@@ -222,7 +222,7 @@ import sun.util.locale.LocaleObjectCache; ...@@ -222,7 +222,7 @@ import sun.util.locale.LocaleObjectCache;
* Control#needsReload(String, Locale, String, ClassLoader, ResourceBundle, * Control#needsReload(String, Locale, String, ClassLoader, ResourceBundle,
* long) ResourceBundle.Control.needsReload} for details. * long) ResourceBundle.Control.needsReload} for details.
* *
* <h4>Example</h4> * <h3>Example</h3>
* *
* The following is a very simple example of a <code>ResourceBundle</code> * The following is a very simple example of a <code>ResourceBundle</code>
* subclass, <code>MyResources</code>, that manages two resources (for a larger number of * subclass, <code>MyResources</code>, that manages two resources (for a larger number of
...@@ -878,8 +878,8 @@ public abstract class ResourceBundle { ...@@ -878,8 +878,8 @@ public abstract class ResourceBundle {
* description of <a href="#modify_default_behavior">modifying the default * description of <a href="#modify_default_behavior">modifying the default
* behavior</a>. * behavior</a>.
* *
* <p><a name="default_behavior"/>The following describes the default * <p><a name="default_behavior">The following describes the default
* behavior. * behavior</a>.
* *
* <p><code>getBundle</code> uses the base name, the specified locale, and * <p><code>getBundle</code> uses the base name, the specified locale, and
* the default locale (obtained from {@link java.util.Locale#getDefault() * the default locale (obtained from {@link java.util.Locale#getDefault()
...@@ -974,8 +974,8 @@ public abstract class ResourceBundle { ...@@ -974,8 +974,8 @@ public abstract class ResourceBundle {
* <p>If still no result bundle is found, the base name alone is looked up. If * <p>If still no result bundle is found, the base name alone is looked up. If
* this still fails, a <code>MissingResourceException</code> is thrown. * this still fails, a <code>MissingResourceException</code> is thrown.
* *
* <p><a name="parent_chain"/> Once a result resource bundle has been found, * <p><a name="parent_chain"> Once a result resource bundle has been found,
* its <em>parent chain</em> is instantiated. If the result bundle already * its <em>parent chain</em> is instantiated</a>. If the result bundle already
* has a parent (perhaps because it was returned from a cache) the chain is * has a parent (perhaps because it was returned from a cache) the chain is
* complete. * complete.
* *
...@@ -1004,8 +1004,8 @@ public abstract class ResourceBundle { ...@@ -1004,8 +1004,8 @@ public abstract class ResourceBundle {
* path name (using "/") instead of a fully qualified class name (using * path name (using "/") instead of a fully qualified class name (using
* "."). * ".").
* *
* <p><a name="default_behavior_example"/> * <p><a name="default_behavior_example">
* <strong>Example:</strong> * <strong>Example:</strong></a>
* <p> * <p>
* The following class and property files are provided: * The following class and property files are provided:
* <pre> * <pre>
...@@ -1026,7 +1026,7 @@ public abstract class ResourceBundle { ...@@ -1026,7 +1026,7 @@ public abstract class ResourceBundle {
* <p>Calling <code>getBundle</code> with the locale arguments below will * <p>Calling <code>getBundle</code> with the locale arguments below will
* instantiate resource bundles as follows: * instantiate resource bundles as follows:
* *
* <table> * <table summary="getBundle() locale to resource bundle mapping">
* <tr><td>Locale("fr", "CH")</td><td>MyResources_fr_CH.class, parent MyResources_fr.properties, parent MyResources.class</td></tr> * <tr><td>Locale("fr", "CH")</td><td>MyResources_fr_CH.class, parent MyResources_fr.properties, parent MyResources.class</td></tr>
* <tr><td>Locale("fr", "FR")</td><td>MyResources_fr.properties, parent MyResources.class</td></tr> * <tr><td>Locale("fr", "FR")</td><td>MyResources_fr.properties, parent MyResources.class</td></tr>
* <tr><td>Locale("de", "DE")</td><td>MyResources_en.properties, parent MyResources.class</td></tr> * <tr><td>Locale("de", "DE")</td><td>MyResources_en.properties, parent MyResources.class</td></tr>
...@@ -1106,45 +1106,45 @@ public abstract class ResourceBundle { ...@@ -1106,45 +1106,45 @@ public abstract class ResourceBundle {
* <code>control.newBundle</code>. * <code>control.newBundle</code>.
* *
* <table style="width: 50%; text-align: left; margin-left: 40px;" * <table style="width: 50%; text-align: left; margin-left: 40px;"
* border="0" cellpadding="2" cellspacing="2"> * border="0" cellpadding="2" cellspacing="2" summary="locale-format combinations for newBundle">
* <tbody><code> * <tbody>
* <tr> * <tr>
* <td * <td
* style="vertical-align: top; text-align: left; font-weight: bold; width: 50%;">Locale<br> * style="vertical-align: top; text-align: left; font-weight: bold; width: 50%;"><code>Locale</code><br>
* </td> * </td>
* <td * <td
* style="vertical-align: top; text-align: left; font-weight: bold; width: 50%;">format<br> * style="vertical-align: top; text-align: left; font-weight: bold; width: 50%;"><code>format</code><br>
* </td> * </td>
* </tr> * </tr>
* <tr> * <tr>
* <td style="vertical-align: top; width: 50%;">Locale("de", "DE")<br> * <td style="vertical-align: top; width: 50%;"><code>Locale("de", "DE")</code><br>
* </td> * </td>
* <td style="vertical-align: top; width: 50%;">java.class<br> * <td style="vertical-align: top; width: 50%;"><code>java.class</code><br>
* </td> * </td>
* </tr> * </tr>
* <tr> * <tr>
* <td style="vertical-align: top; width: 50%;">Locale("de", "DE")</td> * <td style="vertical-align: top; width: 50%;"><code>Locale("de", "DE")</code></td>
* <td style="vertical-align: top; width: 50%;">java.properties<br> * <td style="vertical-align: top; width: 50%;"><code>java.properties</code><br>
* </td> * </td>
* </tr> * </tr>
* <tr> * <tr>
* <td style="vertical-align: top; width: 50%;">Locale("de")</td> * <td style="vertical-align: top; width: 50%;"><code>Locale("de")</code></td>
* <td style="vertical-align: top; width: 50%;">java.class</td> * <td style="vertical-align: top; width: 50%;"><code>java.class</code></td>
* </tr> * </tr>
* <tr> * <tr>
* <td style="vertical-align: top; width: 50%;">Locale("de")</td> * <td style="vertical-align: top; width: 50%;"><code>Locale("de")</code></td>
* <td style="vertical-align: top; width: 50%;">java.properties</td> * <td style="vertical-align: top; width: 50%;"><code>java.properties</code></td>
* </tr> * </tr>
* <tr> * <tr>
* <td style="vertical-align: top; width: 50%;">Locale("")<br> * <td style="vertical-align: top; width: 50%;"><code>Locale("")</code><br>
* </td> * </td>
* <td style="vertical-align: top; width: 50%;">java.class</td> * <td style="vertical-align: top; width: 50%;"><code>java.class</code></td>
* </tr> * </tr>
* <tr> * <tr>
* <td style="vertical-align: top; width: 50%;">Locale("")</td> * <td style="vertical-align: top; width: 50%;"><code>Locale("")</code></td>
* <td style="vertical-align: top; width: 50%;">java.properties</td> * <td style="vertical-align: top; width: 50%;"><code>java.properties</code></td>
* </tr> * </tr>
* </code></tbody> * </tbody>
* </table> * </table>
* </li> * </li>
* *
...@@ -2199,11 +2199,11 @@ public abstract class ResourceBundle { ...@@ -2199,11 +2199,11 @@ public abstract class ResourceBundle {
* one by one as below: * one by one as below:
* *
* <ul> * <ul>
* <li> [<em>L</em>, <em>C</em>, <em>V</em>] * <li> [<em>L</em>, <em>C</em>, <em>V</em>] </li>
* <li> [<em>L</em>, <em>C</em>] * <li> [<em>L</em>, <em>C</em>] </li>
* <li> [<em>L</em>] * <li> [<em>L</em>] </li>
* <li> <code>Locale.ROOT</code> * <li> <code>Locale.ROOT</code> </li>
* </ul> * </ul></li>
* *
* <li>For an input <code>Locale</code> with a non-empty script value, * <li>For an input <code>Locale</code> with a non-empty script value,
* append candidate <code>Locale</code>s by omitting the final component * append candidate <code>Locale</code>s by omitting the final component
...@@ -2211,14 +2211,14 @@ public abstract class ResourceBundle { ...@@ -2211,14 +2211,14 @@ public abstract class ResourceBundle {
* <code>Locale</code> with country and variant restored: * <code>Locale</code> with country and variant restored:
* *
* <ul> * <ul>
* <li> [<em>L</em>, <em>S</em>, <em>C</em>, <em>V</em>] * <li> [<em>L</em>, <em>S</em>, <em>C</em>, <em>V</em>]</li>
* <li> [<em>L</em>, <em>S</em>, <em>C</em>] * <li> [<em>L</em>, <em>S</em>, <em>C</em>]</li>
* <li> [<em>L</em>, <em>S</em>] * <li> [<em>L</em>, <em>S</em>]</li>
* <li> [<em>L</em>, <em>C</em>, <em>V</em>] * <li> [<em>L</em>, <em>C</em>, <em>V</em>]</li>
* <li> [<em>L</em>, <em>C</em>] * <li> [<em>L</em>, <em>C</em>]</li>
* <li> [<em>L</em>] * <li> [<em>L</em>]</li>
* <li> <code>Locale.ROOT</code> * <li> <code>Locale.ROOT</code></li>
* </ul> * </ul></li>
* *
* <li>For an input <code>Locale</code> with a variant value consisting * <li>For an input <code>Locale</code> with a variant value consisting
* of multiple subtags separated by underscore, generate candidate * of multiple subtags separated by underscore, generate candidate
...@@ -2228,16 +2228,16 @@ public abstract class ResourceBundle { ...@@ -2228,16 +2228,16 @@ public abstract class ResourceBundle {
* the variant consists of two subtags <em>V1</em> and <em>V2</em>: * the variant consists of two subtags <em>V1</em> and <em>V2</em>:
* *
* <ul> * <ul>
* <li> [<em>L</em>, <em>S</em>, <em>C</em>, <em>V1</em>, <em>V2</em>] * <li> [<em>L</em>, <em>S</em>, <em>C</em>, <em>V1</em>, <em>V2</em>]</li>
* <li> [<em>L</em>, <em>S</em>, <em>C</em>, <em>V1</em>] * <li> [<em>L</em>, <em>S</em>, <em>C</em>, <em>V1</em>]</li>
* <li> [<em>L</em>, <em>S</em>, <em>C</em>] * <li> [<em>L</em>, <em>S</em>, <em>C</em>]</li>
* <li> [<em>L</em>, <em>S</em>] * <li> [<em>L</em>, <em>S</em>]</li>
* <li> [<em>L</em>, <em>C</em>, <em>V1</em>, <em>V2</em>] * <li> [<em>L</em>, <em>C</em>, <em>V1</em>, <em>V2</em>]</li>
* <li> [<em>L</em>, <em>C</em>, <em>V1</em>] * <li> [<em>L</em>, <em>C</em>, <em>V1</em>]</li>
* <li> [<em>L</em>, <em>C</em>] * <li> [<em>L</em>, <em>C</em>]</li>
* <li> [<em>L</em>] * <li> [<em>L</em>]</li>
* <li> <code>Locale.ROOT</code> * <li> <code>Locale.ROOT</code></li>
* </ul> * </ul></li>
* *
* <li>Special cases for Chinese. When an input <code>Locale</code> has the * <li>Special cases for Chinese. When an input <code>Locale</code> has the
* language "zh" (Chinese) and an empty script value, either "Hans" (Simplified) or * language "zh" (Chinese) and an empty script value, either "Hans" (Simplified) or
...@@ -2248,21 +2248,21 @@ public abstract class ResourceBundle { ...@@ -2248,21 +2248,21 @@ public abstract class ResourceBundle {
* is empty, no script is supplied. For example, for <code>Locale("zh", "CN") * is empty, no script is supplied. For example, for <code>Locale("zh", "CN")
* </code>, the candidate list will be: * </code>, the candidate list will be:
* <ul> * <ul>
* <li> [<em>L</em>("zh"), <em>S</em>("Hans"), <em>C</em>("CN")] * <li> [<em>L</em>("zh"), <em>S</em>("Hans"), <em>C</em>("CN")]</li>
* <li> [<em>L</em>("zh"), <em>S</em>("Hans")] * <li> [<em>L</em>("zh"), <em>S</em>("Hans")]</li>
* <li> [<em>L</em>("zh"), <em>C</em>("CN")] * <li> [<em>L</em>("zh"), <em>C</em>("CN")]</li>
* <li> [<em>L</em>("zh")] * <li> [<em>L</em>("zh")]</li>
* <li> <code>Locale.ROOT</code> * <li> <code>Locale.ROOT</code></li>
* </ul> * </ul>
* *
* For <code>Locale("zh", "TW")</code>, the candidate list will be: * For <code>Locale("zh", "TW")</code>, the candidate list will be:
* <ul> * <ul>
* <li> [<em>L</em>("zh"), <em>S</em>("Hant"), <em>C</em>("TW")] * <li> [<em>L</em>("zh"), <em>S</em>("Hant"), <em>C</em>("TW")]</li>
* <li> [<em>L</em>("zh"), <em>S</em>("Hant")] * <li> [<em>L</em>("zh"), <em>S</em>("Hant")]</li>
* <li> [<em>L</em>("zh"), <em>C</em>("TW")] * <li> [<em>L</em>("zh"), <em>C</em>("TW")]</li>
* <li> [<em>L</em>("zh")] * <li> [<em>L</em>("zh")]</li>
* <li> <code>Locale.ROOT</code> * <li> <code>Locale.ROOT</code></li>
* </ul> * </ul></li>
* *
* <li>Special cases for Norwegian. Both <code>Locale("no", "NO", * <li>Special cases for Norwegian. Both <code>Locale("no", "NO",
* "NY")</code> and <code>Locale("nn", "NO")</code> represent Norwegian * "NY")</code> and <code>Locale("nn", "NO")</code> represent Norwegian
...@@ -2270,10 +2270,10 @@ public abstract class ResourceBundle { ...@@ -2270,10 +2270,10 @@ public abstract class ResourceBundle {
* list is generated up to [<em>L</em>("nn")], and then the following * list is generated up to [<em>L</em>("nn")], and then the following
* candidates are added: * candidates are added:
* *
* <ul><li> [<em>L</em>("no"), <em>C</em>("NO"), <em>V</em>("NY")] * <ul><li> [<em>L</em>("no"), <em>C</em>("NO"), <em>V</em>("NY")]</li>
* <li> [<em>L</em>("no"), <em>C</em>("NO")] * <li> [<em>L</em>("no"), <em>C</em>("NO")]</li>
* <li> [<em>L</em>("no")] * <li> [<em>L</em>("no")]</li>
* <li> <code>Locale.ROOT</code> * <li> <code>Locale.ROOT</code></li>
* </ul> * </ul>
* *
* If the locale is exactly <code>Locale("no", "NO", "NY")</code>, it is first * If the locale is exactly <code>Locale("no", "NO", "NY")</code>, it is first
...@@ -2290,20 +2290,18 @@ public abstract class ResourceBundle { ...@@ -2290,20 +2290,18 @@ public abstract class ResourceBundle {
* candidate list: * candidate list:
* *
* <ul> * <ul>
* <li> [<em>L</em>("nb"), <em>C</em>("NO"), <em>V</em>("POSIX")] * <li> [<em>L</em>("nb"), <em>C</em>("NO"), <em>V</em>("POSIX")]</li>
* <li> [<em>L</em>("no"), <em>C</em>("NO"), <em>V</em>("POSIX")] * <li> [<em>L</em>("no"), <em>C</em>("NO"), <em>V</em>("POSIX")]</li>
* <li> [<em>L</em>("nb"), <em>C</em>("NO")] * <li> [<em>L</em>("nb"), <em>C</em>("NO")]</li>
* <li> [<em>L</em>("no"), <em>C</em>("NO")] * <li> [<em>L</em>("no"), <em>C</em>("NO")]</li>
* <li> [<em>L</em>("nb")] * <li> [<em>L</em>("nb")]</li>
* <li> [<em>L</em>("no")] * <li> [<em>L</em>("no")]</li>
* <li> <code>Locale.ROOT</code> * <li> <code>Locale.ROOT</code></li>
* </ul> * </ul>
* *
* <code>Locale("no", "NO", "POSIX")</code> would generate the same list * <code>Locale("no", "NO", "POSIX")</code> would generate the same list
* except that locales with "no" would appear before the corresponding * except that locales with "no" would appear before the corresponding
* locales with "nb".</li> * locales with "nb".</li>
*
* </li>
* </ol> * </ol>
* *
* <p>The default implementation uses an {@link ArrayList} that * <p>The default implementation uses an {@link ArrayList} that
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册