Class ArrayMap<K,​V>

  • All Implemented Interfaces:
    java.util.Map<K,​V>

    public class ArrayMap<K,​V>
    extends java.util.AbstractMap<K,​V>
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      (package private) static class  ArrayMap.FastEntry<K,​V>  
      • Nested classes/interfaces inherited from class java.util.AbstractMap

        java.util.AbstractMap.SimpleEntry<K extends java.lang.Object,​V extends java.lang.Object>, java.util.AbstractMap.SimpleImmutableEntry<K extends java.lang.Object,​V extends java.lang.Object>
      • 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

      Fields 
      Modifier and Type Field Description
      private int size  
      private java.lang.Object[] table  
      protected java.util.Collection<V> values  
    • Constructor Summary

      Constructors 
      Constructor Description
      ArrayMap()  
      ArrayMap​(int capacity)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected V compute​(K key)  
      java.util.Set<java.util.Map.Entry<K,​V>> entrySet()  
      V get​(java.lang.Object key)  
      V getOrCompute​(K key)  
      V put​(K key, V value)  
      java.util.Collection<V> values()  
      • Methods inherited from class java.util.AbstractMap

        clear, clone, containsKey, containsValue, equals, hashCode, isEmpty, keySet, putAll, remove, size, toString
      • Methods inherited from class java.lang.Object

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

        compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
    • Field Detail

      • table

        private java.lang.Object[] table
      • size

        private int size
      • values

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

      • ArrayMap

        public ArrayMap()
      • ArrayMap

        public ArrayMap​(int capacity)
    • Method Detail

      • get

        public V get​(java.lang.Object key)
        Specified by:
        get in interface java.util.Map<K,​V>
        Overrides:
        get in class java.util.AbstractMap<K,​V>
      • put

        public V put​(K key,
                     V value)
        Specified by:
        put in interface java.util.Map<K,​V>
        Overrides:
        put in class java.util.AbstractMap<K,​V>
      • getOrCompute

        public V getOrCompute​(K key)
      • compute

        protected V compute​(K key)
      • values

        public java.util.Collection<V> values()
        Specified by:
        values in interface java.util.Map<K,​V>
        Overrides:
        values in class java.util.AbstractMap<K,​V>
      • entrySet

        public java.util.Set<java.util.Map.Entry<K,​V>> entrySet()
        Specified by:
        entrySet in interface java.util.Map<K,​V>
        Specified by:
        entrySet in class java.util.AbstractMap<K,​V>