|
JUtil | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.cscott.jutil.Factories
public final class Factories
Factories
consists exclusively of static methods that
operate on or return CollectionFactory
s.
Field Summary | |
---|---|
static ListFactory |
arrayListFactory
Returns a ListFactory that generates
ArrayList s. |
static MapFactory |
hashMapFactory
A MapFactory that generates HashMap s. |
static SetFactory |
hashSetFactory
A SetFactory that generates HashSet s. |
static SetFactory |
linearSetFactory
A SetFactory that generates
LinearSet s backed by ArrayList s. |
static MapFactory |
linkedHashMapFactory
A MapFactory that generates LinkedHashMap s. |
static SetFactory |
linkedHashSetFactory
A SetFactory that generates LinkedHashSet s. |
static ListFactory |
linkedListFactory
A ListFactory that generates LinkedList s. |
static SetFactory |
treeSetFactory
A SetFactory that generates TreeSet s. |
static SetFactory |
workSetFactory
A SetFactory that generates WorkSet s. |
Method Summary | ||
---|---|---|
static
|
arrayListFactory()
|
|
static
|
enumMapFactory(Class<K> enumClass)
A MapFactory that generates EnumMap s. |
|
static
|
enumSetFactory(Class<V> enumClass)
A SetFactory that generates EnumSet s. |
|
static
|
hashMapFactory()
|
|
static
|
hashSetFactory()
|
|
static
|
linearSetFactory()
|
|
static
|
linkedHashMapFactory()
|
|
static
|
linkedHashSetFactory()
|
|
static
|
linkedListFactory()
|
|
static
|
mapSetFactory(MapFactory<K,V> mf)
Returns a SetFactory that generates MapSet
views of maps generated by the given MapFactory . |
|
static
|
multiMapSetFactory(MultiMapFactory<K,V> mf)
Returns a SetFactory that generates
MultiMapSet views of MultiMap s
generated by the given MultiMapFactory . |
|
static
|
noNullCollectionFactory(CollectionFactory<V> cf)
|
|
static
|
synchronizedCollectionFactory(CollectionFactory<V> cf)
Returns a CollectionFactory that generates
synchronized (thread-safe) Collection s. |
|
static
|
synchronizedListFactory(ListFactory<V> lf)
Returns a ListFactory that generates synchronized
(thread-safe) List s. |
|
static
|
synchronizedMapFactory(MapFactory<K,V> mf)
Returns a MapFactory that generates synchronized
(thread-safe) Map s. |
|
static
|
synchronizedSetFactory(SetFactory<V> sf)
Returns a SetFactory that generates synchronized
(thread-safe) Set s. |
|
static
|
treeSetFactory()
|
|
static
|
workSetFactory()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final MapFactory hashMapFactory
MapFactory
that generates HashMap
s.
public static final MapFactory linkedHashMapFactory
MapFactory
that generates LinkedHashMap
s.
public static final SetFactory hashSetFactory
SetFactory
that generates HashSet
s.
public static final SetFactory linkedHashSetFactory
SetFactory
that generates LinkedHashSet
s.
public static final SetFactory workSetFactory
SetFactory
that generates WorkSet
s.
public static final SetFactory linearSetFactory
SetFactory
that generates
LinearSet
s backed by ArrayList
s.
public static final SetFactory treeSetFactory
SetFactory
that generates TreeSet
s.
public static final ListFactory linkedListFactory
ListFactory
that generates LinkedList
s.
public static final ListFactory arrayListFactory
ListFactory
that generates
ArrayList
s.
Method Detail |
---|
public static final <K,V> MapFactory<K,V> hashMapFactory()
public static final <K,V> MapFactory<K,V> linkedHashMapFactory()
public static final <K extends Enum<K>,V> MapFactory<K,V> enumMapFactory(Class<K> enumClass)
MapFactory
that generates EnumMap
s.
public static final <V> SetFactory<V> hashSetFactory()
public static final <V> SetFactory<V> linkedHashSetFactory()
public static final <V extends Enum<V>> SetFactory<V> enumSetFactory(Class<V> enumClass)
SetFactory
that generates EnumSet
s.
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<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<Map.Entry<K,V>> multiMapSetFactory(MultiMapFactory<K,V> mf)
SetFactory
that generates
MultiMapSet
views of MultiMap
s
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) Collection
s.
The Collection
s generated are backed by the
Collection
s generated by cf
.
Collections.synchronizedCollection(java.util.Collection)
public static <V> SetFactory<V> synchronizedSetFactory(SetFactory<V> sf)
SetFactory
that generates synchronized
(thread-safe) Set
s. The Set
s
generated are backed by the Set
s generated by
sf
.
Collections.synchronizedSet(java.util.Set)
public static <V> ListFactory<V> synchronizedListFactory(ListFactory<V> lf)
ListFactory
that generates synchronized
(thread-safe) List
s. The List
s
generated are backed by the List
s generated by
lf
.
Collections.synchronizedList(java.util.List)
public static <K,V> MapFactory<K,V> synchronizedMapFactory(MapFactory<K,V> mf)
MapFactory
that generates synchronized
(thread-safe) Map
s. The Map
s
generated are backed by the Map
generated by
mf
.
Collections.synchronizedMap(java.util.Map)
public static <V> CollectionFactory<V> noNullCollectionFactory(CollectionFactory<V> cf)
|
JUtil | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |