net.cscott.jutil
public abstract class SetFactory<V> extends CollectionFactory<V>
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.4 2006-10-30 19:58:07 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. |
initialCapacity
as a hint to use for the capacity
for the produced Set.c
as a template for its initial contents.