public class PersistentSetFactory<T> extends SetFactory<T>
PersistentSetFactory uses hash-consing to ensure that
the Sets created by it maximally reuse space.
Equality tests between Sets created by this factory are
constant-time. Cloning a Set created by this factory is
also constant-time. The implementation is based on persistent
randomized treaps.| Constructor and Description |
|---|
PersistentSetFactory(java.util.Comparator<T> comparator)
Creates a
PersistentSetFactory. |
| Modifier and Type | Method and Description |
|---|---|
java.util.Set<T> |
makeSet(java.util.Collection<? extends T> c)
Generates a new unsynchronized mutable
Set which
is based on persistent randomized treaps. |
makeCollection, makeCollection, makeCollection, makeSet, makeSetpublic PersistentSetFactory(java.util.Comparator<T> comparator)
PersistentSetFactory. Note that the elements
must implement a good hashcode as well as being comparable.public java.util.Set<T> makeSet(java.util.Collection<? extends T> c)
Set which
is based on persistent randomized treaps. All Sets
created by this factory maximally reuse space, and have very
fast equality-test and clone operations.makeSet in class SetFactory<T>Copyright (c) 2006 C. Scott Ananian