您的位置:首页 > 其它

设计技巧22:Mediator 中介者模式 顾问,沟通所有复杂组件之间的关系

2013-10-16 17:29 423 查看
public class Mediator{//中介者 Button button;//被调停的对象TextView textView//被调停的对象public Mediator(Button button,TextView textView){this.button = button;this.textView = textView;button.setOnClickListener{onClick(){schdele();} private void schdele(){//被调停对象之间的联系textView.setText(button.getText());}  java.util.Timer (all scheduleXXX() methods)java.util.concurrent.Executor#execute()java.util.concurrent.ExecutorService (the invokeXXX() and submit() methods)java.util.concurrent.ScheduledExecutorService (all scheduleXXX() methods)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: