|
-
July 4th, 2010, 06:26 PM
#1
Multi Dimension Arraylist
Hi,
I am trying to come up with a better way to store a score into a table that have X and Y axis.
It's just like 2D array, a score would be stored at the X's row and Y's column and I should be able to get that score using row and column number:
ie.
0 1 2 3 4
1 X X X X
2 X X X X
3 X X X X
4 X X X X
but here is my problem, 2D array work fine when I know the array size, but my input's size
depend on the input file that needs to be loaded into the application and their size are not fixed.
So right now, I end up using multiple ArrayList inside an ArrayList to simulate how the 2D array work, which solve the unfix input's size problem . But it just seem to be quite a messy way to solve this problem for me, so I was just wondering are there any other ways I could go about this?
Cheer!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|