package listFW.visitor; import listFW.*; /** * Copies an IList using the supplied IListFactory * @author Mathias Ricken - Copyright 2008 - All rights reserved. */ public class CopyList2 implements IListAlgo, Void> { private IListFactory fac; public CopyList2(IListFactory fac) { this.fac = fac; } public IMTList emptyCase(IMTList host, Void... nu) { return fac.makeEmptyList(); } public INEList nonEmptyCase(INEList host, Void... nu) { return fac.makeNEList( host.getFirst(), host.getRest().execute(this)); } }