net.cscott.jutil

Class MapFactory<K,V>

public abstract class MapFactory<K,V> extends Object

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.

Version: $Id: MapFactory.java,v 1.2 2004/01/13 20:47:05 cananian Exp $

Author: Felix S. Klock II

Constructor Summary
MapFactory()
Creates a MapFactory.
Method Summary
Map<K,V>makeMap()
Generates a new, mutable, empty Map.
abstract Map<K,V>makeMap(Map<? extends K,? extends V> map)
Generates a new Map, using the entries of map as a template for its initial mappings.

Constructor Detail

MapFactory

public MapFactory()
Creates a MapFactory.

Method Detail

makeMap

public Map<K,V> makeMap()
Generates a new, mutable, empty Map.

makeMap

public abstract Map<K,V> makeMap(Map<? extends K,? extends V> map)
Generates a new Map, using the entries of map as a template for its initial mappings.
Copyright © 2003 C. Scott Ananian