Package net.cscott.jutil
Class PersistentMultiMapFactory<K,V>
java.lang.Object
net.cscott.jutil.PersistentMultiMapFactory<K,V>
- All Implemented Interfaces:
MapFactory<K,,V> 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.- Since:
- 1.3
- Author:
- C. Scott Ananian <cananian@alumni.princeton.edu>
-
Constructor Summary
ConstructorsConstructorDescriptionPersistentMultiMapFactory(Comparator<K> keyComparator, Comparator<V> valueComparator) Creates aPersistentMultiMapFactory. -
Method Summary
Modifier and TypeMethodDescriptionGenerates a new unsynchronized mutableMultiMapwhich is based on persistent randomized treaps.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.cscott.jutil.MultiMapFactory
makeMap, makeMap, makeMultiMap
-
Constructor Details
-
PersistentMultiMapFactory
Creates aPersistentMultiMapFactory.
-
-
Method Details
-
makeMultiMap
Generates a new unsynchronized mutableMultiMapwhich is based on persistent randomized treaps. AllMultiMaps created by this factory maximally reuse space, and have very fast comparison operations.- Specified by:
makeMultiMapin interfaceMultiMapFactory<K,V>
-