You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by tn...@apache.org on 2013/01/21 13:33:11 UTC
svn commit: r1436305 -
/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/ComparatorUtils.java
Author: tn
Date: Mon Jan 21 12:33:10 2013
New Revision: 1436305
URL: http://svn.apache.org/viewvc?rev=1436305&view=rev
Log:
Add generic type description in javadoc.
Modified:
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/ComparatorUtils.java
Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/ComparatorUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/ComparatorUtils.java?rev=1436305&r1=1436304&r2=1436305&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/ComparatorUtils.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/ComparatorUtils.java Mon Jan 21 12:33:10 2013
@@ -57,6 +57,7 @@ public class ComparatorUtils {
/**
* Gets a comparator that uses the natural order of the objects.
*
+ * @param <E> the object type to compare
* @return a comparator which uses natural order
*/
@SuppressWarnings("unchecked")
@@ -69,6 +70,7 @@ public class ComparatorUtils {
* <p>
* The second comparator is used if the first comparator returns equal.
*
+ * @param <E> the object type to compare
* @param comparator1 the first comparator to use, not null
* @param comparator2 the first comparator to use, not null
* @return a {@link ComparatorChain} formed from the two comparators
@@ -85,6 +87,7 @@ public class ComparatorUtils {
* Gets a comparator that compares using an array of {@link Comparator}s, applied
* in sequence until one returns not equal or the array is exhausted.
*
+ * @param <E> the object type to compare
* @param comparators the comparators to use, not null or empty or containing nulls
* @return a {@link ComparatorChain} formed from the input comparators
* @throws NullPointerException if comparators array is null or contains a null
@@ -108,6 +111,7 @@ public class ComparatorUtils {
* applied in (default iterator) sequence until one returns not equal or the
* collection is exhausted.
*
+ * @param <E> the object type to compare
* @param comparators the comparators to use, not null or empty or containing nulls
* @return a {@link ComparatorChain} formed from the input comparators
* @throws NullPointerException if comparators collection is null or contains a null
@@ -126,6 +130,7 @@ public class ComparatorUtils {
/**
* Gets a comparator that reverses the order of the given comparator.
*
+ * @param <E> the object type to compare
* @param comparator the comparator to reverse
* @return a comparator that reverses the order of the input comparator
* @see ReverseComparator
@@ -157,6 +162,7 @@ public class ComparatorUtils {
* any nonnull value, and equal to any other null value. Two nonnull
* values will be evaluated with the given comparator.
*
+ * @param <E> the object type to compare
* @param comparator the comparator that wants to allow nulls
* @return a version of that comparator that allows nulls
* @see NullComparator
@@ -176,6 +182,7 @@ public class ComparatorUtils {
* any nonnull value, and equal to any other null value. Two nonnull
* values will be evaluated with the given comparator.
*
+ * @param <E> the object type to compare
* @param comparator the comparator that wants to allow nulls
* @return a version of that comparator that allows nulls
* @see NullComparator
@@ -195,6 +202,7 @@ public class ComparatorUtils {
* by the given transformer before they are compared by the given
* comparator.
*
+ * @param <E> the object type to compare
* @param comparator the sort order to use
* @param transformer the transformer to use
* @return a comparator that transforms its input objects before comparing them
@@ -211,14 +219,15 @@ public class ComparatorUtils {
}
/**
- * Returns the smaller of the given objects according to the given
- * comparator, returning the second object if the comparator
- * returns equal.
- *
- * @param o1 the first object to compare
- * @param o2 the second object to compare
- * @param comparator the sort order to use
- * @return the smaller of the two objects
+ * Returns the smaller of the given objects according to the given
+ * comparator, returning the second object if the comparator
+ * returns equal.
+ *
+ * @param <E> the object type to compare
+ * @param o1 the first object to compare
+ * @param o2 the second object to compare
+ * @param comparator the sort order to use
+ * @return the smaller of the two objects
*/
@SuppressWarnings("unchecked")
public static <E> E min(final E o1, final E o2, Comparator<E> comparator) {
@@ -230,14 +239,15 @@ public class ComparatorUtils {
}
/**
- * Returns the larger of the given objects according to the given
- * comparator, returning the second object if the comparator
- * returns equal.
- *
- * @param o1 the first object to compare
- * @param o2 the second object to compare
- * @param comparator the sort order to use
- * @return the larger of the two objects
+ * Returns the larger of the given objects according to the given
+ * comparator, returning the second object if the comparator
+ * returns equal.
+ *
+ * @param <E> the object type to compare
+ * @param o1 the first object to compare
+ * @param o2 the second object to compare
+ * @param comparator the sort order to use
+ * @return the larger of the two objects
*/
@SuppressWarnings("unchecked")
public static <E> E max(final E o1, final E o2, Comparator<E> comparator) {