从ArrayList的对象,而LOOP - ANDROID [英] Select object from ARRAYLIST WITHOUT LOOP - ANDROID
问题描述
我要寻找可从ArrayList中选择的对象,如SQL库,其中命令。
I am looking for a library which can select object from ArrayList like SQL "where" command.
我有巨大的ArrayList(2000和20000之间),在我的项目,我不想写了,while循环每次..
I have huge arraylists (between 2000 and 20000) in my project and i don't want to write for,while loops every time..
我发现lambdaj,它是Java。
I found lambdaj and it is for Java.
我试图用lambdaj在我的Android项目,但我不能这样做。
I tried to use lambdaj inside my Android project but i couldn't do it.
例如当我写
名单,其中,销售与GT; sortedSales =排序(销售,上(Sale.class).getCost());
这个例子code在我的项目,日食都看不到的命令排序,...
For example when i write
List<Sale> sortedSales = sort(sales, on(Sale.class).getCost());
this example code in my project, eclipse couldn't see "sort", "on" commands..
有没有想lambdaj其他库或者谁能告诉我,我该如何使用lambdaj在我的Android项目?
Is there another library like lambdaj or can anyone tell me how can i use lambdaj in my android project ?
谢谢..
推荐答案
在番石榴库要比lambdaj更受欢迎,而且确实让你的避免获取,而循环使用preficates和过滤器的方法。
The Guava library is much more popular than lambdaj, and does allow you to avoid for, while loops by using preficates and filter methods.
这篇关于从ArrayList的对象,而LOOP - ANDROID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!