package listFW.visitor; import listFW.*; /** * Copies an IList using the an IListFactory supplied as an input parameter * @author Mathias Ricken - Copyright 2008 - All rights reserved. */ public class CopyList implements IListAlgo, IListFactory> { public IMTList emptyCase(IMTList host, IListFactory ... fac) { return fac[0].makeEmptyList(); } public INEList nonEmptyCase(INEList host, IListFactory ... fac) { return ((IListFactory)fac[0]).makeNEList( host.getFirst(), host.getRest().execute(this, fac)); // Generates "unchecked cast" warning } }