文件名称:Adapter
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:105.5kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
适配器模式,完整代码,运行结果截图
题目:
有一个类(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
Adapter/.project
Adapter/bin/Adaptee.class
Adapter/bin/Adapter.class
Adapter/bin/Client.class
Adapter/bin/Target.class
Adapter/src/Adaptee.java
Adapter/src/Adapter.java
Adapter/src/Client.java
Adapter/src/Target.java
截图.png
Adapter/bin
Adapter/src
Adapter
Adapter/.project
Adapter/bin/Adaptee.class
Adapter/bin/Adapter.class
Adapter/bin/Client.class
Adapter/bin/Target.class
Adapter/src/Adaptee.java
Adapter/src/Adapter.java
Adapter/src/Client.java
Adapter/src/Target.java
截图.png
Adapter/bin
Adapter/src
Adapter
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.