简体   繁体   English

如何在嵌套ArrayList(ArrayList的ArrayList)中打开Array?

[英]How to turn an Array in nested ArrayList (ArrayList of ArrayList)?

I had to turn nested ArrayList 我不得不打开嵌套的ArrayList

 List<List<TockaXY>> clustersPorazdeljeni = new ArrayList<>(center.size()) 

in to Array, witch with help of nice people from this site is now clear: 进入Array之后,在这个站点的好人的帮助下,女巫现在很清楚了:

TockaXY[] arrayOfClusters = clustersPorazdeljeni.stream().flatMap(Collection::stream).toArray(TockaXY[]::new);

But I have to also do the reverse. 但是我也必须做相反的事情。 So how to get from arrayOfClusters back an nested ArrayList like 那么如何从arrayOfClusters中获取嵌套的ArrayList像

List<List<TockaXY>> newClustersPorazdeljeni 

?

You have asked vice versa question today. 你今天反之亦然。 How to convert nested ArrayList in Array? 如何在数组中转换嵌套的ArrayList?

TockaXY[] arrayOfClusters this is flat array and there is no mark how to split it to a few arrays. TockaXY [] arrayOfClusters这是平面数组,没有标记如何将其拆分为几个数组。 Maybe you should to do the convertation to another data structure not in TockaXY[], to map en example. 也许您应该转换为TockaXY []以外的其他数据结构,以映射示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM