Short Version
How do you add values to a 3 dimensional array list at one go?
List<List<List<String>>> FD = new ArrayList<List<List<String>>>();
I learnt that for a normal Arraylist, the following can be done
List<String> R = new ArrayList<String>();
R.addAll(Arrays.asList("A","B","C","D","E"));
Longer Version
Note: I'll be using '->' symbol to represent 'determines'.
Read A -> B as 'A determines B'.
I am trying to capture the following information in some way.
A -> B, A,B -> C, B -> D,E
I felt a 3D list would come in handy as I pictured it in the following form
F[ --> Outermost List starts
[ --> Middle List start (first of the three middle lists)
[A],
[B]
], --> Middle List end
[
[A,B], --> Innermost list start and end (first of the two inner lists in this middle list)
[C]
],
[
[B],
[D,E]
]
] --> Outermost List ends
I chose a List since the size is dynamic to some extent (except that every middle list will always have only 2 inner lists)
I would appreciate if you could show me a simple way of populating such a list.
If you have some alternate implementation suggestions, I'm open to that too.
Thanks in advance