priority

abstract override var priority: Priority(source)

Returns priority corresponding to that node. Change of the priority changes the corresponding priority in the structure and changes the inner structure to satisfy the heap property.

When detached (that happens only when the corresponding place is removed) holds the last priority it was holding. After detaching, the node just stores the priority that can be changed. And the changing won't modify the structure the node was detached from.

Note for implementers! Usually heaps do not provide increment (in case of minimum-heap and decrement in case of maximum-heap) of node's priority. However, it can be implemented it by removement of the node with consequent addition of it with new priority. Also, all popular implementations can do it without much hassle.