| Modifier and Type | Class and Description |
|---|---|
class |
Long2LongHashMap.EntryIterator
Iterator over entries which supports access to unboxed keys and values.
|
class |
Long2LongHashMap.EntrySet
Set of entries which supports optionally cached iterators to avoid allocation.
|
class |
Long2LongHashMap.KeyIterator
Iterator over keys which supports access to unboxed keys via
Long2LongHashMap.KeyIterator.nextValue(). |
class |
Long2LongHashMap.KeySet
Set of keys which supports optional cached iterators to avoid allocation.
|
class |
Long2LongHashMap.ValueCollection
Collection of values which supports optionally cached iterators to avoid allocation.
|
class |
Long2LongHashMap.ValueIterator
Iterator over values which supports access to unboxed values.
|
| Constructor and Description |
|---|
Long2LongHashMap(int initialCapacity,
float loadFactor,
long missingValue) |
Long2LongHashMap(int initialCapacity,
float loadFactor,
long missingValue,
boolean shouldAvoidAllocation) |
Long2LongHashMap(long missingValue) |
| Modifier and Type | Method and Description |
|---|---|
int |
capacity()
Get the total capacity for the map to which the load factor will be a fraction of.
|
void |
clear() |
void |
compact()
Compact the backing arrays by rehashing with a capacity just larger than current size
and giving consideration to the load factor.
|
long |
compute(long key,
LongBinaryOperator remappingFunction)
Primitive specialised version of
Map.compute(K, java.util.function.BiFunction<? super K, ? super V, ? extends V>). |
long |
computeIfAbsent(long key,
LongUnaryOperator mappingFunction)
Primitive specialised version of
Map.computeIfAbsent(Object, Function). |
long |
computeIfPresent(long key,
LongBinaryOperator remappingFunction)
Primitive specialised version of
Map.computeIfPresent(K, java.util.function.BiFunction<? super K, ? super V, ? extends V>). |
boolean |
containsKey(long key)
Long primitive specialised containsKey.
|
boolean |
containsKey(Object key) |
boolean |
containsValue(long value)
Does the map contain the value.
|
boolean |
containsValue(Object value) |
Long2LongHashMap.EntrySet |
entrySet() |
boolean |
equals(Object o) |
void |
forEach(BiConsumer<? super Long,? super Long> action) |
long |
get(long key)
Get a value using provided key avoiding boxing.
|
Long |
get(Object key) |
int |
hashCode() |
boolean |
isEmpty() |
Long2LongHashMap.KeySet |
keySet() |
float |
loadFactor()
Get the load factor applied for resize operations.
|
void |
longForEach(LongLongConsumer consumer)
Primitive specialised forEach implementation.
|
long |
maxValue()
Get the maximum value stored in the map.
|
long |
minValue()
Get the minimum value stored in the map.
|
long |
missingValue()
The value to be used as a null marker in the map.
|
long |
put(long key,
long value)
Put a key value pair in the map.
|
Long |
put(Long key,
Long value) |
void |
putAll(Map<? extends Long,? extends Long> map) |
long |
remove(long key)
Remove value from the map using given key avoiding boxing.
|
Long |
remove(Object key) |
long |
replace(long key,
long value)
Primitive specialised version of
Map.replace(Object, Object). |
boolean |
replace(long key,
long oldValue,
long newValue)
Primitive specialised version of
Map.replace(Object, Object, Object). |
int |
resizeThreshold()
Get the actual threshold which when reached the map will resize.
|
int |
size() |
String |
toString() |
Long2LongHashMap.ValueCollection |
values() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitcompute, computeIfAbsent, computeIfPresent, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAllpublic Long2LongHashMap(long missingValue)
missingValue - for the map that represents null.public Long2LongHashMap(int initialCapacity,
float loadFactor,
long missingValue)
initialCapacity - for the map to override MIN_CAPACITYloadFactor - for the map to override Hashing.DEFAULT_LOAD_FACTOR.missingValue - for the map that represents null.public Long2LongHashMap(int initialCapacity,
float loadFactor,
long missingValue,
boolean shouldAvoidAllocation)
initialCapacity - for the map to override MIN_CAPACITYloadFactor - for the map to override Hashing.DEFAULT_LOAD_FACTOR.missingValue - for the map that represents null.shouldAvoidAllocation - should allocation be avoided by caching iterators and map entries.public long missingValue()
public float loadFactor()
public int capacity()
public int resizeThreshold()
public long get(long key)
key - lookup key.missingValue() if key is not found in the map.public long put(long key,
long value)
key - lookup keyvalue - new value, must not be missingValue()missingValue() if none foundIllegalArgumentException - if value is missingValue()public void longForEach(LongLongConsumer consumer)
NB: Renamed from forEach to avoid overloading on parameter types of lambda expression, which doesn't play well with type inference in lambda expressions.
consumer - a callback called for each key/value pair in the map.public boolean containsKey(long key)
key - the key to check.public boolean containsValue(long value)
value - to be tested against contained values.public void compact()
public long computeIfAbsent(long key,
LongUnaryOperator mappingFunction)
Map.computeIfAbsent(Object, Function).key - to search on.mappingFunction - to provide a value if the get returns null.public long computeIfPresent(long key,
LongBinaryOperator remappingFunction)
Map.computeIfPresent(K, java.util.function.BiFunction<? super K, ? super V, ? extends V>).key - to search on.remappingFunction - to compute a value if a mapping is found.public long compute(long key,
LongBinaryOperator remappingFunction)
Map.compute(K, java.util.function.BiFunction<? super K, ? super V, ? extends V>).key - to search on.remappingFunction - to compute a value.public void forEach(BiConsumer<? super Long,? super Long> action)
public boolean containsKey(Object key)
containsKey in interface Map<Long,Long>public boolean containsValue(Object value)
containsValue in interface Map<Long,Long>public Long2LongHashMap.KeySet keySet()
public Long2LongHashMap.ValueCollection values()
public Long2LongHashMap.EntrySet entrySet()
public long remove(long key)
key - whose mapping is to be removed from the map.missingValue() if key was not found in the map.public long minValue()
missingValue().public long maxValue()
missingValue().public long replace(long key,
long value)
Map.replace(Object, Object).key - key with which the specified value is associated.value - value to be associated with the specified key.missingValue() if there was no mapping for the key.public boolean replace(long key,
long oldValue,
long newValue)
Map.replace(Object, Object, Object).key - key with which the specified value is associated.oldValue - value expected to be associated with the specified key.newValue - value to be associated with the specified key.true if the value was replaced.public boolean equals(Object o)
Copyright © 2014-2022 Real Logic Limited. All Rights Reserved.