Class SmallSortedMap.Entry

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

    private class SmallSortedMap.Entry
    extends java.lang.Object
    implements java.util.Map.Entry<K,​V>, java.lang.Comparable<SmallSortedMap.Entry>
    Entry implementation that implements Comparable in order to support binary search within the entry array. Also checks mutability in #setValue().
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private K key  
      private V value  
    • Constructor Summary

      Constructors 
      Constructor Description
      Entry​(java.util.Map.Entry<K,​V> copy)  
      Entry​(K key, V value)  
    • Field Detail

      • key

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

        private V value
    • Constructor Detail

      • Entry

        Entry​(java.util.Map.Entry<K,​V> copy)
      • Entry

        Entry​(K key,
              V value)
    • Method Detail

      • getKey

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

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

        public V setValue​(V newValue)
        Specified by:
        setValue in interface java.util.Map.Entry<K extends java.lang.Comparable<K>,​V>
      • equals

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

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

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

        private boolean equals​(java.lang.Object o1,
                               java.lang.Object o2)
        equals() that handles null values.