public class FastCopyHashMap<K,V> extends AbstractMap<K,V> implements java.util.Map<K,V>, java.lang.Cloneable, java.io.Serializable
Modifier and Type | Class and Description |
---|---|
private static class |
FastCopyHashMap.Entry<K,V> |
private class |
FastCopyHashMap.EntryIterator |
class |
FastCopyHashMap.EntrySet |
private class |
FastCopyHashMap.FasyCopyHashMapIterator<E> |
private class |
FastCopyHashMap.KeyIterator |
class |
FastCopyHashMap.KeySet |
private class |
FastCopyHashMap.ValueIterator |
class |
FastCopyHashMap.Values |
AbstractMap.SimpleEntry<K,V>
Modifier and Type | Field and Description |
---|---|
private static int |
DEFAULT_CAPACITY
Same default as HashMap, must be a power of 2
|
private static float |
DEFAULT_LOAD_FACTOR
67%, just like IdentityHashMap
|
private float |
loadFactor
The user defined load factor which defines when to resize
|
private static Log |
log |
private static int |
MAXIMUM_CAPACITY
MAX_INT - 1
|
private int |
modCount
Counter used to detect changes made outside of an iterator
|
private static long |
serialVersionUID
Serialization ID
|
private int |
size
The current number of key-value pairs
|
private FastCopyHashMap.Entry<K,V>[] |
table
The open-addressed table
|
private int |
threshold
The next resize
|
private static boolean |
trace |
entrySet, keySet, values
Constructor and Description |
---|
FastCopyHashMap() |
FastCopyHashMap(int initialCapacity) |
FastCopyHashMap(int initialCapacity,
float loadFactor) |
FastCopyHashMap(java.util.Map<? extends K,? extends V> map) |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
FastCopyHashMap<K,V> |
clone() |
boolean |
containsKey(java.lang.Object key) |
boolean |
containsValue(java.lang.Object value) |
java.util.Set<java.util.Map.Entry<K,V>> |
entrySet() |
V |
get(java.lang.Object key) |
private static int |
index(int hashCode,
int length) |
private void |
init(int initialCapacity,
float loadFactor) |
boolean |
isEmpty() |
java.util.Set<K> |
keySet() |
private int |
nextIndex(int index,
int length) |
void |
printDebugStats() |
V |
put(K key,
V value) |
void |
putAll(java.util.Map<? extends K,? extends V> map) |
private void |
putForCreate(K key,
V value) |
private void |
readObject(java.io.ObjectInputStream s) |
private void |
relocate(int start) |
V |
remove(java.lang.Object key) |
private void |
resize(int from) |
int |
size() |
java.lang.String |
toString()
Returns a string representation of this map.
|
java.util.Collection<V> |
values() |
private void |
writeObject(java.io.ObjectOutputStream s) |
assertKeyNotNull, eq, hash, hashCode
private static final Log log
private static final boolean trace
private static final long serialVersionUID
private static final int DEFAULT_CAPACITY
private static final int MAXIMUM_CAPACITY
private static final float DEFAULT_LOAD_FACTOR
private transient FastCopyHashMap.Entry<K,V>[] table
private transient int size
private transient int threshold
private final float loadFactor
private transient int modCount
public FastCopyHashMap(int initialCapacity, float loadFactor)
public FastCopyHashMap(int initialCapacity)
public FastCopyHashMap()
private void init(int initialCapacity, float loadFactor)
private int nextIndex(int index, int length)
private static int index(int hashCode, int length)
public boolean containsKey(java.lang.Object key)
public java.lang.String toString()
String.valueOf(Object)
.toString
in class java.lang.Object
public boolean containsValue(java.lang.Object value)
private void resize(int from)
private void relocate(int start)
public FastCopyHashMap<K,V> clone()
clone
in class java.lang.Object
public void printDebugStats()
private void readObject(java.io.ObjectInputStream s) throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
private void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException
java.io.IOException