java - Need some help on collection choice -


this question has answer here:

i've got problem designing in code. i'm writing prototype game in java i'm not confortable choices i've made. game has couple of classes: circle, circleset , component ( main class ). relationships between these classes following: 1 circleset can have multiple circles , every circle needs know in circleset it's in.

can me examples of collections , suits best me?

thanks in advance!

intodudec circleset id in circleset class. add set of circles in circleset class

set <circles> = new hashset<circles>(); 

in component class, create hashmap containing mapping of circlesetid , set of circles mentioned here:

map <string,hashset> circlsetmapping = new hashmap<string,hashset>(); 

hope helps!


Comments