Originally posted by Mike Curwen:
I can't believe it wouldn't be useful. As TreeSet (or HashSet) currently stands, the only way to retrieve a single item from the Set is to iterate over all of them, using equals() to see if you have the 'right one'.
Maybe I'm using the wrong Collection object.
* I want a 'bag' of items.
* When I iterate over them, I want to iterate in the order they were inserted.
* Each object the 'bag' contains has it's own identifying 'number', so the containing bag's idea of what index its stored under does not matter.
* i should be able to remove() an item, based on its identifying 'number'.
* size() should return the number of items in the bag, and not the number of spaces (empty or not) in the bag