Interface NullableLongLongMap
- All Known Implementing Classes:
HashMapBase,HashMapK1V1,HashMapK2V2,HashMapK4V4,HashMapLockFreeK1V1,HashMapLockFreeK2V2,HashMapLockFreeK4V4
public interface NullableLongLongMap
The interface we use for our Long2LongMaps that are the basis for a hashed redirection index.
-
Method Summary
Modifier and TypeMethodDescriptionintcapacity()voidclear()longvoidforEach(it.unimi.dsi.fastutil.longs.LongLongBiConsumer consumer) longget(long key) Gets the value associated with key.booleanisEmpty()longput(long key, long value) Add a mapping from key to value.longputIfAbsent(long key, long value) Add a mapping from key to value, if one does not already exist.longremove(long key) Remove a mapping for a key.voidintsize()
-
Method Details
-
resetToNull
void resetToNull() -
capacity
int capacity() -
size
int size()- Returns:
- the size of this map
-
isEmpty
boolean isEmpty()- Returns:
- true if this map is empty (i.e. size is zero)
-
defaultReturnValue
long defaultReturnValue()- Returns:
- the value returned from
get(long)when no value is present in the map.
-
put
long put(long key, long value) Add a mapping from key to value. Return the old value of key.- Parameters:
key- the key to addvalue- the value to add- Returns:
- the old value of key (or
defaultReturnValue()} if there was no mapping)
-
putIfAbsent
long putIfAbsent(long key, long value) Add a mapping from key to value, if one does not already exist. Return the old value of key (ordefaultReturnValue()) if one does not exist.- Parameters:
key- the key to addvalue- the value to add- Returns:
- the old value of key (or
defaultReturnValue()} if there was no mapping)
-
get
long get(long key) Gets the value associated with key. ReturnsdefaultReturnValue()} if no mapping exists.- Parameters:
key- the key to get- Returns:
- the value of the key (or
defaultReturnValue())
-
remove
long remove(long key) Remove a mapping for a key. Return the removed value of key (ordefaultReturnValue()) if one does not exist.- Parameters:
key- the key to add- Returns:
- the removed value of (or
defaultReturnValue()} if there was no mapping)
-
clear
void clear() -
forEach
void forEach(it.unimi.dsi.fastutil.longs.LongLongBiConsumer consumer)
-