Class Map2<K,​V>

  • All Implemented Interfaces:
    java.lang.Iterable<K>

    public class Map2<K,​V>
    extends java.lang.Object
    implements java.lang.Iterable<K>
    A map with parent sharing. New entries go into a map but lookup is passed to the parent map if nothing is found at this level.
    • Constructor Summary

      Constructors 
      Constructor Description
      Map2​(java.util.Map<K,​V> map1, Map2<K,​V> map2)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean containsKey​(K key)  
      V get​(K key)  
      boolean isEmpty()  
      java.util.Iterator<K> iterator()  
      void put​(K key, V value)  
      int size()  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Constructor Detail

      • Map2

        public Map2​(java.util.Map<K,​V> map1,
                    Map2<K,​V> map2)
    • Method Detail

      • containsKey

        public boolean containsKey​(K key)
      • get

        public V get​(K key)
      • put

        public void put​(K key,
                        V value)
      • iterator

        public java.util.Iterator<K> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<K>
      • isEmpty

        public boolean isEmpty()
      • size

        public int size()