设计模式(Java)-装饰者模式
来源:互联网 发布:图文编辑排版软件 编辑:程序博客网 时间:2024/05/16 08:33
类图
Coding
package DecoratorPattern;/** * Created by jiangcw on 2017/2/3. */public abstract class Component { public abstract void operate();}
package DecoratorPattern;/** * Created by jiangcw on 2017/2/3. */public class ConcreteComponent extends Component{ @Override public void operate() { System.out.println("Do something...."); }}
package DecoratorPattern;/** * Created by jiangcw on 2017/2/3. */public abstract class Decorator extends Component{ private Component component =null; public Decorator(Component _component){ this.component=_component; } @Override public void operate(){ this.component.operate(); }}
package DecoratorPattern;/** * Created by jiangcw on 2017/2/3. */public class Decorator1 extends Decorator { public Decorator1(Component _component){ super(_component); } @Override public void operate() { System.out.println("Decorator 1....."); super.operate(); }}
package DecoratorPattern;/** * Created by jiangcw on 2017/2/3. */public class Decorator2 extends Decorator { public Decorator2(Component _component){ super(_component); } @Override public void operate() { System.out.println("Decorator 2....."); super.operate(); }}
0 0
- 设计模式(Java)-装饰者模式
- Java设计模式(装饰者模式)
- (设计模式)装饰者模式-java
- Java设计模式-装饰者设计模式
- java设计模式---装饰者设计模式
- JAVA 装饰类(装饰设计模式)
- 设计模式之装饰者(java)
- Java 装饰者设计模式
- Java设计模式--装饰者
- Java设计模式:装饰者模式(Decorator)
- java设计模式之装饰者模式
- 【Java设计模式】装饰者模式
- Java设计模式之装饰者模式
- JAVA系列-设计模式-装饰者模式
- java设计模式之装饰者模式
- Java 设计模式 装饰者模式
- Java设计模式之装饰者模式
- Java设计模式之装饰者模式
- 4-循环练习_数组
- nodejs实现导出、下载功能
- 重构-卫语句
- linux下配置niginxhttps
- Strut2里拦截器不能加载的问题
- 设计模式(Java)-装饰者模式
- Lambda 表达式回顾
- enum与static final map
- 浏览器访问网页的详细内部过程
- 《Spring实战》学习笔记(一)装配Bean
- 5-二维数组_练习_字符串处理函数_指针
- Codeforces 764C Timofey and a tree(思路)
- IOS10 Notification推送通知(一)
- 6-字符指针_删除字符串中的空格_register_指针数组