Class AbstractPatriciaTrie.TrieEntry<K,​V>

    • Constructor Summary

      Constructors 
      Constructor Description
      TrieEntry​(K key, V value, int bitIndex)
      Constructs a new instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      K getKey()  
      V getValue()  
      int hashCode()  
      boolean isEmpty()
      Tests whether the entry is storing a key.
      boolean isExternalNode()
      Tests whether the left or right child is a loopback.
      boolean isInternalNode()
      Tests that 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)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • 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 Detail

      • isEmpty

        public boolean isEmpty()
        Tests 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()
        Tests 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 java.lang.String toString()
      • equals

        public boolean equals​(java.lang.Object o)
        Specified by:
        equals in interface java.util.Map.Entry<K,​V>
        Overrides:
        equals in class java.lang.Object
      • getKey

        public K getKey()
        Specified by:
        getKey in interface java.util.Map.Entry<K,​V>
      • getValue

        public V getValue()
        Specified by:
        getValue in interface java.util.Map.Entry<K,​V>
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface java.util.Map.Entry<K,​V>
        Overrides:
        hashCode in class java.lang.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 java.util.Map.Entry<K,​V>