com.taco.data
Class SetUtilities

java.lang.Object
  extended by com.taco.data.SetUtilities

public class SetUtilities
extends java.lang.Object

A utility class for sets. This class provide facilities for creating and adding to a set from an array of elements.


Constructor Summary
protected SetUtilities()
          This class should not be instantiated, so the sole constructor is protected.
 
Method Summary
static java.util.Set addElements(java.util.Set set, java.lang.Object[] array)
          Add all elements of array to the argument set.
static java.util.HashSet arrayToHashSet(java.lang.Object[] array)
          Create a new HashSet that contains all elements of array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SetUtilities

protected SetUtilities()
This class should not be instantiated, so the sole constructor is protected.

Method Detail

arrayToHashSet

public static java.util.HashSet arrayToHashSet(java.lang.Object[] array)
Create a new HashSet that contains all elements of array.

Throws:
java.lang.NullPointerException - if array is null.

addElements

public static java.util.Set addElements(java.util.Set set,
                                        java.lang.Object[] array)
Add all elements of array to the argument set. Return the argument set.

Throws:
java.lang.NullPointerException - if array is null.