Package org.apache.commons.collections4.trie

# Class AbstractPatriciaTrie.TrieEntry<K,V>

java.lang.Object
org.apache.commons.collections4.trie.AbstractPatriciaTrie.TrieEntry<K,V>

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

Enclosing class:
  AbstractPatriciaTrie<K,V>

protected static class AbstractPatriciaTrie.TrieEntry<K,V> extends Object
A `Trie` is a set of `AbstractPatriciaTrie.TrieEntry` nodes.

See Also:
  - Serialized Form

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected int`
  `bitIndex`
  The index this entry is comparing.
  `protected K`
  `key`
  `protected AbstractPatriciaTrie.TrieEntry<K,V>`
  `left`
  The left child of this entry.
  `protected AbstractPatriciaTrie.TrieEntry<K,V>`
  `parent`
  The parent of this entry.
  `protected AbstractPatriciaTrie.TrieEntry<K,V>`
  `predecessor`
  The entry who uplinks to this entry.
  `protected AbstractPatriciaTrie.TrieEntry<K,V>`
  `right`
  The right child of this entry.
  `protected V`
  `value`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `TrieEntry(K key, V value, int bitIndex)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `equals(Object o)`
  `K`
  `getKey()`
  `V`
  `getValue()`
  `int`
  `hashCode()`
  `boolean`
  `isEmpty()`
  Whether or not the entry is storing a key.
  `boolean`
  `isExternalNode()`
  Either the left or right child is a loopback.
  `boolean`
  `isInternalNode()`
  Neither the left nor right child is a loopback.
  `V`
  `setKeyValue(K key, V value)`
  Replaces the current key and value with the provided key & value.
  `V`
  `setValue(V value)`
  `String`
  `toString()`

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

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

- ## Field Details

  - ### bitIndex

    protected int bitIndex
    The index this entry is comparing.

  - ### parent

    protected AbstractPatriciaTrie.TrieEntry<K,V> parent
    The parent of this entry.

  - ### left

    protected AbstractPatriciaTrie.TrieEntry<K,V> left
    The left child of this entry.

  - ### right

    protected AbstractPatriciaTrie.TrieEntry<K,V> right
    The right child of this entry.

  - ### predecessor

    protected AbstractPatriciaTrie.TrieEntry<K,V> predecessor
    The entry who uplinks to this entry.

  - ### key

    protected K key

  - ### value

    protected V value

- ## Constructor Details

  - ### TrieEntry

    public TrieEntry(K key, V value, int bitIndex)

- ## Method Details

  - ### isEmpty

    public boolean isEmpty()
    Whether or not the entry is storing a key. Only the root can potentially be empty, all other nodes must have a key.

  - ### isExternalNode

    public boolean isExternalNode()
    Either the left or right child is a loopback.

  - ### isInternalNode

    public boolean isInternalNode()
    Neither the left nor right child is a loopback.

  - ### toString

    public String toString()

  - ### equals

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

  - ### 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>`

  - ### hashCode

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

  - ### setKeyValue

    public V setKeyValue(K key, V value)
    Replaces the current key and value with the provided key & value.

  - ### setValue

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