Priority Queue for objects that may change: what is the best method for implementing them?
<p>I need to store objects in a heap/priority queue. However, the objects may change so that their ordering changes, so fixUp or fixDown may need to be called on them. These methods are private and Java PriorityQueue wont let me do this. My options are:</p>

<ol>
<li><p>use java PriorityQueue and remove and reinsert the object. Seems pretty inefficient, double the work.</p></li>
<li><p>Implement my own priority queue and maintain code that duplicates functionality in the Java standard library.</p></li>
</ol>

<p>Which would be preferred method/best practice for doing this ?
This sort of operations are needed to implement many graph algorithms eg. A*, so it is surprising Java does not let you do that.</p>
