Class ArrayMap<K,​V>

  • All Implemented Interfaces:
    Direct Known Subclasses:

    public abstract class ArrayMap<K,​V>
    extends 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 Object[] keys
      • values

        protected Object[] values
      • modCount

        protected int modCount
    • Constructor Detail

      • ArrayMap

        public ArrayMap()
    • Method Detail

      • get

        public abstract V get​(Object key)
      • put

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

        public abstract V remove​(Object key)
      • size

        public int size()
      • containsValue

        public boolean containsValue​(Object value)
      • keySet

        public Set<K> keySet()
      • containsKey

        public boolean containsKey​(Object key)
      • clear

        public void clear()