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<String, String, String> {

    public static MakePhrase Singleton = new MakePhrase();

    private MakePhrase() {}

    

    public String emptyCase(IMTList<? extends String> host, String ... inp) {

        return "";

    }

    public String nonEmptyCase(INEList<? extends String> host,  String ... inp) {

        return inp[0]+" "+host.getFirst()+" "+inp[1] +host.getRest().execute(this, inp);

    }

}

