Ok, let's specify it the other way around, per feedback from Michael Thomas.

git-svn-id: https://samskivert.googlecode.com/svn/trunk@2647 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
ray.j.greenwell
2009-11-19 23:39:49 +00:00
parent bb34cba00f
commit a0425478d6
@@ -37,7 +37,7 @@ public class CollectionUtil
* Adds all items returned by the enumeration to the supplied collection * Adds all items returned by the enumeration to the supplied collection
* and returns the supplied collection. * and returns the supplied collection.
*/ */
public static <T> Collection<? super T> addAll (Collection<? super T> col, Enumeration<T> enm) public static <T> Collection<T> addAll (Collection<T> col, Enumeration<? extends T> enm)
{ {
while (enm.hasMoreElements()) { while (enm.hasMoreElements()) {
col.add(enm.nextElement()); col.add(enm.nextElement());
@@ -49,7 +49,7 @@ public class CollectionUtil
* Adds all items returned by the iterator to the supplied collection and * Adds all items returned by the iterator to the supplied collection and
* returns the supplied collection. * returns the supplied collection.
*/ */
public static <T> Collection<? super T> addAll (Collection<? super T> col, Iterator<T> iter) public static <T> Collection<T> addAll (Collection<T> col, Iterator<? extends T> iter)
{ {
while (iter.hasNext()) { while (iter.hasNext()) {
col.add(iter.next()); col.add(iter.next());
@@ -62,10 +62,10 @@ public class CollectionUtil
* returns the supplied collection. If the supplied array is null, nothing * returns the supplied collection. If the supplied array is null, nothing
* is added to the collection. * is added to the collection.
*/ */
public static <T> Collection<? super T> addAll (Collection<? super T> col, T[] values) public static <T, E extends T> Collection<T> addAll (Collection<T> col, E[] values)
{ {
if (values != null) { if (values != null) {
for (T value : values) { for (E value : values) {
col.add(value); col.add(value);
} }
} }