Click here to Skip to main content
15,791,675 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I've been tasked with writing a small program which represents a Roman Legion in Java.
Now, I've already created a working version which involves Array of Arrays of Arrays, etc. That is, a Legion is composed of 10 organizational units, each of which is composed of 6 other organizational units, each of which is composed by another 8 organizational units and finally, each of these is composed by 8 soldiers.
Now, my issue is that when working with Arrays, getting to the soldiers at the bottom of the "stack" of arrays is complicated.
Is there sometime I'm missing, or is creating this "Russian matryoshka doll" format with arrays the only way?
Thank you!!

EDIT: So I've been doing some more research and I found the "tree" object which seems to work with nodes that all interconnect. Can anyone provide some insight into the use of this object? I looked at some documentation and I'm having some issues figuring out whether I can have objects represent diffrerent nodes or "branches" of the tree.
Thank you!
Updated 13-Oct-10 0:45am

I believe this is somewhat similar to your situation, hopefully it may help Genealogy Tree[^]
Share this answer
Interesting, thank you.
The only issue is that I don't have a need for a swing interface.
Is there a way to implement this without making use of the interface?!
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900