Package ghidra.generic.util.datastruct

# Class TreeValueSortedMap.Node

java.lang.Object
ghidra.generic.util.datastruct.TreeValueSortedMap.Node

All Implemented Interfaces:
  `Map.Entry<K,V>`

Enclosing class:
  `TreeValueSortedMap<K,V>`

protected class TreeValueSortedMap.Node extends Object implements 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 final K`
  `key`
  `protected TreeValueSortedMap<K,V>.Node`
  `lChild`
  `protected TreeValueSortedMap<K,V>.Node`
  `next`
  `protected TreeValueSortedMap<K,V>.Node`
  `parent`
  `protected TreeValueSortedMap<K,V>.Node`
  `prev`
  `protected TreeValueSortedMap<K,V>.Node`
  `rChild`
  `protected int`
  `sizeLeft`
  `protected V`
  `val`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `Node(K key, V val)`
  Construct a new node

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `computeIndex()`
  Compute this node's index.
  `boolean`
  `equals(Object obj)`
  `K`
  `getKey()`
  `V`
  `getValue()`
  `int`
  `hashCode()`
  `V`
  `setValue(V value)`
  `String`
  `toString()`

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### key

    protected final K key

  - ### val

    protected V val

  - ### parent

    protected TreeValueSortedMap<K,V>.Node parent

  - ### lChild

    protected TreeValueSortedMap<K,V>.Node lChild

  - ### rChild

    protected TreeValueSortedMap<K,V>.Node rChild

  - ### sizeLeft

    protected int sizeLeft

  - ### next

    protected TreeValueSortedMap<K,V>.Node next

  - ### prev

    protected TreeValueSortedMap<K,V>.Node prev

- ## Constructor Details

  - ### Node

    protected Node(K key, V val)
    Construct a new node
    Parameters:
      `key` - the key
      `val` - the data

- ## Method Details

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### equals

    public boolean equals(Object obj)
    Specified by:
      `equals` in interface `Map.Entry<K,V>`
    Overrides:
      `equals` in class `Object`

  - ### hashCode

    public int hashCode()
    Specified by:
      `hashCode` in interface `Map.Entry<K,V>`
    Overrides:
      `hashCode` in class `Object`

  - ### computeIndex

    public int computeIndex()
    Compute this node's index. This uses the `sizeLeft` field to compute the index in O(log n) on average.
    Returns:
      the index

  - ### getKey

    public K getKey()
    Specified by:
      `getKey` in interface `Map.Entry<K,V>`

  - ### getValue

    public V getValue()
    Specified by:
      `getValue` in interface `Map.Entry<K,V>`

  - ### setValue

    public V setValue(V value)
    Specified by:
      `setValue` in interface `Map.Entry<K,V>`