文件名称:Adapter
- 所属分类:
- JSP源码/Java
- 资源属性:
- [Java] [源码]
- 上传时间:
- 2012-11-26
- 文件大小:
- 105kb
- 下载次数:
- 0次
- 提 供 者:
- h**
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
适配器模式,完整代码,运行结果截图
题目:
有一个类(adaptee)实现了数学中的幂次运算,方法中需要传入两个参数,一个是基数base,另外一个是幂次exp。现在客户端需要一个求得一个数的平方的函数接口(target),传入一个数,得到它的平方值。为了复用已经存在的类adaptee,适用Adapter来适配adaptee,adapter实现了target接口。 -Adapter mode, the complete code, the results capture Title: A Class (adaptee) to achieve a power of mathematics in the operation, the method requires two arguments, one is the base base, the other is a power exp. Now the client needs to obtain a square of a function Interface (target), pass a number, get it squared value. In order to reuse existing classes adaptee, for Adapter to fit adaptee, adapter implements the target interface.
题目:
有一个类(adaptee)实现了数学中的幂次运算,方法中需要传入两个参数,一个是基数base,另外一个是幂次exp。现在客户端需要一个求得一个数的平方的函数接口(target),传入一个数,得到它的平方值。为了复用已经存在的类adaptee,适用Adapter来适配adaptee,adapter实现了target接口。 -Adapter mode, the complete code, the results capture Title: A Class (adaptee) to achieve a power of mathematics in the operation, the method requires two arguments, one is the base base, the other is a power exp. Now the client needs to obtain a square of a function Interface (target), pass a number, get it squared value. In order to reuse existing classes adaptee, for Adapter to fit adaptee, adapter implements the target interface.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
Adapter\.classpath
.......\.project
.......\bin\Adaptee.class
.......\...\Adapter.class
.......\...\Client.class
.......\...\Target.class
.......\src\Adaptee.java
.......\...\Adapter.java
.......\...\Client.java
.......\...\Target.java
截图.png
Adapter\bin
.......\src
Adapter
.......\.project
.......\bin\Adaptee.class
.......\...\Adapter.class
.......\...\Client.class
.......\...\Target.class
.......\src\Adaptee.java
.......\...\Adapter.java
.......\...\Client.java
.......\...\Target.java
截图.png
Adapter\bin
.......\src
Adapter