我有一类 -提取物
public class Data implements Identifiable{
private Integer id;
public Integer getId(){
return id;
}
}
现在我已经2 collections-
List<Data> data1 = // few hundred Objects
Set<Integer> dataIds = // few object ids
我想提取List<Data>
从data1
其中有ID在dataIds
我应该怎么做?如果在性能/效率上可比,那么我的班级路线中就有番石榴,所以可以使用番石榴的功能性方法。
如果数据ID的对应于上述列表对象的ID的,那么为什么一个是整数。当对方是龙? 另外,使用什么样的集合类型?例如:data1是ArrayList 还是LinkedList? – dominicbri7 2011-04-21 15:45:59
是一个错误..更正 – Premraj 2011-04-21 15:48:40