Added addAll(Object[]).
git-svn-id: https://samskivert.googlecode.com/svn/trunk@654 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -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
|
||||
// Copyright (C) 2001 Michael Bayne
|
||||
@@ -20,7 +20,9 @@
|
||||
|
||||
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.
|
||||
@@ -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
|
||||
* be passed to this function and converted into an int array.
|
||||
|
||||
Reference in New Issue
Block a user