package listFW.visitor; import listFW.*; /** * Copies an IList using the supplied IListFactory */ public class CopyList2 implements IListAlgo, Object> { private IListFactory fac; public CopyList2(IListFactory fac) { this.fac = fac; } public IMTList emptyCase(IMTList host, Object ... nu) { return fac.makeEmptyList(); } public INEList nonEmptyCase(INEList host, Object ... nu) { return fac.makeNEList( host.getFirst(), host.getRest().execute(this)); } }