Class AbstractPatriciaTrie.TrieEntry<K,V>

java.lang.Object
org.apache.commons.collections4.trie.AbstractPatriciaTrie.TrieEntry<K,V>
Type Parameters:
K - the key type.
V - the value type.
All Implemented Interfaces:
Serializable, Map.Entry<K,V>
Enclosing class:
AbstractPatriciaTrie<K,V>

protected static class AbstractPatriciaTrie.TrieEntry<K,V> extends Object
See Also:
  • Field Details

  • Constructor Details

    • TrieEntry

      public TrieEntry(K key, V value, int bitIndex)
      Constructs a new instance.
      Parameters:
      key - The entry's key.
      value - The entry's value.
      bitIndex - The entry's bitIndex.
  • Method Details

    • isEmpty

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

      public boolean isExternalNode()
      Whether the left or right child is a loopback.
      Returns:
      Whether the left or right child is a loopback.
    • isInternalNode

      public boolean isInternalNode()
      Tests that neither the left nor right child is a loopback.
      Returns:
      That 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.
      Parameters:
      key - The new key.
      value - The new value.
      Returns:
      The previous value.
    • setValue

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