Class IndexedTreeMap.Entry<K,​V>

  • Type Parameters:
    K - key value type
    V - value value type
    All Implemented Interfaces:
    java.util.Map.Entry<K,​V>
    Enclosing class:
    IndexedTreeMap<K,​V>

    protected static final class IndexedTreeMap.Entry<K,​V>
    extends java.lang.Object
    implements java.util.Map.Entry<K,​V>
    Node in the Tree. Doubles as a means to pass key-value pairs back to user (see Map.Entry).
    • Constructor Detail

      • Entry

        protected Entry​(K key,
                        V value,
                        IndexedTreeMap.Entry<K,​V> parent)
        Make a new cell with given key, value, and parent, and with null child links, and BLACK color.
        Parameters:
        key - given key to be searched for
        value - of given key
        parent - of key
    • Method Detail

      • 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()
        Returns the key.
        Specified by:
        getKey in interface java.util.Map.Entry<K,​V>
        Returns:
        the key
      • getValue

        public V getValue()
        Returns the value associated with the key.
        Specified by:
        getValue in interface java.util.Map.Entry<K,​V>
        Returns:
        the value associated with the key
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface java.util.Map.Entry<K,​V>
        Overrides:
        hashCode in class java.lang.Object
      • setValue

        public V setValue​(V value)
        Replaces the value currently associated with the key with the given value.
        Specified by:
        setValue in interface java.util.Map.Entry<K,​V>
        Returns:
        the value associated with the key before this method was called
      • sumup

        public int sumup()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • updateWeight

        public void updateWeight​(int delta)