Package org.jheaps

Interface AddressableHeap.Handle<K,​V>

  • Type Parameters:
    K - the type of keys maintained by this heap
    V - the type of values maintained by this heap
    All Known Subinterfaces:
    DoubleEndedAddressableHeap.Handle<K,​V>
    Enclosing interface:
    AddressableHeap<K,​V>

    public static interface AddressableHeap.Handle<K,​V>
    A heap element handle. Allows someone to address an element already in a heap and perform additional operations.
    • 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:
        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