JUtil

net.cscott.jutil
Class AggregateSetFactory<V>

java.lang.Object
  extended by net.cscott.jutil.CollectionFactory<V>
      extended by net.cscott.jutil.SetFactory<V>
          extended by net.cscott.jutil.AggregateSetFactory<V>
All Implemented Interfaces:
Serializable

public class AggregateSetFactory<V>
extends SetFactory<V>
implements Serializable

AggregateSetFactory uses a single HashMap 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().

Version:
$Id: AggregateSetFactory.java,v 1.6 2006-10-30 20:14:41 cananian Exp $
Author:
C. Scott Ananian
See Also:
Serialized Form

Constructor Summary
AggregateSetFactory()
          Creates an AggregateSetFactory.
 
Method Summary
 Set<V> makeSet(Collection<? extends V> c)
          Generates a new mutable Set which is a subset of the backing set of this AggregateSetFactory.
 
Methods inherited from class net.cscott.jutil.SetFactory
makeCollection, makeCollection, makeCollection, makeSet, makeSet
 
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<V> makeSet(Collection<? extends V> 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<V>

JUtil

Copyright (c) 2006 C. Scott Ananian