public class Comm { public CommListener parent; public void set(CommListener parent) { this.parent = parent; } public void start() { if(parent != null){ parent.start(); } } public void end() { if(parent !=null){ parent.end(); } } public void output(String s) { if(parent !=null){ parent.output(s); } } public void input(String s) { if(parent !=null){ parent.input(s); } } }