Package org.apache.solr.util
Class IntFloatDynamicMap
- java.lang.Object
-
- org.apache.solr.util.IntFloatDynamicMap
-
- All Implemented Interfaces:
DynamicMap
public class IntFloatDynamicMap extends Object implements DynamicMap
-
-
Constructor Summary
Constructors Constructor Description IntFloatDynamicMap(int expectedKeyMax, float emptyValue)
Create map with expected max value of key.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
forEachValue(FloatConsumer consumer)
float
get(int key)
void
put(int key, float 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
-
IntFloatDynamicMap
public IntFloatDynamicMap(int expectedKeyMax, float emptyValue)
Create map with expected max value of key. Although the map will automatically do resizing to be able to hold key>= 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, float value)
-
get
public float get(int key)
-
forEachValue
public void forEachValue(FloatConsumer consumer)
-
remove
public void remove(int key)
-
-