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的应用,还是比较复杂的感觉。
评论
jonson
搜索本博客
博客分类
我的相册
Ab7edce1-aada-3efb-93cb-534f23a093c4-thumb
大竹海04
共 2 张
最近加入圈子
存档
最新评论