Closed GoogleCodeExporter closed 9 years ago
That would be bad. To implement this, you have to destroy the queue. But since
iterators are not supposed to be destructive, you'd need to create internally a
copy and destroy /that/ instead. If you were willing to do that, copying and
polling one by one would be just as good, so the net effect would be that you
simply lose an efficient way to access all elements of the queue.
Compare with java.util.PriorityQueue.
Original comment by jim.andreou
on 19 Feb 2011 at 6:04
I was sort of expecting this, but was hoping that it would be possible to do
some internal tricks in the datastructure to not screw up the queue, e.g. by
simulating removal with separate index pointers. But I haven't studied the code
sufficiently to understand if that would be possible.
Original comment by hein.mel...@gmail.com
on 19 Feb 2011 at 8:35
For what you want, use a SortedSet.
Original comment by kevin...@gmail.com
on 19 Feb 2011 at 11:48
This issue has been migrated to GitHub.
It can be found at https://github.com/google/guava/issues/<id>
Original comment by cgdecker@google.com
on 1 Nov 2014 at 4:15
Original comment by cgdecker@google.com
on 3 Nov 2014 at 9:09
Original issue reported on code.google.com by
hein.mel...@gmail.com
on 19 Feb 2011 at 4:59