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:
@@ -37,7 +37,7 @@ public class CollectionUtil
|
||||
* Adds all items returned by the enumeration to 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()) {
|
||||
col.add(enm.nextElement());
|
||||
@@ -49,7 +49,7 @@ public class CollectionUtil
|
||||
* Adds all items returned by the iterator to the supplied collection and
|
||||
* 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()) {
|
||||
col.add(iter.next());
|
||||
@@ -62,10 +62,10 @@ public class CollectionUtil
|
||||
* returns the supplied collection. If the supplied array is null, nothing
|
||||
* 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) {
|
||||
for (T value : values) {
|
||||
for (E value : values) {
|
||||
col.add(value);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user