harpoon.Util.Collections
Class AggregateSetFactory

java.lang.Object
  |
  +--harpoon.Util.Collections.CollectionFactory
        |
        +--harpoon.Util.Collections.SetFactory
              |
              +--harpoon.Util.Collections.AggregateSetFactory
All Implemented Interfaces:
Serializable

public class AggregateSetFactory
extends SetFactory
implements Serializable

AggregateSetFactory uses a single HashSet as backing store for the many smaller Sets created by this SetFactory. This means that we use much less space and rehash less frequently than if we were using the standard Factories.hashSetFactory. Be aware that the remove() method of the subsets is slow, but the iterator is as fast as ArrayList.

Version:
$Id: AggregateSetFactory.java,v 1.2 2002/02/25 21:09:04 cananian Exp $
Author:
C. Scott Ananian <cananian@alumni.princeton.edu>
See Also:
Serialized Form

Constructor Summary
AggregateSetFactory()
          Creates an AggregateSetFactory.
 
Method Summary
 Set makeSet(Collection c)
          Generates a new mutable Set which is a subset of the backing set of this AggregateSetFactory.
 
Methods inherited from class harpoon.Util.Collections.SetFactory
makeCollection, makeCollection, makeSet, makeSet
 
Methods inherited from class harpoon.Util.Collections.CollectionFactory
makeCollection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AggregateSetFactory

public AggregateSetFactory()
Creates an AggregateSetFactory.

Method Detail

makeSet

public Set makeSet(Collection c)
Generates a new mutable Set which is a subset of the backing set of this AggregateSetFactory. WARNING: The remove() method of the returned Set is very slow.

Specified by:
makeSet in class SetFactory