edu.stanford.nlp.util
Class MapFactory<K,V>

java.lang.Object
  extended by edu.stanford.nlp.util.MapFactory<K,V>
All Implemented Interfaces:
Serializable

public abstract class MapFactory<K,V>
extends Object
implements Serializable

A factory class for vending different sorts of Maps.

Author:
Dan Klein (klein@cs.stanford.edu), Kayur Patel (kdpatel@cs)
See Also:
Serialized Form

Field Summary
static MapFactory ARRAY_MAP_FACTORY
           
static MapFactory HASH_MAP_FACTORY
           
static MapFactory IDENTITY_HASH_MAP_FACTORY
           
static MapFactory TREE_MAP_FACTORY
           
static MapFactory WEAK_HASH_MAP_FACTORY
           
 
Method Summary
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
<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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HASH_MAP_FACTORY

public static final MapFactory HASH_MAP_FACTORY

IDENTITY_HASH_MAP_FACTORY

public static final MapFactory IDENTITY_HASH_MAP_FACTORY

WEAK_HASH_MAP_FACTORY

public static final MapFactory WEAK_HASH_MAP_FACTORY

TREE_MAP_FACTORY

public static final MapFactory TREE_MAP_FACTORY

ARRAY_MAP_FACTORY

public static final MapFactory ARRAY_MAP_FACTORY
Method Detail

newMap

public abstract Map<K,V> newMap()
Returns a new non-parameterized map of a particular sort.

Returns:
A new non-parameterized map of a particular sort

newMap

public abstract Map<K,V> newMap(int initCapacity)
Returns a new non-parameterized map of a particular sort with an initial capacity.

Parameters:
initCapacity - initial capacity of the map
Returns:
A new non-parameterized map of a particular sort with an initial capacity

setMap

public abstract <K1,V1> Map<K1,V1> setMap(Map<K1,V1> map)
A method to get a parameterized (genericized) map out.

Parameters:
map - A type-parameterized Map argument
Returns:
A Map with type-parameterization identical to that of the argument.

setMap

public abstract <K1,V1> Map<K1,V1> setMap(Map<K1,V1> map,
                                          int initCapacity)


Stanford NLP Group