2007-08-22
closure and callback
关键字: java
最近看了一些闭包和回调的知识。
先在碰到一个问题。对于下面 这个函数,外面的环境我们不考虑。
public List convertStringToInteger(List strings) {
return Collections.convert(strings, new Converter() {
public Integer invoke(String orignal) {
return Integer.parseInt(orginal) ;
}
});
}
闭包应该是 程序块对他外部资源的调用,那么这个函数 是否也是 一个Anonimous实现的 假闭包呢。
在我看来这个 和回调 函数的形式也是类似的。不知道各位怎么看
对于closure和callback的应用,还是比较复杂的感觉。
先在碰到一个问题。对于下面 这个函数,外面的环境我们不考虑。
public List convertStringToInteger(List strings) {
return Collections.convert(strings, new Converter() {
public Integer invoke(String orignal) {
return Integer.parseInt(orginal) ;
}
});
}
闭包应该是 程序块对他外部资源的调用,那么这个函数 是否也是 一个Anonimous实现的 假闭包呢。
在我看来这个 和回调 函数的形式也是类似的。不知道各位怎么看
对于closure和callback的应用,还是比较复杂的感觉。
- 浏览: 2851 次
- 性别:

- 来自: 杭州

- 详细资料
搜索本博客
我的相册
大竹海04
共 2 张
共 2 张
最近加入圈子
最新评论
-
js 函数的定义、运行 顺 ...
niuyuewanzi 写道jonson 写道afcn0 写道大哥你不会指的是这 ...
-- by cyan19851224 -
题库贴
1。100的阶乘的程序: /* * To change this t ...
-- by jonson -
题库贴
3.SELECT PCLASS, PSCORE from (select PCL ...
-- by firefox_1983 -
题库贴
难道大家都是超级高手!!都不需要练手?还是觉得题目太简单!其实在工作之余 做做小 ...
-- by jonson -
丑陋的继承
jonson 写道bluemeteor 写道AbstractTopicPO |_ ...
-- by 抛出异常的爱






评论排行榜