Add generic type description in javadoc.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/trunk@1436305 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Thomas Neidhart 2013-01-21 12:33:10 +00:00
parent b3d25eb721
commit 076c6b723c
1 changed files with 26 additions and 16 deletions

View File

@ -57,6 +57,7 @@ public class ComparatorUtils {
/** /**
* Gets a comparator that uses the natural order of the objects. * 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 * @return a comparator which uses natural order
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@ -69,6 +70,7 @@ public class ComparatorUtils {
* <p> * <p>
* The second comparator is used if the first comparator returns equal. * 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 comparator1 the first comparator to use, not null
* @param comparator2 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 * @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 * 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. * 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 * @param comparators the comparators to use, not null or empty or containing nulls
* @return a {@link ComparatorChain} formed from the input comparators * @return a {@link ComparatorChain} formed from the input comparators
* @throws NullPointerException if comparators array is null or contains a null * @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 * applied in (default iterator) sequence until one returns not equal or the
* collection is exhausted. * collection is exhausted.
* *
* @param <E> the object type to compare
* @param comparators the comparators to use, not null or empty or containing nulls * @param comparators the comparators to use, not null or empty or containing nulls
* @return a {@link ComparatorChain} formed from the input comparators * @return a {@link ComparatorChain} formed from the input comparators
* @throws NullPointerException if comparators collection is null or contains a null * @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. * Gets a comparator that reverses the order of the given comparator.
* *
* @param <E> the object type to compare
* @param comparator the comparator to reverse * @param comparator the comparator to reverse
* @return a comparator that reverses the order of the input comparator * @return a comparator that reverses the order of the input comparator
* @see ReverseComparator * @see ReverseComparator
@ -157,6 +162,7 @@ public class ComparatorUtils {
* any nonnull value, and equal to any other null value. Two nonnull * any nonnull value, and equal to any other null value. Two nonnull
* values will be evaluated with the given comparator. * values will be evaluated with the given comparator.
* *
* @param <E> the object type to compare
* @param comparator the comparator that wants to allow nulls * @param comparator the comparator that wants to allow nulls
* @return a version of that comparator that allows nulls * @return a version of that comparator that allows nulls
* @see NullComparator * @see NullComparator
@ -176,6 +182,7 @@ public class ComparatorUtils {
* any nonnull value, and equal to any other null value. Two nonnull * any nonnull value, and equal to any other null value. Two nonnull
* values will be evaluated with the given comparator. * values will be evaluated with the given comparator.
* *
* @param <E> the object type to compare
* @param comparator the comparator that wants to allow nulls * @param comparator the comparator that wants to allow nulls
* @return a version of that comparator that allows nulls * @return a version of that comparator that allows nulls
* @see NullComparator * @see NullComparator
@ -195,6 +202,7 @@ public class ComparatorUtils {
* by the given transformer before they are compared by the given * by the given transformer before they are compared by the given
* comparator. * comparator.
* *
* @param <E> the object type to compare
* @param comparator the sort order to use * @param comparator the sort order to use
* @param transformer the transformer to use * @param transformer the transformer to use
* @return a comparator that transforms its input objects before comparing them * @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 * Returns the smaller of the given objects according to the given
* comparator, returning the second object if the comparator * comparator, returning the second object if the comparator
* returns equal. * returns equal.
* *
* @param o1 the first object to compare * @param <E> the object type to compare
* @param o2 the second object to compare * @param o1 the first object to compare
* @param comparator the sort order to use * @param o2 the second object to compare
* @return the smaller of the two objects * @param comparator the sort order to use
* @return the smaller of the two objects
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public static <E> E min(final E o1, final E o2, Comparator<E> comparator) { 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 * Returns the larger of the given objects according to the given
* comparator, returning the second object if the comparator * comparator, returning the second object if the comparator
* returns equal. * returns equal.
* *
* @param o1 the first object to compare * @param <E> the object type to compare
* @param o2 the second object to compare * @param o1 the first object to compare
* @param comparator the sort order to use * @param o2 the second object to compare
* @return the larger of the two objects * @param comparator the sort order to use
* @return the larger of the two objects
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public static <E> E max(final E o1, final E o2, Comparator<E> comparator) { public static <E> E max(final E o1, final E o2, Comparator<E> comparator) {