public class FastCopyHashMap<K,V> extends AbstractMap<K,V> implements Map<K,V>, Cloneable, Serializable
HashMap
.
Note: It is very important to use a smaller load factor than you normally
would for HashMap, since the implementation is open-addressed with linear
probing. With a 50% load-factor a get is expected to return in only 2 probes.
However, a 90% load-factor is expected to return in around 50 probes.Modifier and Type | Class and Description |
---|---|
protected static class |
FastCopyHashMap.SimpleEntry<K,V> |
AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
FastCopyHashMap() |
FastCopyHashMap(int initialCapacity) |
FastCopyHashMap(int initialCapacity,
float loadFactor) |
FastCopyHashMap(Map<? extends K,? extends V> map) |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
Object |
clone() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set<Map.Entry<K,V>> |
entrySet() |
V |
get(Object key) |
boolean |
isEmpty() |
Set<K> |
keySet() |
void |
printDebugStats() |
V |
put(K key,
V value) |
void |
putAll(Map<? extends K,? extends V> map) |
V |
remove(Object key) |
int |
size() |
Collection<V> |
values() |
equals, hashCode, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
public FastCopyHashMap(int initialCapacity, float loadFactor)
public FastCopyHashMap(int initialCapacity)
public FastCopyHashMap()
public int size()
public boolean isEmpty()
public boolean containsKey(Object key)
containsKey
in interface Map<K,V>
containsKey
in class AbstractMap<K,V>
public boolean containsValue(Object value)
containsValue
in interface Map<K,V>
containsValue
in class AbstractMap<K,V>
public void clear()
public Object clone()
clone
in class AbstractMap<K,V>
public void printDebugStats()
public Collection<V> values()
Copyright © 2018 JBoss by Red Hat. All rights reserved.