转换TreeSet中到ArrayList的? [英] Converting a TreeSet to ArrayList?

查看:1416
本文介绍了转换TreeSet中到ArrayList的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个TreeSet中包含> 100K的对象。
我有需要的ArrayList作为参数的另一种方法。

I have a TreeSet which contains > 100k objects. I have another method which requires ArrayList as an param.

有什么办法,我可以做到这一点不反复整个TreeSet中,然后手动添加每个对象ArrayList的?

Is there any way I can accomplish this without iterating whole TreeSet and then adding each object manually to ArrayList ?

推荐答案

这个怎么样:

new ArrayList<T>(set);

这篇关于转换TreeSet中到ArrayList的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆