Java的动态表/矩阵数据结构 [英] Dynamic table / matrix data structure for Java

查看:517
本文介绍了Java的动态表/矩阵数据结构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要Java类型的表格式数据结构,我可以动态地插入或删除行和列。我需要从任何行或列快速获取数据,而不用选择行列,反之亦然。



有谁知道这样的数据结构已经存在的库实现?

解决方案

您可能可以使用DefaultTableModel。它旨在与JTable一起使用,但没有理由不能单独使用。您需要添加方法来检索完整行或列的数据。


I need a Java implementation of table-like data structure where I could dynamically insert or delete rows and columns. I need to get data from any row or column very fast and with no overhead in selecting row over column or vice versa.

Does anyone know libraries where such data structure is already implemented?

解决方案

You might be able to use the DefaultTableModel. It was intended to be used with a JTable, but there is no reason it can't be used alone. You would need to add methods to retrieve the data for a full row or column.

这篇关于Java的动态表/矩阵数据结构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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