Package org.apache.solr.util
Class IntLongDynamicMap
java.lang.Object
org.apache.solr.util.IntLongDynamicMap
- All Implemented Interfaces:
DynamicMap
-
Constructor Summary
ConstructorsConstructorDescriptionIntLongDynamicMap(int expectedKeyMax, long emptyValue) Create map with expected max value of key. -
Method Summary
Modifier and TypeMethodDescriptionvoidforEachValue(LongConsumer consumer) longget(int key) voidput(int key, long value) voidremove(int key) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.solr.util.DynamicMap
mapExpectedElements, threshold, useArrayBased
-
Constructor Details
-
IntLongDynamicMap
public IntLongDynamicMap(int expectedKeyMax, long emptyValue) Create map with expected max value of key. Although the map will automatically do resizing to be able to hold key>=g expectedKeyMax. But putting key much larger thanexpectedKeyMaxis discourage since it can leads to use LOT OF memory.
-
-
Method Details
-
put
public void put(int key, long value) -
get
public long get(int key) -
forEachValue
-
remove
public void remove(int key)
-