public final class Factories
extends java.lang.Object
Factories consists exclusively of static methods that
operate on or return CollectionFactorys.| Modifier and Type | Field and Description |
|---|---|
static ListFactory |
arrayListFactory
Returns a
ListFactory that generates
ArrayLists. |
static MapFactory |
hashMapFactory
A
MapFactory that generates HashMaps. |
static SetFactory |
hashSetFactory
A
SetFactory that generates HashSets. |
static SetFactory |
linearSetFactory
|
static MapFactory |
linkedHashMapFactory
A
MapFactory that generates LinkedHashMaps. |
static SetFactory |
linkedHashSetFactory
A
SetFactory that generates LinkedHashSets. |
static ListFactory |
linkedListFactory
A
ListFactory that generates LinkedLists. |
static SetFactory |
treeSetFactory
A
SetFactory that generates TreeSets. |
static SetFactory |
workSetFactory
A
SetFactory that generates WorkSets. |
| Modifier and Type | Method and Description |
|---|---|
static <V> ListFactory<V> |
arrayListFactory() |
static <K extends java.lang.Enum<K>,V> |
enumMapFactory(java.lang.Class<K> enumClass)
A
MapFactory that generates EnumMaps. |
static <V extends java.lang.Enum<V>> |
enumSetFactory(java.lang.Class<V> enumClass)
A
SetFactory that generates EnumSets. |
static <K,V> MapFactory<K,V> |
hashMapFactory() |
static <V> SetFactory<V> |
hashSetFactory() |
static <V> SetFactory<V> |
linearSetFactory() |
static <K,V> MapFactory<K,V> |
linkedHashMapFactory() |
static <V> SetFactory<V> |
linkedHashSetFactory() |
static <V> ListFactory<V> |
linkedListFactory() |
static <K,V> SetFactory<java.util.Map.Entry<K,V>> |
mapSetFactory(MapFactory<K,V> mf)
|
static <K,V> SetFactory<java.util.Map.Entry<K,V>> |
multiMapSetFactory(MultiMapFactory<K,V> mf)
Returns a
SetFactory that generates
MultiMapSet views of MultiMaps
generated by the given MultiMapFactory. |
static <V> CollectionFactory<V> |
noNullCollectionFactory(CollectionFactory<V> cf) |
static <V> CollectionFactory<V> |
synchronizedCollectionFactory(CollectionFactory<V> cf)
Returns a
CollectionFactory that generates
synchronized (thread-safe) Collections. |
static <V> ListFactory<V> |
synchronizedListFactory(ListFactory<V> lf)
Returns a
ListFactory that generates synchronized
(thread-safe) Lists. |
static <K,V> MapFactory<K,V> |
synchronizedMapFactory(MapFactory<K,V> mf)
Returns a
MapFactory that generates synchronized
(thread-safe) Maps. |
static <V> SetFactory<V> |
synchronizedSetFactory(SetFactory<V> sf)
Returns a
SetFactory that generates synchronized
(thread-safe) Sets. |
static <V> SetFactory<V> |
treeSetFactory() |
static <V> SetFactory<V> |
workSetFactory() |
public static final MapFactory hashMapFactory
MapFactory that generates HashMaps.public static final MapFactory linkedHashMapFactory
MapFactory that generates LinkedHashMaps.public static final SetFactory hashSetFactory
SetFactory that generates HashSets.public static final SetFactory linkedHashSetFactory
SetFactory that generates LinkedHashSets.public static final SetFactory workSetFactory
SetFactory that generates WorkSets.public static final SetFactory linearSetFactory
public static final SetFactory treeSetFactory
SetFactory that generates TreeSets.public static final ListFactory linkedListFactory
ListFactory that generates LinkedLists.public static final ListFactory arrayListFactory
ListFactory that generates
ArrayLists.public static final <K,V> MapFactory<K,V> hashMapFactory()
public static final <K,V> MapFactory<K,V> linkedHashMapFactory()
public static final <K extends java.lang.Enum<K>,V> MapFactory<K,V> enumMapFactory(java.lang.Class<K> enumClass)
MapFactory that generates EnumMaps.public static final <V> SetFactory<V> hashSetFactory()
public static final <V> SetFactory<V> linkedHashSetFactory()
public static final <V extends java.lang.Enum<V>> SetFactory<V> enumSetFactory(java.lang.Class<V> enumClass)
SetFactory that generates EnumSets.public static final <V> SetFactory<V> workSetFactory()
public static final <V> SetFactory<V> linearSetFactory()
public static final <V> SetFactory<V> treeSetFactory()
public static final <V> ListFactory<V> linkedListFactory()
public static final <V> ListFactory<V> arrayListFactory()
public static <K,V> SetFactory<java.util.Map.Entry<K,V>> mapSetFactory(MapFactory<K,V> mf)
SetFactory that generates MapSet
views of maps generated by the given MapFactory. These
can be passed in as arguments to a GenericMultiMap,
for example, to make a multimap of maps.public static <K,V> SetFactory<java.util.Map.Entry<K,V>> multiMapSetFactory(MultiMapFactory<K,V> mf)
SetFactory that generates
MultiMapSet views of MultiMaps
generated by the given MultiMapFactory. These can be
passed in as arguments to a GenericMultiMap, for
example, to make a multimap of multimaps.public static <V> CollectionFactory<V> synchronizedCollectionFactory(CollectionFactory<V> cf)
CollectionFactory that generates
synchronized (thread-safe) Collections.
The Collections generated are backed by the
Collections generated by cf.Collections.synchronizedCollection(java.util.Collection<T>)public static <V> SetFactory<V> synchronizedSetFactory(SetFactory<V> sf)
SetFactory that generates synchronized
(thread-safe) Sets. The Sets
generated are backed by the Sets generated by
sf.Collections.synchronizedSet(java.util.Set<T>)public static <V> ListFactory<V> synchronizedListFactory(ListFactory<V> lf)
ListFactory that generates synchronized
(thread-safe) Lists. The Lists
generated are backed by the Lists generated by
lf.Collections.synchronizedList(java.util.List<T>)public static <K,V> MapFactory<K,V> synchronizedMapFactory(MapFactory<K,V> mf)
MapFactory that generates synchronized
(thread-safe) Maps. The Maps
generated are backed by the Map generated by
mf.Collections.synchronizedMap(java.util.Map<K, V>)public static <V> CollectionFactory<V> noNullCollectionFactory(CollectionFactory<V> cf)
Copyright (c) 2006 C. Scott Ananian