我希望能够使用lambdaj将子列表组合到一个列表中。我如何将使用lambdaj的列表组合在一起?
我有工作的一个迭代版本:
// HDU elements are children of each subsystem
Collection<SpaceSystemType> subsystems = this.getAllSubsystems();
Set<SpaceSystemType> sources = new HashSet<SpaceSystemType>();
// Iterate the subsystems, collecting all the sources
for (SpaceSystemType subsystem : subsystems)
sources.addAll(subsystem.getSpaceSystem()); // getSpaceSystem returns a List<SpaceSystemType>
return sources;
我希望能够做到这一点:
extract(subsystems, on(SpaceSystemType.class).getSpaceSystem());
但提取物返回
List<List<SpaceSystemType>>
所以我必须使用错误的命令。
哪个lambdaj命令实现了我想要的?