net.cscott.jutil
public abstract class SetFactory<V> extends CollectionFactory<V>
SetFactory
is a Set
generator.
Subclasses should implement constructions of specific types of
Set
s.
Note also that the current limitations on parametric types in
Java mean that we can't easily type this class as
SetFactory<S extends Set<V>,V>
,
as SetFactory<HashSet<V>,V>
is not
a subtype of SetFactory<Set<V>,V>
,
even though HashSet
is a subtype of Set
.
Version: $Id: SetFactory.java,v 1.2 2004/01/13 20:47:05 cananian Exp $
Constructor Summary | |
---|---|
SetFactory() Creates a SetFactory . |
Method Summary | |
---|---|
Set<V> | makeCollection() |
Set<V> | makeCollection(Collection<? extends V> c) |
Set<V> | makeCollection(int initCapacity) |
Set<V> | makeSet() Generates a new, mutable, empty Set . |
Set<V> | makeSet(int initialCapacity) Generates a new, mutable, empty Set , using
initialCapacity as a hint to use for the capacity
for the produced Set . |
abstract Set<V> | makeSet(Collection<? extends V> c) Generates a new mutable Set , using the elements
of c as a template for its initial contents. |
SetFactory
.Set
.Set
, using
initialCapacity
as a hint to use for the capacity
for the produced Set
.Set
, using the elements
of c
as a template for its initial contents.