public class Object2ObjectHashMap<K,V> extends Object implements Map<K,V>, Serializable
Int2IntHashMap
.Modifier and Type | Class and Description |
---|---|
class |
Object2ObjectHashMap.EntryIterator |
class |
Object2ObjectHashMap.EntrySet |
class |
Object2ObjectHashMap.KeyIterator |
class |
Object2ObjectHashMap.KeySet |
class |
Object2ObjectHashMap.ValueCollection |
class |
Object2ObjectHashMap.ValueIterator |
Constructor and Description |
---|
Object2ObjectHashMap() |
Object2ObjectHashMap(int initialCapacity,
float loadFactor) |
Object2ObjectHashMap(int initialCapacity,
float loadFactor,
boolean shouldAvoidAllocation) |
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.
|
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value)
Does the map contain the value.
|
Object2ObjectHashMap.EntrySet |
entrySet() |
boolean |
equals(Object o) |
void |
forEach(BiConsumer<? super K,? super V> consumer) |
V |
get(Object key) |
int |
hashCode() |
boolean |
isEmpty() |
Object2ObjectHashMap.KeySet |
keySet() |
float |
loadFactor()
Get the load factor applied for resize operations.
|
protected Object |
mapNullValue(Object value) |
V |
put(K key,
V value)
Put a key value pair into the map.
|
void |
putAll(Map<? extends K,? extends V> map) |
V |
remove(Object key) |
int |
resizeThreshold()
Get the actual threshold which when reached the map will resize.
|
int |
size() |
String |
toString() |
protected V |
unmapNullValue(Object value) |
Object2ObjectHashMap.ValueCollection |
values() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
public Object2ObjectHashMap()
public Object2ObjectHashMap(int initialCapacity, float loadFactor)
public Object2ObjectHashMap(int initialCapacity, float loadFactor, boolean shouldAvoidAllocation)
initialCapacity
- for the map to override MIN_CAPACITY
loadFactor
- for the map to override Hashing.DEFAULT_LOAD_FACTOR
.shouldAvoidAllocation
- should allocation be avoided by caching iterators and map entries.public float loadFactor()
public int resizeThreshold()
public int capacity()
public V put(K key, V value)
put
in interface Map<K,V>
key
- lookup keyvalue
- new value, must not be nullIllegalArgumentException
- if value is nullpublic boolean containsValue(Object value)
containsValue
in interface Map<K,V>
value
- to be tested against contained values.public void compact()
public void forEach(BiConsumer<? super K,? super V> consumer)
public boolean containsKey(Object key)
containsKey
in interface Map<K,V>
public Object2ObjectHashMap.KeySet keySet()
public Object2ObjectHashMap.ValueCollection values()
public Object2ObjectHashMap.EntrySet entrySet()
public boolean equals(Object o)
public int hashCode()
Copyright © 2014-2020 Real Logic Limited. All Rights Reserved.