package ch.wlkl.shell;

public class Say<T> extends Top implements Write<T> {
	String pref = "";
	String suff = "";

	public Say(String...  ps) {
		reset(ps);
	}

	public void reset(Object... ps) {
		reset((String []) ps);
	}
	
	public void reset(String... ps) {
		if (ps.length > 2)
			fail("reset with " + ps.length + " > 2 arguments");
		if (ps.length >= 1)
			pref = ps[0];
		if (ps.length >= 2)
			suff = ps[1];
	}

	public void write(T arg) {
		System.out.println(pref + arg + suff);		
	}
	public void open(String opt) {
		fail("open not allowed");
	}

	public void close() {
		fail("close not allowed");
	}

}

