org.objectweb.jonathan.helpers
Class CollectionFactory

java.lang.Object
  extended byorg.objectweb.jonathan.helpers.CollectionFactory

public class CollectionFactory
extends java.lang.Object

This class provides factory methods for the different kinds of Collections


Constructor Summary
CollectionFactory()
          Simple default constructor
 
Method Summary
 java.util.ArrayList newArrayList(java.lang.Object[] param)
          Returns a new ArrayList using the given array of objects
 java.util.HashMap newHashMap(Context aContext)
          Returns a new HashMap based on the contents of a Context
 java.util.HashMap newHashMap(java.lang.Object[] keys, java.lang.Object[] values)
          Returns a new HashMap
 java.util.HashSet newHashSet(Context aContext)
          Returns a new HashSet based on the contents of a Context.
 java.util.HashSet newHashSet(java.lang.Object[] param)
          Returns a new HashSet using the given array of objects
 java.util.Hashtable newHashtable(Context aContext)
          Returns a new Hashtable based on the contents of a Context
 java.util.Hashtable newHashtable(java.lang.Object[] keys, java.lang.Object[] values)
          Returns a new Hashtable
 java.util.LinkedList newLinkedList(java.lang.Object[] param)
          Returns a new LinkedList using the given array of objects
 java.util.List newList(java.lang.Object[] param)
          Returns a new List using the given array of objects.
 java.util.Map newMap(java.lang.Object[] keys, java.lang.Object[] values)
          Returns a new Map.
 java.util.Set newSet(Context aContext)
          Returns a new Set based on the contents of a Context.
 java.util.Set newSet(java.lang.Object[] param)
          Returns a new Set using the given array of objects.
 java.util.TreeMap newTreeMap(java.lang.Object[] keys, java.lang.Object[] values)
          Returns a new TreeMap
 java.util.TreeMap newTreeMap(java.lang.Object[] keys, java.lang.Object[] values, java.util.Comparator aComparator)
          Returns a new TreeMap
 java.util.TreeSet newTreeSet(java.lang.Object[] param)
          Returns a new TreeSet using the given array of objects
 java.util.TreeSet newTreeSet(java.lang.Object[] param, java.util.Comparator aComparator)
          Returns a new TreeSet using the given array of objects
 java.util.Vector newVector(java.lang.Object[] param)
          Returns a new Vector using the given array of objects
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CollectionFactory

public CollectionFactory()
Simple default constructor

Method Detail

newList

public java.util.List newList(java.lang.Object[] param)
Returns a new List using the given array of objects. Uses an ArrayList.

Parameters:
param - the array to use to fill the list
Returns:
the List

newArrayList

public java.util.ArrayList newArrayList(java.lang.Object[] param)
Returns a new ArrayList using the given array of objects

Parameters:
param - the array to use to fill the list
Returns:
the ArrayList

newLinkedList

public java.util.LinkedList newLinkedList(java.lang.Object[] param)
Returns a new LinkedList using the given array of objects

Parameters:
param - the array to use to fill the list
Returns:
the LinkedList

newVector

public java.util.Vector newVector(java.lang.Object[] param)
Returns a new Vector using the given array of objects

Parameters:
param - the array to use to fill the list
Returns:
the Vector

newSet

public java.util.Set newSet(java.lang.Object[] param)
Returns a new Set using the given array of objects. Uses an HashSet.

Parameters:
param - the array to use to fill the list
Returns:
the Set

newHashSet

public java.util.HashSet newHashSet(java.lang.Object[] param)
Returns a new HashSet using the given array of objects

Parameters:
param - the array to use to fill the list
Returns:
the HashSet

newTreeSet

public java.util.TreeSet newTreeSet(java.lang.Object[] param)
Returns a new TreeSet using the given array of objects

Parameters:
param - the array to use to fill the list
Returns:
the TreeSet

newTreeSet

public java.util.TreeSet newTreeSet(java.lang.Object[] param,
                                    java.util.Comparator aComparator)
Returns a new TreeSet using the given array of objects

Parameters:
param - the array to use to fill the list
aComparator - the comparator used to sort elements in the tree
Returns:
the TreeSet

newHashtable

public java.util.Hashtable newHashtable(java.lang.Object[] keys,
                                        java.lang.Object[] values)
Returns a new Hashtable

Parameters:
keys - the vector making the keys
values - the vector making the values
Returns:
the Hashtable

newMap

public java.util.Map newMap(java.lang.Object[] keys,
                            java.lang.Object[] values)
Returns a new Map. Uses a HashMap.

Parameters:
keys - the vector making the keys
values - the vector making the values
Returns:
the Map

newHashMap

public java.util.HashMap newHashMap(java.lang.Object[] keys,
                                    java.lang.Object[] values)
Returns a new HashMap

Parameters:
keys - the vector making the keys
values - the vector making the values
Returns:
the HashMap

newTreeMap

public java.util.TreeMap newTreeMap(java.lang.Object[] keys,
                                    java.lang.Object[] values)
Returns a new TreeMap

Parameters:
keys - the vector making the keys
values - the vector making the values
Returns:
the HashMap

newTreeMap

public java.util.TreeMap newTreeMap(java.lang.Object[] keys,
                                    java.lang.Object[] values,
                                    java.util.Comparator aComparator)
Returns a new TreeMap

Parameters:
keys - the vector making the keys
values - the vector making the values
aComparator - the comparator used to sort elements in the tree
Returns:
the HashMap

newSet

public java.util.Set newSet(Context aContext)
Returns a new Set based on the contents of a Context. The elements contained in the Context are added to the set Uses an HashSet.

Parameters:
aContext - the Context
Returns:
the Set

newHashSet

public java.util.HashSet newHashSet(Context aContext)
Returns a new HashSet based on the contents of a Context. The elements contained in the Context are added to the set

Parameters:
aContext - the Context
Returns:
the HashSet

newHashMap

public java.util.HashMap newHashMap(Context aContext)
Returns a new HashMap based on the contents of a Context

Parameters:
aContext - the Context
Returns:
the HashMap

newHashtable

public java.util.Hashtable newHashtable(Context aContext)
Returns a new Hashtable based on the contents of a Context

Parameters:
aContext - the Context
Returns:
the Hashtable