JUtil

net.cscott.jutil
Class MapFactory<K,V>

java.lang.Object
  extended by net.cscott.jutil.MapFactory<K,V>
Direct Known Subclasses:
AggregateMapFactory, MultiMapFactory, PersistentMapFactory

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.4 2006-10-30 19:58:06 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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.


JUtil

Copyright (c) 2006 C. Scott Ananian