From ca9adfe0634a1aad807d57155a20e11d79e597ad Mon Sep 17 00:00:00 2001 From: ray Date: Wed, 19 Apr 2006 18:41:44 +0000 Subject: [PATCH] Better genericized typing for addAll() methods. git-svn-id: https://samskivert.googlecode.com/svn/trunk@1829 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- src/java/com/samskivert/util/CollectionUtil.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/java/com/samskivert/util/CollectionUtil.java b/src/java/com/samskivert/util/CollectionUtil.java index 887e79ba..7d7b15b2 100644 --- a/src/java/com/samskivert/util/CollectionUtil.java +++ b/src/java/com/samskivert/util/CollectionUtil.java @@ -35,8 +35,8 @@ public class CollectionUtil * Adds all items returned by the enumeration to the supplied * collection and returns the supplied collection. */ - public static Collection addAll ( - Collection col, Enumeration enm) + public static > T addAll ( + T col, Enumeration enm) { while (enm.hasMoreElements()) { col.add(enm.nextElement()); @@ -48,7 +48,8 @@ public class CollectionUtil * Adds all items returned by the iterator to the supplied collection * and returns the supplied collection. */ - public static Collection addAll (Collection col, Iterator iter) + public static > T addAll ( + T col, Iterator iter) { while (iter.hasNext()) { col.add(iter.next()); @@ -60,7 +61,7 @@ public class CollectionUtil * Adds all items in the given object array to the supplied * collection and returns the supplied collection. */ - public static Collection addAll (Collection col, T[] values) + public static > T addAll (T col, E[] values) { for (int ii = 0; ii < values.length; ii++) { col.add(values[ii]);