适配器(adapter)模式
来源:互联网 发布:什么软件检测电脑硬件 编辑:程序博客网 时间:2024/06/05 19:22
适配器模式很好理解,直接看图即可:
即 Adapter实现 Target接口,同时自身内部有一个 Adaptee 引用.
一个适配器模式大家都举的例子:
上面类图的代码如下:
public class EnumerationIterator implements Iterator {Enumeration enum;public EnumerationIterator(Enumeration enum) {this.enum = enum;}public boolean hasNext() {return enum.hasoreElements();}public Object next() {return enum.nextElement();}public void remove() {throw new UnsupportedOperationException();}}
注意, EnumerationIterator 类有一个成员变量为 Enumeration 对象。
- Adapter模式 适配器模式
- 适配器模式(Adapter)
- 适配器模式(Adapter)
- 适配器(Adapter)模式
- 适配器模式(Adapter Pattern)
- ADAPTER(适配器)模式
- 适配器模式(adapter)
- Adapter适配器模式
- 适配器(Adapter)模式
- 适配器模式(Adapter Pattern)
- Adapter(适配器)模式
- 适配器模式(adapter)
- 适配器模式(Adapter)
- 适配器模式(Adapter)
- 适配器模式(Adapter)
- 适配器模式 Adapter Pattern
- Adapter 适配器模式
- 适配器模式(Adapter)
- 函数要多小才够好——谈小函数之道
- oracle 数据库增量备份
- C#定时器timer 旁若无人progreeBar
- jsp---->JavaBean
- 消息队列 rabbitmq 学习 记录
- 适配器(adapter)模式
- C C++ 输出中文 【转】
- jsp---->Smartupload例子代码
- 关于eas 单据中有多个分录的情况下,默认是哪个实现了排序
- jPlayer使用指南
- 给设计师的忠告:字体排版是网页设计的基础
- jsp---->SmartUpload相关类说明
- 博客说明
- EXT3文件系统系统下数据--WINDOWS虚拟机