Package ghidra.generic.util.datastruct
Class TreeValueSortedMap.Node
- java.lang.Object
-
- ghidra.generic.util.datastruct.TreeValueSortedMap.Node
-
- All Implemented Interfaces:
java.util.Map.Entry<K,V>
- Enclosing class:
- TreeValueSortedMap<K,V>
protected class TreeValueSortedMap.Node extends java.lang.Object implements java.util.Map.Entry<K,V>
An entry in the map. Nodes are elements of a binary tree and a doubly-linked list.
-
-
Field Summary
Fields Modifier and Type Field Description protected K
key
protected TreeValueSortedMap.Node
lChild
protected TreeValueSortedMap.Node
next
protected TreeValueSortedMap.Node
parent
protected TreeValueSortedMap.Node
prev
protected TreeValueSortedMap.Node
rChild
protected int
sizeLeft
protected V
val
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
computeIndex()
Compute this node's index.boolean
equals(java.lang.Object obj)
K
getKey()
V
getValue()
int
hashCode()
V
setValue(V value)
java.lang.String
toString()
-
-
-
Field Detail
-
key
protected final K key
-
val
protected V val
-
parent
protected TreeValueSortedMap.Node parent
-
lChild
protected TreeValueSortedMap.Node lChild
-
rChild
protected TreeValueSortedMap.Node rChild
-
sizeLeft
protected int sizeLeft
-
next
protected TreeValueSortedMap.Node next
-
prev
protected TreeValueSortedMap.Node prev
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
-
hashCode
public int hashCode()
-
computeIndex
public int computeIndex()
Compute this node's index. This uses thesizeLeft
field to compute the index in O(log n) on average.- Returns:
- the index
-
-