Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java double entry table

Does anyone know a double entry table implementation in Java I can download ?

I need to do something like this

   1  2  3
   _______
a| x  y  z 

b| h  l  m

c| o  a  k

table.get(a,1) would return x

Of course, it should use any Object as key, value, etc

like image 721
Tom Avatar asked Dec 02 '25 09:12

Tom


1 Answers

There are two basic approaches, depending on your needs.

One is to make a Hashtable (or similar) of Hashtables.

Hashtable<Integer, Hashtable<String, String>> = ...;

Another approach is to build your own datatype that represents an (Integer, String) pair, so you can do:

Hashtable<YourFancyDatatype, String>
like image 192
VoteyDisciple Avatar answered Dec 05 '25 08:12

VoteyDisciple



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!