Package org.apache.solr.util
Class IntLongDynamicMap
- java.lang.Object
-
- org.apache.solr.util.IntLongDynamicMap
-
- All Implemented Interfaces:
DynamicMap
public class IntLongDynamicMap extends Object implements DynamicMap
-
-
Constructor Summary
Constructors Constructor Description IntLongDynamicMap(int expectedKeyMax, long emptyValue)
Create map with expected max value of key.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
forEachValue(LongConsumer consumer)
long
get(int key)
void
put(int key, long value)
void
remove(int key)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.solr.util.DynamicMap
mapExpectedElements, threshold, useArrayBased
-
-
-
-
Constructor Detail
-
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 thanexpectedKeyMax
is discourage since it can leads to use LOT OF memory.
-
-
Method Detail
-
put
public void put(int key, long value)
-
get
public long get(int key)
-
forEachValue
public void forEachValue(LongConsumer consumer)
-
remove
public void remove(int key)
-
-