Class AbstractMap<K,​V>

  • All Implemented Interfaces:
    Direct Known Subclasses:
    EquivalentHashMap, FastCopyHashMap

    public abstract class AbstractMap<K,​V>
    extends java.lang.Object
    implements java.util.Map<K,​V>
    Similar to the JDK's AbstractMap, this provides common functionality for custom map implementations. Unlike JDK's AbstractMap, there is no support for null keys.
    Manik Surtani
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      protected static class  AbstractMap.SimpleEntry<K,​V>  
      • Nested classes/interfaces inherited from interface java.util.Map

        java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>
    • Field Summary

      Modifier and Type Field Description
      protected java.util.Set<java.util.Map.Entry<K,​V>> entrySet  
      protected java.util.Set<K> keySet  
      protected java.util.Collection<V> values  
    • Constructor Summary

      Constructor Description
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected static void assertKeyNotNull​(java.lang.Object key)  
      protected static boolean eq​(java.lang.Object o1, java.lang.Object o2)  
      protected static int hash​(java.lang.Object key)  
      int hashCode()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Map

        clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
    • Field Detail

      • entrySet

        protected transient java.util.Set<java.util.Map.Entry<K,​V>> entrySet
      • keySet

        protected transient java.util.Set<K> keySet
      • values

        protected transient java.util.Collection<V> values
    • Constructor Detail

      • AbstractMap

        public AbstractMap()
    • Method Detail

      • hashCode

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

        protected static int hash​(java.lang.Object key)
      • eq

        protected static boolean eq​(java.lang.Object o1,
                                    java.lang.Object o2)
      • assertKeyNotNull

        protected static void assertKeyNotNull​(java.lang.Object key)