Class TreeBidiMap.Node<K extends java.lang.Comparable<K>,​V extends java.lang.Comparable<V>>

  • All Implemented Interfaces:
    java.util.Map.Entry<K,​V>, KeyValue<K,​V>
    Enclosing class:
    TreeBidiMap<K extends java.lang.Comparable<K>,​V extends java.lang.Comparable<V>>

    static class TreeBidiMap.Node<K extends java.lang.Comparable<K>,​V extends java.lang.Comparable<V>>
    extends java.lang.Object
    implements java.util.Map.Entry<K,​V>, KeyValue<K,​V>
    A node used to store the data.
    • Field Detail

      • key

        private final K extends java.lang.Comparable<K> key
      • value

        private final V extends java.lang.Comparable<V> value
      • leftNode

        private final TreeBidiMap.Node<K extends java.lang.Comparable<K>,​V extends java.lang.Comparable<V>>[] leftNode
      • rightNode

        private final TreeBidiMap.Node<K extends java.lang.Comparable<K>,​V extends java.lang.Comparable<V>>[] rightNode
      • parentNode

        private final TreeBidiMap.Node<K extends java.lang.Comparable<K>,​V extends java.lang.Comparable<V>>[] parentNode
      • blackColor

        private final boolean[] blackColor
      • hashcodeValue

        private int hashcodeValue
      • calculatedHashCode

        private boolean calculatedHashCode
    • Constructor Detail

      • Node

        Node​(K key,
             V value)
        Make a new cell with given key and value, and with null links, and black (true) colors.
        Parameters:
        key - the key of this node
        value - the value of this node
    • Method Detail

      • getKey

        public K getKey()
        Gets the key.
        Specified by:
        getKey in interface KeyValue<K extends java.lang.Comparable<K>,​V extends java.lang.Comparable<V>>
        Specified by:
        getKey in interface java.util.Map.Entry<K extends java.lang.Comparable<K>,​V extends java.lang.Comparable<V>>
        Returns:
        the key corresponding to this entry.
      • getValue

        public V getValue()
        Gets the value.
        Specified by:
        getValue in interface KeyValue<K extends java.lang.Comparable<K>,​V extends java.lang.Comparable<V>>
        Specified by:
        getValue in interface java.util.Map.Entry<K extends java.lang.Comparable<K>,​V extends java.lang.Comparable<V>>
        Returns:
        the value corresponding to this entry.
      • setValue

        public V setValue​(V ignored)
                   throws java.lang.UnsupportedOperationException
        Optional operation that is not permitted in this implementation
        Specified by:
        setValue in interface java.util.Map.Entry<K extends java.lang.Comparable<K>,​V extends java.lang.Comparable<V>>
        Parameters:
        ignored - this parameter is ignored.
        Returns:
        does not return
        Throws:
        java.lang.UnsupportedOperationException - always
      • equals

        public boolean equals​(java.lang.Object obj)
        Compares the specified object with this entry for equality. Returns true if the given object is also a map entry and the two entries represent the same mapping.
        Specified by:
        equals in interface java.util.Map.Entry<K extends java.lang.Comparable<K>,​V extends java.lang.Comparable<V>>
        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - the object to be compared for equality with this entry.
        Returns:
        true if the specified object is equal to this entry.
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface java.util.Map.Entry<K extends java.lang.Comparable<K>,​V extends java.lang.Comparable<V>>
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        the hash code value for this map entry.