org.xins.common.collections
Class CollectionUtils

java.lang.Object
  extended byorg.xins.common.collections.CollectionUtils

public final class CollectionUtils
extends Object

Utility functions for collections.

Since:
XINS 1.1.0
Version:
$Revision: 1.14 $ $Date: 2006/08/28 09:12:32 $
Author:
Ernst de Haan

Method Summary
static ArrayList list(Iterator iterator)
          Returns an array list containing the elements returned by the specified iterator in the order they are returned by the iterator.
static ArrayList list(String argumentName, Object[] array, int min)
          Returns an array list containing the elements in the specified array, in the same order.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

list

public static ArrayList list(Iterator iterator)
                      throws IllegalArgumentException
Returns an array list containing the elements returned by the specified iterator in the order they are returned by the iterator.

Parameters:
iterator - the Iterator providing elements for the returned array list, cannot be null.
Returns:
an ArrayList containing the elements returned by the specified iterator, never null.
Throws:
IllegalArgumentException - if iterator == null.

list

public static ArrayList list(String argumentName,
                             Object[] array,
                             int min)
                      throws IllegalArgumentException
Returns an array list containing the elements in the specified array, in the same order.

No null values or duplicates are allowed.

This method is reserved for internal use by the XINS framework. It may be removed in a future minor XINS release.

Parameters:
argumentName - the name to assume for the array when constructing a message for an IllegalArgumentException, should not be null.
array - the array containing the elements to convert to an array list, cannot be null.
min - the minimum number of elements expected in the array.
Returns:
an ArrayList containing the elements in the array, in the same order, never null.
Throws:
IllegalArgumentException - if array == null || array.length < min || array[i] == null or if array constains any duplicates.
Since:
XINS 1.2.0


See http://www.xins.org/.