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