Package org.jheaps

Interface AddressableHeap.Handle<K,​V>

    • Method Detail

      • getKey

        K getKey()
        Return the key of the element.
        Returns:
        the key of the element
      • getValue

        V getValue()
        Return the value of the element.
        Returns:
        the value of the element
      • setValue

        void setValue​(V value)
        Set the value of the element.
        Parameters:
        value - the new value
      • decreaseKey

        void decreaseKey​(K newKey)
        Decrease the key of the element.
        Parameters:
        newKey - the new key
        Throws:
        java.lang.IllegalArgumentException - if the new key is larger than the old key according to the comparator used when constructing the heap or the natural ordering of the elements if no comparator was used
      • delete

        void delete()
        Delete the element from the heap that it belongs.
        Throws:
        java.lang.IllegalArgumentException - in case this function is called twice on the same element or the element has already been deleted using AddressableHeap.deleteMin().