|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--harpoon.Util.Collections.CollectionFactory
CollectionFactory
is a Collection
generator. Subclasses should implement constructions of specific
types of Collection
s.
Note that since some types of Collection
s have
implicit constraints (such as Set
s, which cannot
contain more than one of the same element), code which uses the
classes produced by CollectionFactory
s must take care
not to assume more than what is guaranteed by the
Collection
interface.
Constructor Summary | |
CollectionFactory()
Creates a CollectionFactory . |
Method Summary | |
Collection |
makeCollection()
Generates a new, mutable, empty Collection . |
abstract Collection |
makeCollection(Collection c)
Generates a new, mutable Collection , using the
elements of c as a template for its initial
contents. |
Collection |
makeCollection(int initialCapacity)
Generates a new, mutable, empty Collection , using
initialCapacity as a hint to use for the capacity
for the produced Collection . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CollectionFactory()
CollectionFactory
.
Method Detail |
public final Collection makeCollection()
Collection
.
public Collection makeCollection(int initialCapacity)
Collection
, using
initialCapacity
as a hint to use for the capacity
for the produced Collection
.
public abstract Collection makeCollection(Collection c)
Collection
, using the
elements of c
as a template for its initial
contents. Note that the Collection
returned is
not a view of c
, but rather a snapshot;
changes to c
are not reflected in the returned
Collection
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |