摘要:
阅读全文
posted @ 2017-09-05 12:53
皈依之路
阅读(141)
评论(0)
推荐(0)
摘要:
介绍 角色 使用场景 代码实现 public interface Command { //这个方法是一个返回结果为空的方法 //实际项目中,可以根据需求设计多个不同的方法 void execute(); } class ConcreteCommand implements Command{ priv 阅读全文
posted @ 2017-09-05 12:50
皈依之路
阅读(215)
评论(0)
推荐(0)
摘要:
代码实现 public interface Mediator { void register(String dname,Department d); void command(String dname); } /* * 同事类接口 */ public interface Department { v 阅读全文
posted @ 2017-09-05 12:01
皈依之路
阅读(190)
评论(0)
推荐(0)
摘要:
代码实现 public interface MyIterator { void first(); //将游标指向第一个元素 void next(); //将游标指向下一个元素 boolean hasNext(); //判断是否存在下一个元素 boolean isFirst(); boolean is 阅读全文
posted @ 2017-09-05 11:50
皈依之路
阅读(139)
评论(0)
推荐(0)
摘要:
后面我们将学习设计模式里面的行为型模式 代码实现 /** * 抽象类 * @author bzhx * 2017年3月14日 */ public abstract class Leader { protected String name; protected Leader nextLeader; / 阅读全文
posted @ 2017-09-05 11:42
皈依之路
阅读(246)
评论(0)
推荐(0)