Is it possible to add elements to a collection while iterating over it?
More specifically, I would like to iterate over a collection, and if an element satisfies a certain condition I ...
I've had the same need a few times now and wanted to get other thoughts on the right way to structure a solution. The need is to perform some operation ...
I have an Iterator that I use on a HashMap, and I save and load the iterator.
is there a way to get the previous key in the HashMap with Iterator? (java.util.Iterator)
Why doesn't Set.size() match the number of elements in the set's iterator?
I'm using a HashSet, and I added some duplicate values. Those duplicates were automatically eliminated since I used a ...
I would like to iterate over a Set and remove the elements from the set that match some condition. The documentation of iterator says nothing about modifying the list ...
I talk to an API that gives me an java.util.Iterator over a collection. That means I can iterate over it but I can't get direct/random access to the elements.
Now to my ...
I have created a class called Month that extends Calendar, which I am using to hold events for a given month. I have several years worth of Month objects stored in ...
Could someone please tell me why the Iterator in this code does not return with he Element Object?!? Can't cast to Element Object! This is a JDOM implementation of SAX!