Save This Page
Home » tapestry-src-5.0.19 » org.apache.tapestry5.ioc.internal.util » [javadoc | source]
org.apache.tapestry5.ioc.internal.util
public final class: CollectionFactory [javadoc | source]
java.lang.Object
   org.apache.tapestry5.ioc.internal.util.CollectionFactory
Static factory methods to ease the creation of new collection types (when using generics). Most of these method leverage the compiler's ability to match generic types by return value. Typical usage (with a static import):

Map<Foo, Bar> map = newMap();

This is a replacement for:

Map<Foo, Bar> map = new HashMap<Foo, Bar>();
Method from org.apache.tapestry5.ioc.internal.util.CollectionFactory Summary:
newCaseInsensitiveMap,   newCaseInsensitiveMap,   newConcurrentMap,   newLinkedList,   newList,   newList,   newList,   newMap,   newMap,   newSet,   newSet,   newSet,   newStack,   newStack,   newThreadSafeList
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.tapestry5.ioc.internal.util.CollectionFactory Detail:
 public static Map<String, V> newCaseInsensitiveMap() 
 public static Map<String, V> newCaseInsensitiveMap(Map<String, ? extends V> map) 
 public static ConcurrentMap<K, V> newConcurrentMap() 
    Constructs a new concurrent map, which is safe to access via multiple threads.
 public static LinkedList<T> newLinkedList() 
    Useful for queues.
 public static List<T> newList() 
 public static List<T> newList(V elements) 
    Creates a new, fully modifiable list from an initial set of elements.
 public static List<T> newList(Collection<V> list) 
 public static Map<K, V> newMap() 
    Constructs and returns a generic HashMap instance.
 public static Map<K, V> newMap(Map<? extends K, ? extends V> map) 
 public static Set<T> newSet() 
 public static Set<T> newSet(Collection<V> values) 
    Contructs a new HashSet and initializes it using the provided collection.
 public static Set<T> newSet(V values) 
 public static Stack<T> newStack() 
 public static Stack<T> newStack(int initialSize) 
 public static List<T> newThreadSafeList()