net.cscott.jutil
Class PersistentMapFactory<K,V>
java.lang.Object
net.cscott.jutil.MapFactory<K,V>
net.cscott.jutil.PersistentMapFactory<K,V>
public class PersistentMapFactory<K,V>
- extends MapFactory<K,V>
A PersistentMapFactory
uses hash-consing to ensure that
the Map
s created by it maximally reuse space.
Equality tests between Map
s created by this factory are
constant-time. Cloning a Map
created by this factory is
also constant-time. The implementation is based on persistent
randomized treaps.
- Version:
- $Id: PersistentMapFactory.java,v 1.7 2006-10-30 19:58:06 cananian Exp $
- Author:
- C. Scott Ananian
Method Summary |
Map<K,V> |
makeMap(Map<? extends K,? extends V> mm)
Generates a new unsynchronized mutable Map which
is based on persistent randomized treaps. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PersistentMapFactory
public PersistentMapFactory(Comparator<K> comparator)
- Creates a
PersistentMapFactory
. Note that the keys
must implement a good hashcode as well as being comparable.
makeMap
public Map<K,V> makeMap(Map<? extends K,? extends V> mm)
- Generates a new unsynchronized mutable
Map
which
is based on persistent randomized treaps. All Map
s
created by this factory maximally reuse space, and have very
fast comparison operations.
- Specified by:
makeMap
in class MapFactory<K,V>
Copyright (c) 2006 C. Scott Ananian