Let's suppose my Java program has 3 types of custom designed objects (entities, relationships, rulesets). If I need to build a collection of at least 1, but up to 3 of the types, each with a size of 0 to n, what is the best way to do so? Is the set class the right thing to use? Can the Collection class be used? How would I define such a 'set' or 'collection' in Java?
Asked
Active
Viewed 58 times
1
-
2http://stackoverflow.com/questions/21974361/what-java-collection-should-i-use – aliteralmind Mar 17 '14 at 00:59
-
That's a good page! My googlefoo failed me, hence why I wrote this. I think I can figure it out from here. Should I close this? – WildBill Mar 17 '14 at 01:04
-
Not sure. Great chart, though, right? – aliteralmind Mar 17 '14 at 01:06
-
1I tried to close this but I could not. If you make this the answer I'll award you credit for doing so. – WildBill Apr 03 '14 at 15:34
-
Done. Much appreciated! – aliteralmind Apr 03 '14 at 17:05
1 Answers
1
This flow chart, as created by @TimB, is a great tool for determining the right collection based on particular requirements.

Community
- 1
- 1

aliteralmind
- 19,847
- 17
- 77
- 108