android - What Java Collection to use in this case? -


i java novice , trying figure out java collection use flatten values json java collection don't know collection use. here getting json:

user: tim product: beer

user: tim product: bread

user: tim product: milk

user: tim product: soap

user: michael product: soap

user: michael product: coffee

user: michael product: car

user: wayne product: bread

user: wayne product: soap

as can see users have following products: tim: beer, bread, milk, soap michael: soap, coffee, car wayne: bread, soap

what best collection use store these can determine products held 1 user?

for example, providing key=michael, soap, coffee, car.

much appreciated,

depends on usecase data. seems map choice.


Comments

Popular posts from this blog

android - questions about switching from C2DM to GCM -

c++ - Qt setGeometry: Unable to set geometry -

batch file - How to extract all multi-volume RAR archives from subfolders of a folder? -