jpaul.DataStructs
Class MapFactory<K,V>

java.lang.Object
  extended by jpaul.DataStructs.MapFactory<K,V>
All Implemented Interfaces:
java.io.Serializable, Factory<java.util.Map<K,V>>
Direct Known Subclasses:
MapFacts.HashMapFactory, MapFacts.TreeMapFactory

public abstract class MapFactory<K,V>
extends java.lang.Object
implements Factory<java.util.Map<K,V>>, java.io.Serializable

MapFactory is a map-specific instance of the factory pattern. Various map factories are available in the class MapFacts.

Version:
$Id: MapFactory.java,v 1.8 2006/02/15 16:04:18 adam_kiezun Exp $
Author:
Alexandru Salcianu - salcianu@alum.mit.edu
See Also:
Serialized Form

Constructor Summary
MapFactory()
           
 
Method Summary
abstract  java.util.Map<K,V> create()
          Create a new object of class T.
 java.util.Map<K,V> create(java.util.Map<K,V> m)
          Default implementation: uses create() to create an empty map, and next adds each entry from m to the newly-created map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapFactory

public MapFactory()
Method Detail

create

public abstract java.util.Map<K,V> create()
Description copied from interface: Factory
Create a new object of class T. Corresponds to a default constructor.

Specified by:
create in interface Factory<java.util.Map<K,V>>

create

public java.util.Map<K,V> create(java.util.Map<K,V> m)
Default implementation: uses create() to create an empty map, and next adds each entry from m to the newly-created map.

Specified by:
create in interface Factory<java.util.Map<K,V>>
See Also:
Factory.create(Object)


Copyright 2005 Alexandru Salcianu - salcianu@alum.mit.edu