package listFW.visitor; import listFW.*; /** * A test algorithm that works on a list of strings, * combining the elements into a single String. */ public class MakePhrase implements IListAlgo { public static MakePhrase Singleton = new MakePhrase(); private MakePhrase() {} public String emptyCase(IMTList host, String ... inp) { return ""; } public String nonEmptyCase(INEList host, String ... inp) { return inp[0]+" "+host.getFirst()+" "+inp[1] +host.getRest().execute(this, inp); } }