public abstract class MapFactory<K,V> extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
static MapFactory |
CONCURRENT_MAP_FACTORY |
static MapFactory |
HASH_MAP_FACTORY |
static MapFactory |
IDENTITY_HASH_MAP_FACTORY |
Modifier | Constructor and Description |
---|---|
protected |
MapFactory() |
Modifier and Type | Method and Description |
---|---|
static <K,V> MapFactory<K,V> |
arrayMapFactory()
Return a MapFactory that returns an ArrayMap.
|
static <K,V> MapFactory<K,V> |
hashMapFactory()
Return a MapFactory that returns a HashMap.
|
static <K,V> MapFactory<K,V> |
identityHashMapFactory()
Return a MapFactory that returns an IdentityHashMap.
|
static <K,V> MapFactory<K,V> |
linkedHashMapFactory()
Return a MapFactory that returns an LinkedHashMap.
|
abstract Map<K,V> |
newMap()
Returns a new non-parameterized map of a particular sort.
|
abstract Map<K,V> |
newMap(int initCapacity)
Returns a new non-parameterized map of a particular sort with an initial capacity.
|
abstract Set<K> |
newSet()
A set with the same
K parameterization of the Maps. |
abstract Set<K> |
newSet(Collection<K> init)
A set with the same
K parameterization, but initialized to the given collection. |
abstract <K1,V1> Map<K1,V1> |
setMap(Map<K1,V1> map)
A method to get a parameterized (genericized) map out.
|
abstract <K1,V1> Map<K1,V1> |
setMap(Map<K1,V1> map,
int initCapacity) |
static <K,V> MapFactory<K,V> |
treeMapFactory()
Return a MapFactory that returns a TreeMap.
|
static <K,V> MapFactory<K,V> |
treeMapFactory(Comparator<? super K> comparator)
Return a MapFactory that returns a TreeMap with the given Comparator.
|
static <K,V> MapFactory<K,V> |
weakHashMapFactory()
Return a MapFactory that returns a WeakHashMap.
|
public static final MapFactory HASH_MAP_FACTORY
public static final MapFactory IDENTITY_HASH_MAP_FACTORY
public static final MapFactory CONCURRENT_MAP_FACTORY
public static <K,V> MapFactory<K,V> hashMapFactory()
public static <K,V> MapFactory<K,V> identityHashMapFactory()
public static <K,V> MapFactory<K,V> weakHashMapFactory()
public static <K,V> MapFactory<K,V> treeMapFactory()
public static <K,V> MapFactory<K,V> treeMapFactory(Comparator<? super K> comparator)
public static <K,V> MapFactory<K,V> linkedHashMapFactory()
public static <K,V> MapFactory<K,V> arrayMapFactory()
public abstract Map<K,V> newMap()
public abstract Map<K,V> newMap(int initCapacity)
initCapacity
- initial capacity of the mappublic abstract Set<K> newSet(Collection<K> init)
K
parameterization, but initialized to the given collection.public abstract <K1,V1> Map<K1,V1> setMap(Map<K1,V1> map)