Package org.jheaps.tree
Class DaryTreeAddressableHeap.Node
- java.lang.Object
-
- org.jheaps.tree.DaryTreeAddressableHeap.Node
-
- All Implemented Interfaces:
java.io.Serializable
,AddressableHeap.Handle<K,V>
- Enclosing class:
- DaryTreeAddressableHeap<K,V>
private class DaryTreeAddressableHeap.Node extends java.lang.Object implements AddressableHeap.Handle<K,V>, java.io.Serializable
-
-
Field Summary
Fields Modifier and Type Field Description (package private) DaryTreeAddressableHeap.Node[]
children
(package private) K
key
(package private) DaryTreeAddressableHeap.Node
parent
private static long
serialVersionUID
(package private) V
value
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
decreaseKey(K newKey)
Decrease the key of the element.void
delete()
Delete the element from the heap that it belongs.K
getKey()
Return the key of the element.V
getValue()
Return the value of the element.void
setValue(V value)
Set the value of the element.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
key
K key
-
value
V value
-
parent
DaryTreeAddressableHeap.Node parent
-
children
DaryTreeAddressableHeap.Node[] children
-
-
Method Detail
-
getKey
public K getKey()
Description copied from interface:AddressableHeap.Handle
Return the key of the element.- Specified by:
getKey
in interfaceAddressableHeap.Handle<K,V>
- Returns:
- the key of the element
-
getValue
public V getValue()
Description copied from interface:AddressableHeap.Handle
Return the value of the element.- Specified by:
getValue
in interfaceAddressableHeap.Handle<K,V>
- Returns:
- the value of the element
-
setValue
public void setValue(V value)
Description copied from interface:AddressableHeap.Handle
Set the value of the element.- Specified by:
setValue
in interfaceAddressableHeap.Handle<K,V>
- Parameters:
value
- the new value
-
decreaseKey
public void decreaseKey(K newKey)
Description copied from interface:AddressableHeap.Handle
Decrease the key of the element.- Specified by:
decreaseKey
in interfaceAddressableHeap.Handle<K,V>
- Parameters:
newKey
- the new key
-
delete
public void delete()
Description copied from interface:AddressableHeap.Handle
Delete the element from the heap that it belongs.- Specified by:
delete
in interfaceAddressableHeap.Handle<K,V>
-
-