Class HashTreePMap


  • public final class HashTreePMap
    extends java.lang.Object
    A static convenience class for creating efficient persistent maps.

    This class simply creates HashPMaps backed by IntTreePMaps.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static HashPMap<java.lang.Object,​java.lang.Object> EMPTY  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private HashTreePMap()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <K,​V>
      HashPMap<K,​V>
      empty()  
      static <K,​V>
      HashPMap<K,​V>
      from​(java.util.Map<? extends K,​? extends V> map)  
      static <K,​V>
      HashPMap<K,​V>
      singleton​(K key, V value)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • EMPTY

        private static final HashPMap<java.lang.Object,​java.lang.Object> EMPTY
    • Constructor Detail

      • HashTreePMap

        private HashTreePMap()
    • Method Detail

      • empty

        public static <K,​V> HashPMap<K,​V> empty()
        Type Parameters:
        K -
        V -
        Returns:
        an empty map
      • singleton

        public static <K,​V> HashPMap<K,​V> singleton​(K key,
                                                                V value)
        Type Parameters:
        K -
        V -
        Parameters:
        key -
        value -
        Returns:
        empty().plus(key, value)
      • from

        public static <K,​V> HashPMap<K,​V> from​(java.util.Map<? extends K,​? extends V> map)
        Type Parameters:
        K -
        V -
        Parameters:
        map -
        Returns:
        empty().plusAll(map)