|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjwutil.collections.MapFactory
public abstract class MapFactory
MapFactory is a Map generator.
Subclasses should implement constructions of specific types of
Maps.
Note also that the current limitations on parametric types in
Java mean that we can't easily type this class as
MapFactory<M extends Map<K,V>,K,V>,
as MapFactory<HashMap<K,V>,K,V> is not
a subtype of MapFactory<Map<K,V>,K,V>,
even though HashMap is a subtype of Map.
| Field Summary | |
|---|---|
static MapFactory |
hashMapFactory
A MapFactory that generates HashMaps. |
static MapFactory |
treeMapFactory
A MapFactory that generates TreeMaps. |
| Constructor Summary | |
|---|---|
MapFactory()
Creates a MapFactory. |
|
| Method Summary | |
|---|---|
java.util.Map |
makeMap()
Generates a new, mutable, empty Map. |
abstract java.util.Map |
makeMap(java.util.Map map)
Generates a new Map, using the entries of
map as a template for its initial mappings. |
static MapFactory |
synchronizedMapFactory(MapFactory mf)
Returns a MapFactory that generates synchronized
(thread-safe) Maps. |
| 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 HashMaps.
public static final MapFactory treeMapFactory
MapFactory that generates TreeMaps.
| Constructor Detail |
|---|
public MapFactory()
MapFactory.
| Method Detail |
|---|
public java.util.Map makeMap()
Map.
public abstract java.util.Map makeMap(java.util.Map map)
Map, using the entries of
map as a template for its initial mappings.
public static MapFactory synchronizedMapFactory(MapFactory mf)
MapFactory that generates synchronized
(thread-safe) Maps. The Maps
generated are backed by the Map generated by
mf.
Collections.synchronizedMap(java.util.Map)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||