Added addAll(Object[]).

git-svn-id: https://samskivert.googlecode.com/svn/trunk@654 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
shaper
2002-03-15 18:05:36 +00:00
parent 80ab33b62e
commit 6684d7e043
@@ -1,5 +1,5 @@
// //
// $Id: CollectionUtil.java,v 1.3 2001/09/27 23:13:24 mdb Exp $ // $Id: CollectionUtil.java,v 1.4 2002/03/15 18:05:36 shaper Exp $
// //
// samskivert library - useful routines for java programs // samskivert library - useful routines for java programs
// Copyright (C) 2001 Michael Bayne // Copyright (C) 2001 Michael Bayne
@@ -20,7 +20,9 @@
package com.samskivert.util; package com.samskivert.util;
import java.util.*; import java.util.Collection;
import java.util.Enumeration;
import java.util.Iterator;
/** /**
* A collection of collection-related utility functions. * A collection of collection-related utility functions.
@@ -48,6 +50,17 @@ public class CollectionUtil
} }
} }
/**
* Adds all items in the given object array to the supplied
* collection.
*/
public static void addAll (Collection col, Object[] values)
{
for (int ii = 0; ii < values.length; ii++) {
col.add(values[ii]);
}
}
/** /**
* If a collection contains only <code>Integer</code> objects, it can * If a collection contains only <code>Integer</code> objects, it can
* be passed to this function and converted into an int array. * be passed to this function and converted into an int array.