Class ArrayMap<K,​V>

  • All Implemented Interfaces:
    java.util.Map<K,​V>
    Direct Known Subclasses:
    HopscotchHashMap

    public abstract class ArrayMap<K,​V>
    extends java.util.AbstractMap<K,​V>
    Base for classes that implement hash map by storing keys in one array and values in another. It assumes that all keys that are in the array are contained in the map and that values are on corresponding indices in the map. Does not support null keys nor values. Forces implementation of methods get(Object), put(Object, Object), remove(Object)
    • Field Detail

      • size

        protected int size
      • keys

        protected java.lang.Object[] keys
      • values

        protected java.lang.Object[] values
      • modCount

        protected int modCount
    • Constructor Detail

      • ArrayMap

        public ArrayMap()
    • Method Detail

      • get

        public abstract V get​(java.lang.Object key)
      • put

        public abstract V put​(K key,
                              V value)
      • remove

        public abstract V remove​(java.lang.Object key)
      • size

        public int size()
      • containsValue

        public boolean containsValue​(java.lang.Object value)
      • keySet

        public java.util.Set<K> keySet()
      • values

        public java.util.Collection<V> values()
      • entrySet

        public java.util.Set<java.util.Map.Entry<K,​V>> entrySet()
      • containsKey

        public boolean containsKey​(java.lang.Object key)
      • clear

        public void clear()