net.cscott.jutil

Class PersistentMultiMapFactory<K,V>

public class PersistentMultiMapFactory<K,V> extends MultiMapFactory<K,V>

A PersistentMultiMapFactory uses hash-consing to ensure that the MultiMaps created by it maximally reuse space. Equality tests between MultiMaps created by this factory are constant-time. Cloning a MultiMap created by this factory is also constant-time. The generated MultiMaps are Maps of (Persistent)Sets, not Maps of generalized Collections (ie, no duplicate <key,value> mappings are allowed). The implementation is based on persistent randomized treaps.

Version: $Id: PersistentMultiMapFactory.java,v 1.5 2006-10-30 19:58:06 cananian Exp $

Author: C. Scott Ananian

Constructor Summary
PersistentMultiMapFactory(Comparator<K> keyComparator, Comparator<V> valueComparator)
Method Summary
MultiMap<K,V>makeMultiMap()
Generates a new unsynchronized mutable MultiMap which is based on persistent randomized treaps.

Constructor Detail

PersistentMultiMapFactory

public PersistentMultiMapFactory(Comparator<K> keyComparator, Comparator<V> valueComparator)
Creates a PersistentMultiMapFactory.

Method Detail

makeMultiMap

public MultiMap<K,V> makeMultiMap()
Generates a new unsynchronized mutable MultiMap which is based on persistent randomized treaps. All MultiMaps created by this factory maximally reuse space, and have very fast comparison operations.
Copyright (c) 2006 C. Scott Ananian