package listFW.visitor; import listFW.*; /** * Append another list, passed as input[0], at the end of this list. */ public class Append implements IListAlgo,IList> { private IListFactory _fac; public Append(IListFactory fac) { _fac = fac; } /** * Returns the input list. * @param input input[0] is the list to append. */ public IList emptyCase(IMTList host, IList... input) { return input[0]; } /** * Returns the appended lists. * @param input input[0] is the list to append. */ public IList nonEmptyCase(INEList host, IList... input) { return _fac.makeNEList(host.getFirst(), host.getRest().execute(this, input)); } }