I want to augment or lower the priority of items in a PriorityQueue
: for example, I might be downloading a long list of images and suddenly want the thirtieth one t
None of the collections in Java automatically reorders elements if you change the property that determine their order. For collections that depend on the .hashCode() , .equals() or some comparator, you are not allowed to change the object while it resides in the collection so that the hashcode/equals or comparator would yield different values.
You have to remove, change, re-insert the object if you want to change its priority within a PriorityQueue.