Package io.github.jbellis.jvector.util
Class DenseIntMap<T>
java.lang.Object
io.github.jbellis.jvector.util.DenseIntMap<T>
A map (but not a Map) of int -> T where the int keys are dense-ish and start at zero,
but the size of the map is not known in advance. This provides fast, concurrent
updates and minimizes contention when the map is resized.
"Dense-ish" means that space is allocated for all keys from 0 to the highest key, but it is valid to have gaps in the keys. The value associated with "gap" keys is null.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
DenseIntMap
public DenseIntMap(int initialSize)
-
-
Method Details
-
put
- Parameters:
key- ordinal
-
size
public int size()- Returns:
- number of items that have been added
-
get
- Parameters:
key- ordinal- Returns:
- the value of the key, or null if not set
-
remove
- Returns:
- the former value of the key, or null if it was not set
-
containsKey
public boolean containsKey(int key) -
entrySet
-
keySet
-
getNodesIterator
-