listFW.factory
Class CompositeListFactory<E>

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

public class CompositeListFactory<E>
extends java.lang.Object
implements IListFactory<E>

Manufactures concrete IMTList and INEList objects. The INEList object is implemented as a private anonymous inner object. The implementations for MTList and NEList are completely invisible to the outside of this factory.

Since:
Copyright 2004 by SBW & DXN - All rights reserved

Field Summary
private  IMTList<E> mtList
          Note: A parametrized IMTList(E> cannot be static.
private static IListAlgo<java.lang.Object,java.lang.String,?> toStringAlgo
           
 
Constructor Summary
CompositeListFactory()
           
 
Method Summary
 IMTList<E> makeEmptyList()
          Creates an empty list.
 INEList<E> makeNEList(E first, IList<? extends E> rest)
          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

mtList

private final IMTList<E> mtList
Note: A parametrized IMTList(E> cannot be static.


toStringAlgo

private static final IListAlgo<java.lang.Object,java.lang.String,?> toStringAlgo
Constructor Detail

CompositeListFactory

public CompositeListFactory()
Method Detail

makeEmptyList

public IMTList<E> makeEmptyList()
Creates an empty list.

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

makeNEList

public INEList<E> makeNEList(E first,
                             IList<? extends E> rest)
Creates a non-empty list containing a given first and a given rest.

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