Java中的多维容器
我在 Google 上搜索,但找不到任何 Java 中多维容器的库(最好也支持泛型)。我可以轻松地编写一个(事实上,我已经开始这样做了),但我希望为了提高效率,我能够重用其他人所做的工作。我不一定需要在“容器”领域之外提供任何类型的附加功能(例如,没有矩阵功能)。
有人知道多维容器的任何类型的类/库吗?谢谢!
编辑:澄清一下,是的,我正在寻找集合的集合的集合...(或 int[][][][][] 等)。本质上是一个多维数组。
I searched around on Google, but I was unable to find any libraries for a multi-dimensional container in Java (preferably one that supports generics as well). I could easily write one (in fact, I have started to), but I was hoping that I would be able to reuse the work someone else has done for the sake of efficiency. I don't necessarily need to provide any sort of additional functionality outside of the "container" realm (AKA, no matrix functionality for example).
Does anybody know of any type of class/library for a multi-dimensional container? Thanks!
Edit: To clarify, yes, I am looking for a Collection of Collections of Collections ... (or int[][][][][], etc). Essentially, a multi-dimensional array.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
像这样的,收藏的收藏?
或者完全不同的东西?
Something like this, a Collection of Collections?
Or something completely different?
Google 收藏集支持多地图 和 多重集(包)。你是这个意思吗?
Google Collections supports multimaps and multisets (bags). Is that what you mean?
不能使用锯齿状数组(例如
int[][]
)吗?您可以将其设为 n 维 (
int[][][][]
),但过了一会儿它就开始变得愚蠢Can't you use a jagged array (eg
int[][]
)?You can make it n-dimensional (
int[][][][]
), but it starts to get silly after a while