net.cscott.jutil
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 Set
s.
Notably, the Set
s 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.Version: $Id: BitSetFactory.java,v 1.3 2004/01/13 20:47:05 cananian Exp $
Constructor Summary | |
---|---|
BitSetFactory(Set<V> universe, Indexer<V> indexer) Creates a BitSetFactory , given a
universe of values and an Indexer
for the elements of universe . | |
BitSetFactory(Set<V> universe) Creates a BitSetFactory , given a
universe of values. |
Method Summary | |
---|---|
Set<V> | makeFullSet() Generates a new mutable Set , using the elements
of the universe for this as its initial contents. |
BitStringSet<V> | makeSet(Collection<? extends V> c) Generates a new mutable Set , using the elements
of c as a template for its initial contents.
|
BitSetFactory
, given a
universe
of values and an Indexer
for the elements of 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.Set
, using the elements
of the universe for this
as its initial contents.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
.