changeset 7788:1b67c524ecb9

Javadoc for serializability on returned Comparator
author henryjen
date Mon, 01 Apr 2013 14:22:07 -0700
parents 62d2a1511961
children 7225a758c172
files src/share/classes/java/util/Comparators.java
diffstat 1 files changed, 16 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/util/Comparators.java	Mon Apr 01 13:45:28 2013 -0700
+++ b/src/share/classes/java/util/Comparators.java	Mon Apr 01 14:22:07 2013 -0700
@@ -79,6 +79,8 @@
     /**
      * Gets a comparator compares {@link Comparable} type in natural order.
      *
+     * <p>The returned comparator is serializable.
+     *
      * @param  <T> {@link Comparable} type
      * @return A comparator that imposes the <i>natural ordering</i> on a
      *         collection of objects that implement the {@link Comparable}
@@ -91,6 +93,8 @@
     /**
      * Gets a comparator compares {@link Map.Entry} in natural order on key.
      *
+     * <p>The returned comparator is serializable.
+     *
      * @param  <K> {@link Comparable} key type
      * @param  <V> value type
      * @return A comparator compares {@link Map.Entry} in natural order on key.
@@ -103,6 +107,8 @@
     /**
      * Gets a comparator compares {@link Map.Entry} in natural order on value.
      *
+     * <p>The returned comparator is serializable.
+     *
      * @param <K> key type
      * @param <V> {@link Comparable} value type
      * @return A comparator compares {@link Map.Entry} in natural order on value.
@@ -117,7 +123,7 @@
      * {@link Comparator}.
      *
      * <p>The returned comparator is serializable assuming the specified
-     * comparators are also serializable.
+     * comparator is also serializable.
      *
      * @param  <K> key type
      * @param  <V> value type
@@ -134,6 +140,9 @@
      * Gets a comparator compares {@link Map.Entry} by value using the given
      * {@link Comparator}.
      *
+     * <p>The returned comparator is serializable assuming the specified
+     * comparator is also serializable.
+     *
      * @param  <K> key type
      * @param  <V> value type
      * @param  cmp the value {@link Comparator}
@@ -154,6 +163,9 @@
      * return a {@code Comparator<Person>} that compares {@code Person}
      * objects by their last name ignoring case differences.
      *
+     * <p> The returned comparator is serializable assuming the specified
+     * function and comparator are both serializable.
+     *
      * @param  <T> the original element type
      * @param  <U> the type for comparison
      * @param  keyExtractor the function used to extract the sort key
@@ -177,6 +189,9 @@
      * Comparator<Person>} that compares {@code Person} objects by their last
      * name.
      *
+     * <p> The returned comparator is serializable assuming the specified
+     * function is also serializable.
+     *
      * @param  <T> the original element type
      * @param  <U> the {@link Comparable} type for comparison
      * @param  keyExtractor the function used to extract the {@link Comparable} sort key