user2832367
user2832367

Reputation: 381

Most efficient way to implement table with multiple column?

I am attempting to create a table with multiple column such as

enter image description here

The initial implementation I thought was is that use Hashtable with key being "String" and value being "List" of String. But is this the most efficient way? I would be accessing data entry a lot and I am assuming since Java List is implemented in ArrayList, updating each data entry is not too slow. Am I correct?

Upvotes: 0

Views: 316

Answers (1)

Jean Logeart
Jean Logeart

Reputation: 53819

You can use Guava's Table.

For instance using a HashBasedTable:

Table<RowType, ColumnType, String> table = HashBasedTable.create();

Upvotes: 2

Related Questions