de.unidu.is.util
Class CollectionUtilities

java.lang.Object
  extended byde.unidu.is.util.CollectionUtilities

public class CollectionUtilities
extends java.lang.Object

This class provides some convenient methods for dealing with collections.

Since:
2003-07-03
Version:
$Revision: 1.5 $, $Date: 2005/02/21 17:29:29 $
Author:
Henrik Nottelmann

Constructor Summary
CollectionUtilities()
           
 
Method Summary
static void addAll(java.util.Collection collection, java.util.Iterator iterator)
          Adds all elements returned by the specified iterator to the specified collection.
static java.util.List toList(java.util.Iterator iterator)
          Creates an empty list and adds all elements returned by the specified iterator to this list.
static java.util.Set toSet(java.util.Iterator iterator)
          Creates an empty set and adds all elements returned by the specified iterator to this set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CollectionUtilities

public CollectionUtilities()
Method Detail

addAll

public static void addAll(java.util.Collection collection,
                          java.util.Iterator iterator)
Adds all elements returned by the specified iterator to the specified collection.

Parameters:
collection - collection to which objects are added
iterator - iterator returning objects which have to be added to the collection

toSet

public static java.util.Set toSet(java.util.Iterator iterator)
Creates an empty set and adds all elements returned by the specified iterator to this set.

Parameters:
iterator - returning objects which have to be added to the set
Returns:
set containing all elements returned by the iterator

toList

public static java.util.List toList(java.util.Iterator iterator)
Creates an empty list and adds all elements returned by the specified iterator to this list.

Parameters:
iterator - returning objects which have to be added to the list
Returns:
list containing all elements returned by the iterator