Class MMap<K,​V>

  • Type Parameters:
    K -
    V -

    public class MMap<K,​V>
    extends java.lang.Object
    Warning: this is a special map-like construct that suits only and should be used only in this package! It has the following properties:
    • memorizes once calculated hashCode
    • once hashCode calculated, goes into "read only" mode (put method will fail)
    • otherwise all the rest is same as for HashMap
    This class is not a generic map class; only those methods are "protected" that are in use in this very package.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.HashMap<K,​V> delegate  
    • Field Detail

      • delegate

        protected final java.util.HashMap<K,​V> delegate
    • Method Detail

      • empty

        public static <K,​V> MMap<K,​V> empty()
        Returns empty "done" (immutable) MMap.
      • emptyNotDone

        public static <K,​V> MMap<K,​V> emptyNotDone()
        Returns empty "not done" (mutable) MMap.
      • copy

        public static <K,​V> MMap<K,​V> copy​(MMap<K,​V> orig)
      • copyWithKey

        public static <K,​V> MMap<K,​java.util.Collection<V>> copyWithKey​(K key,
                                                                                    MMap<K,​java.util.Collection<V>> orig)
      • get

        public V get​(K key)
      • put

        public V put​(K key,
                     V value)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object