public class CommMessage { 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(Message m) { if(parent !=null){ parent.output(m); } } public void input(Message m) { if(parent !=null){ parent.input(m); } } }