• Post Reply Bookmark Topic Watch Topic
  • New Topic

Nested Enums  RSS feed

 
Govind Nair
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I am trying to get some nested enums working.

My requirement is that I have a n number of groups where each group in itself has set of data like ( string, int, int). I need to first randomly choose a group and then randomly choose a set of data from that group.

I tried using nested enums as given below



Now what I am trying is to randowmly get one of the inner enums and then within that get one of the values. So looking for something like a
coll.random().random().string to get data stored.

Right now there is an error as the inner enums are returning the outer enum type, not sure why.

I was also looking of making a hasmap of collection but wanted to clarify if something can be done with this.

Any ideas on how this can be reolved or if a better approach is suggested
 
Campbell Ritchie
Marshal
Posts: 56536
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

Too difficult a question for "beginning": moving thread.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!