001 package listFW;
002
003 /**
004 * Abstract factory to manufacture IEmptyList<E> and INEList<E>.
005 * @author Dung X. Nguyen
006 * @author Stephen B. Wong
007 * @author Mathias Ricken - Copyright 2008 - All rights reserved.
008 * @since Copyright 2004 - DXN, SBW All rights reserved
009 * @stereotype factory
010 */
011 public interface IListFactory<E> {
012 /**
013 * Creates an empty list.
014 * @return an IMTList object.
015 */
016 public abstract IMTList<E> makeEmptyList();
017
018
019 /**
020 * Creates a non-empty list containing a given first and a given rest.
021 * @param first a data object.
022 * @param rest != null, the rest of the non-empty list to be manufactured.
023 * @return an INEList object containing first and rest
024 * @exception IllegalArgumentException if rest is null.
025 */
026 public abstract INEList<E> makeNEList(E first, IList<? extends E> rest);
027 }