listFW.factory
Class CompositeListFactory

java.lang.Object
  extended by listFW.factory.CompositeListFactory
All Implemented Interfaces:
IListFactory

public class CompositeListFactory
extends Object
implements IListFactory

Manufactures concrete IMTList and INEList objects. Has only one instance referenced by CompositeListFactory.Singleton. MTList and NEList are static nested classes and hidden from all external client code. The implementations for MTList and NEList are the same as before but completely invisible to the outside of this factory.

Since:
Copyright 2004 by DXN - All rights reserved
Author:
Dung X. Nguyen

Field Summary
static CompositeListFactory Singleton
          Singleton Pattern
 
Method Summary
 IMTList makeEmptyList()
          Creates an empty list.
 INEList makeNEList(Object first, IList tail)
          Creates a non-empty list containing a given first and a given rest.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Singleton

public static final CompositeListFactory Singleton
Singleton Pattern

Method Detail

makeEmptyList

public IMTList makeEmptyList()
Creates an empty list.

Specified by:
makeEmptyList in interface IListFactory
Returns:
an IMTList object.

makeNEList

public INEList makeNEList(Object first,
                          IList tail)
Creates a non-empty list containing a given first and a given rest.

Specified by:
makeNEList in interface IListFactory
Parameters:
first - a data object.
tail - != null, the rest of the non-empty list to be manufactured.
Returns:
an INEList object containing first and tail