Help with a Collection
Hi,I have a Collection of objects and I want to somehow output each the name of each object and how many times it occurs in the Collection.Any ideas? Sorry I can't really explain it better.
[211 byte] By [
giggipa] at [2007-11-27 1:02:39]

What's a name of an object? You are pretty vague? Why can't you be more specific?
Create a map
Iterate over the collection, get the name of each object, check if it exists in the map. Add it to the map if it doesn't exist, use the name as key and a counter as value. Just increase the counter if it exists.
Kaj
kajbja at 2007-7-11 23:37:39 >

Ah, nice idea, thanks.Once you have everything in a Map though, how would you iterate through?Thanks!