Class HppcMaps


  • public final class HppcMaps
    extends java.lang.Object
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  HppcMaps.Object  
    • Method Summary

      Modifier and Type Method Description
      static <K,​V>
      com.carrotsearch.hppc.ObjectObjectHashMap<K,​V>
      ensureNoNullKeys​(int expectedElements)
      Wraps the given map and prevent adding of null keys.
      static <T> java.lang.Iterable<T> intersection​(com.carrotsearch.hppc.ObjectLookupContainer<T> container1, com.carrotsearch.hppc.ObjectLookupContainer<T> container2)  
      static <K,​V>
      com.carrotsearch.hppc.ObjectObjectHashMap<K,​V>
      newMap()
      Returns a new map with a default initial capacity.
      static <K,​V>
      com.carrotsearch.hppc.ObjectObjectHashMap<K,​V>
      newMap​(int expectedElements)
      Returns a new map with the given number of expected elements.
      static <K,​V>
      com.carrotsearch.hppc.ObjectObjectHashMap<K,​V>
      newNoNullKeysMap()
      Returns a map like newMap() that does not accept null keys
      static <K,​V>
      com.carrotsearch.hppc.ObjectObjectHashMap<K,​V>
      newNoNullKeysMap​(int expectedElements)
      Returns a map like newMap(int) that does not accept null keys
      • Methods inherited from class java.lang.Object

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

      • newMap

        public static <K,​V> com.carrotsearch.hppc.ObjectObjectHashMap<K,​V> newMap​(int expectedElements)
        Returns a new map with the given number of expected elements.
        Parameters:
        expectedElements - The expected number of elements guaranteed not to cause buffer expansion (inclusive).
      • newMap

        public static <K,​V> com.carrotsearch.hppc.ObjectObjectHashMap<K,​V> newMap()
        Returns a new map with a default initial capacity.
      • newNoNullKeysMap

        public static <K,​V> com.carrotsearch.hppc.ObjectObjectHashMap<K,​V> newNoNullKeysMap()
        Returns a map like newMap() that does not accept null keys
      • newNoNullKeysMap

        public static <K,​V> com.carrotsearch.hppc.ObjectObjectHashMap<K,​V> newNoNullKeysMap​(int expectedElements)
        Returns a map like newMap(int) that does not accept null keys
        Parameters:
        expectedElements - The expected number of elements guaranteed not to cause buffer expansion (inclusive).
      • ensureNoNullKeys

        public static <K,​V> com.carrotsearch.hppc.ObjectObjectHashMap<K,​V> ensureNoNullKeys​(int expectedElements)
        Wraps the given map and prevent adding of null keys.
        Parameters:
        expectedElements - The expected number of elements guaranteed not to cause buffer expansion (inclusive).
      • intersection

        public static <T> java.lang.Iterable<T> intersection​(com.carrotsearch.hppc.ObjectLookupContainer<T> container1,
                                                             com.carrotsearch.hppc.ObjectLookupContainer<T> container2)
        Returns:
        an intersection view over the two specified containers (which can be KeyContainer or ObjectHashSet).