Package org.elasticsearch.common.collect
Class HppcMaps
java.lang.Object
org.elasticsearch.common.collect.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 ofnull
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 likenewMap()
that does not acceptnull
keysstatic <K, V> com.carrotsearch.hppc.ObjectObjectHashMap<K,V>
newNoNullKeysMap(int expectedElements)
Returns a map likenewMap(int)
that does not acceptnull
keys
-
Method Details
-
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 likenewMap()
that does not acceptnull
keys -
newNoNullKeysMap
public static <K, V> com.carrotsearch.hppc.ObjectObjectHashMap<K,V> newNoNullKeysMap(int expectedElements)Returns a map likenewMap(int)
that does not acceptnull
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 ofnull
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).
-