Class HashMapFactory

java.lang.Object
com.ibm.wala.util.collections.HashMapFactory

public class HashMapFactory extends Object
A debugging aid. When HashSetFactory.DEBUG is set, this class creates ParanoidHashMaps. Otherwise, it returns LinkedHashMap
  • Constructor Details

    • HashMapFactory

      public HashMapFactory()
  • Method Details

    • make

      public static <K,V> HashMap<K,V> make(int size)
      Returns:
      A ParanoidHashMap if DEBUG = true, a LinkedHashMap otherwise
    • make

      public static <K,V> HashMap<K,V> make()
      Returns:
      A ParanoidHashMap if DEBUG = true, a LinkedHashMap otherwise
    • make

      public static <K,V> HashMap<K,V> make(Map<? extends K, ? extends V> t)
      Returns:
      A ParanoidHashMap if DEBUG = true, a LinkedHashMap otherwise
    • toMap

      @NotNull public static <T,K,V> @NotNull Collector<T, ?, HashMap<K,V>> toMap(@NotNull @NotNull Function<? super T, ? extends K> keyMapper, @NotNull @NotNull Function<? super T, ? extends V> valueMapper)
      Returns a Collector that accumulates the input elements into a new HashMap as provided by make().
      Type Parameters:
      T - the type of the input elements
      K - the type of the result map's keys
      V - the type of the result map's values
      Returns:
      a Collector that collects all the input elements into a HashMap