|
|||||||||
| Home >> All >> Util >> [ Collections overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
Util.Collections
Class ListFactory

java.lang.ObjectUtil.Collections.CollectionFactory
Util.Collections.ListFactory
- Direct Known Subclasses:
- Factories.SerialListFactory
- public abstract class ListFactory
- extends CollectionFactory
ListFactory is a List generator.
Subclasses should implement constructions of specific types of
Lists. ListFactory also has a set of
static helper methods for building List objects.
- Version:
- $Id: ListFactory.java,v 1.1 2003/03/05 08:26:27 joewhaley Exp $
| Constructor Summary | |
ListFactory()
Creates a ListFactory. |
|
| Method Summary | |
static java.util.List |
concatenate(java.util.List lists)
Creates and returns an unmodifiable List view of
the list made from connecting lists together in
order. |
static java.util.List |
concatenate(java.util.List[] lists)
Creates and returns an unmodifiable List view of
the list made from connecting lists together in
order. |
java.util.Collection |
makeCollection(java.util.Collection c)
Generates a new, mutable Collection, using the
elements of c as a template for its initial
contents. |
java.util.Collection |
makeCollection(int initCapacity)
Generates a new, mutable, empty Collection, using
initialCapacity as a hint to use for the capacity
for the produced Collection. |
java.util.List |
makeList()
Generates a new, mutable, empty List. |
abstract java.util.List |
makeList(java.util.Collection c)
Generates a new mutable List, using the elements
of c as a template for its initial contents. |
java.util.List |
makeList(int initialCapacity)
Generates a new, mutable, empty List, using
initialCapacity as a hint to use for the capacity
for the produced List. |
static java.util.List |
singleton(java.lang.Object o)
Creates and returns an immutable List of one element. |
| Methods inherited from class Util.Collections.CollectionFactory |
makeCollection |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
ListFactory
public ListFactory()
- Creates a
ListFactory.
| Method Detail |
makeCollection
public final java.util.Collection makeCollection(int initCapacity)
- Description copied from class:
CollectionFactory - Generates a new, mutable, empty
Collection, usinginitialCapacityas a hint to use for the capacity for the producedCollection.- Overrides:
makeCollectionin classCollectionFactory
makeCollection
public final java.util.Collection makeCollection(java.util.Collection c)
- Description copied from class:
CollectionFactory - Generates a new, mutable
Collection, using the elements ofcas a template for its initial contents. Note that theCollectionreturned is not a view ofc, but rather a snapshot; changes tocare not reflected in the returnedCollection.- Specified by:
makeCollectionin classCollectionFactory
makeList
public final java.util.List makeList()
- Generates a new, mutable, empty
List.
makeList
public java.util.List makeList(int initialCapacity)
- Generates a new, mutable, empty
List, usinginitialCapacityas a hint to use for the capacity for the producedList.
makeList
public abstract java.util.List makeList(java.util.Collection c)
- Generates a new mutable
List, using the elements ofcas a template for its initial contents.
concatenate
public static java.util.List concatenate(java.util.List lists)
- Creates and returns an unmodifiable
Listview of the list made from connectingliststogether in order.
requires:listsis aListofLists.
effects:let l0 = (List) lists.get(0) l1 = (List) lists.get(1) ... ln = (List) lists.get(n) where n is lists.size()-1 returns a list view [ l0.get(0) , l0.get(1), ... , l0.get(l0.size()-1), l1.get(0) , l1.get(1), ... , l1.get(l1.size()-1), ... ln.get(0) , ln.get(1), ... , ln.get(ln.size()-1) ]Note that not only changes to the elements oflistsare reflected in the returnedList, but even changes tolistsitself (adding or removing lists) are also reflected.
concatenate
public static java.util.List concatenate(java.util.List[] lists)
- Creates and returns an unmodifiable
Listview of the list made from connectingliststogether in order.
effects:let l0 = lists[0] l1 = lists[1] ... ln = lists[n] where n is lists.length-1 returns a list view [ l0.get(0) , l0.get(1), ... , l0.get(l0.size()-1), l1.get(0) , l1.get(1), ... , l1.get(l1.size()-1), ... ln.get(0) , ln.get(1), ... , ln.get(ln.size()-1) ]Note that changes to the elements oflistsare reflected inthis.
singleton
public static java.util.List singleton(java.lang.Object o)
- Creates and returns an immutable
Listof one element.
effects: returns the list [ o ]
|
|||||||||
| Home >> All >> Util >> [ Collections overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC