最好的办法或类似的lambda前pression或Android上的LINQ(蚀) [英] best way or similar lambda expression or linq on android (eclipse)
本文介绍了最好的办法或类似的lambda前pression或Android上的LINQ(蚀)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
例如,如果我有
ArrayList<Product> productlist = new ArrayList<Product> ();
你如何让所有产物。code
等于1和2?
有哪些我可以使用图书馆?
is there a library which can i use?
在C#中我可以使用
productlist.where(product=> product.code.contains(arraywithproductcode)).ToList();
或用其他的方式。
var newlist=(from p in productlist join a in arraywithproduct on a.product equals a select p);
我
如何能得到它在Java为Android?
how can i get it in java for android?
推荐答案
在机器人(或Java)无拉姆达前pressions呢。
No lambda expressions in Android (or Java) yet.
您可能希望看到这些选项(没有在Android中对它们进行测试虽然):
You might want to see these options (haven't tested them in Android though):
- Quaere: HTTP://quaere.$c$chaus.org
- JaQu: http://www.h2database.com/html/jaqu.html
- Linq4j: https://github.com/julianhyde/linq4j
- 油滑: http://slick.typesafe.com/
- Quaere: http://quaere.codehaus.org
- JaQu: http://www.h2database.com/html/jaqu.html
- Linq4j: https://github.com/julianhyde/linq4j
- Slick: http://slick.typesafe.com/
此外,请参阅此DZone链接和的这个。一个计算器后提到了这一点。
Also, see this DZone link and this one. A stackoverflow post mentions this.
LAMBDA前pression现已在Java SE 8
欲了解更多信息,请访问:
Lambda expression are now available in Java SE 8 For more information visit:
这篇关于最好的办法或类似的lambda前pression或Android上的LINQ(蚀)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文