public class BitSetFactory<V> extends SetFactory<V>
BitSetFactory is a SetFactory that,
given a complete universe of possible values, produces low space
overhead representations of Sets.
Notably, the Sets produced should have union,
intersection, and difference operations that, while still O(n),
have blazingly low constant factors.
The addition operations (Set.add(Object) and its
cousins) are only defined for objects that are part of the
universe of values given to the constructor; other Objects will
cause IllegalArgumentException to be thrown.| Constructor and Description |
|---|
BitSetFactory(java.util.Collection<V> universe)
Creates a
BitSetFactory, given a
universe of values. |
BitSetFactory(java.util.Collection<V> universe,
Indexer<V> indexer)
|
| Modifier and Type | Method and Description |
|---|---|
java.util.Set<V> |
makeFullSet()
Generates a new mutable
Set, using the elements
of the universe for this as its initial contents. |
net.cscott.jutil.BitSetFactory.BitStringSet<V> |
makeSet(java.util.Collection<? extends V> c)
Generates a new mutable
Set, using the elements
of c as a template for its initial contents. |
makeCollection, makeCollection, makeCollection, makeSet, makeSetpublic BitSetFactory(java.util.Collection<V> universe)
BitSetFactory, given a
universe of values. Makes a new
Indexer for universe; the
created Indexer will implement the
Indexer.getByID() method to allow
efficient iteration over sets.public net.cscott.jutil.BitSetFactory.BitStringSet<V> makeSet(java.util.Collection<? extends V> c)
Set, using the elements
of c as a template for its initial contents.
c
must have been part of the universe for
this.
Set with the elements from c.makeSet in class SetFactory<V>public java.util.Set<V> makeFullSet()
Set, using the elements
of the universe for this as its initial contents.Copyright (c) 2006 C. Scott Ananian