Package org.jheaps.tree
Class BinaryTreeSoftAddressableHeap.SoftHandle<K,V>
- java.lang.Object
-
- org.jheaps.tree.BinaryTreeSoftAddressableHeap.SoftHandle<K,V>
-
- All Implemented Interfaces:
java.io.Serializable,AddressableHeap.Handle<K,V>
- Enclosing class:
- BinaryTreeSoftAddressableHeap<K,V>
static class BinaryTreeSoftAddressableHeap.SoftHandle<K,V> extends java.lang.Object implements AddressableHeap.Handle<K,V>, java.io.Serializable
-
-
Field Summary
Fields Modifier and Type Field Description (package private) BinaryTreeSoftAddressableHeap<K,V>heap(package private) Kkey(package private) BinaryTreeSoftAddressableHeap.SoftHandle<K,V>next(package private) BinaryTreeSoftAddressableHeap.SoftHandle<K,V>prevprivate static longserialVersionUID(package private) BinaryTreeSoftAddressableHeap.TreeNode<K,V>tree(package private) Vvalue
-
Constructor Summary
Constructors Constructor Description SoftHandle(BinaryTreeSoftAddressableHeap<K,V> heap, K key, V value)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddecreaseKey(K newKey)Decrease the key of the element.voiddelete()Delete the element from the heap that it belongs.KgetKey()Return the key of the element.(package private) BinaryTreeSoftAddressableHeap<K,V>getOwner()VgetValue()Return the value of the element.voidsetValue(V value)Set the value of the element.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
heap
BinaryTreeSoftAddressableHeap<K,V> heap
-
key
K key
-
value
V value
-
next
BinaryTreeSoftAddressableHeap.SoftHandle<K,V> next
-
prev
BinaryTreeSoftAddressableHeap.SoftHandle<K,V> prev
-
tree
BinaryTreeSoftAddressableHeap.TreeNode<K,V> tree
-
-
Constructor Detail
-
SoftHandle
SoftHandle(BinaryTreeSoftAddressableHeap<K,V> heap, K key, V value)
-
-
Method Detail
-
getKey
public K getKey()
Return the key of the element.- Specified by:
getKeyin interfaceAddressableHeap.Handle<K,V>- Returns:
- the key of the element
-
getValue
public V getValue()
Return the value of the element.- Specified by:
getValuein interfaceAddressableHeap.Handle<K,V>- Returns:
- the value of the element
-
setValue
public void setValue(V value)
Set the value of the element.- Specified by:
setValuein interfaceAddressableHeap.Handle<K,V>- Parameters:
value- the new value
-
decreaseKey
public void decreaseKey(K newKey)
Decrease the key of the element.- Specified by:
decreaseKeyin interfaceAddressableHeap.Handle<K,V>- Parameters:
newKey- the new key- Throws:
java.lang.UnsupportedOperationException- always, as this operation is not supported in soft heaps
-
delete
public void delete()
Delete the element from the heap that it belongs.- Specified by:
deletein interfaceAddressableHeap.Handle<K,V>
-
getOwner
BinaryTreeSoftAddressableHeap<K,V> getOwner()
-
-