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 |
|---|---|
| private static class | |
| private class | |
| private class | |
| private abstract class | |
| private class | |
| private class | |
| protected static class | |
| private class | |
| private class |
| Modifier and Type | Field and Description |
|---|---|
| private static final int | DEFAULT_CAPACITY
Same default as HashMap, must be a power of 2 |
| private static final float | DEFAULT_LOAD_FACTOR
67%, just like IdentityHashMap |
| private transient FastCopyHashMap | |
| private transient FastCopyHashMap | |
| private final float | loadFactor
The user defined load factor which defines when to resize |
| private static final int | MAXIMUM_CAPACITY
MAX_INT - 1 |
| private transient int | modCount
Counter used to detect changes made outside of an iterator |
| private static final Object | NULL
Marks null keys. |
| private static final long | serialVersionUID
Serialization ID |
| private transient int | size
The current number of key-value pairs |
| private transient FastCopyHashMap. | table
The open-addressed table |
| private transient int | threshold
The next resize |
| private transient FastCopyHashMap |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | clear()
Overrides java. Implements java. Removes all of the mappings from this map (optional operation). |
| public FastCopyHashMap | clone()
Overrides java. Returns a shallow copy of this |
| public boolean | containsKey(Object
key whose presence in this map is to be tested key)Overrides java. Implements java. Returns |
| public boolean | containsValue(Object
value whose presence in this map is to be tested value)Overrides java. Implements java. Returns |
| public Set | entrySet()
Implements abstract java. Implements java. Returns a |
| private static final boolean | eq(Object o1, Object o2)
Hides java. Utility method for SimpleEntry and SimpleImmutableEntry. |
| public V | get(Object
the key whose associated value is to be returned key)Overrides java. Implements java. Returns the value to which the specified key is mapped,
or |
| private static final int | |
| private static final int | |
| private void | |
| public boolean | isEmpty()
Overrides java. Implements java. Returns |
| public Set | keySet()
Overrides java. Implements java. Returns a |
| private static final <K> K | |
| private int | |
| public static <K, V> FastCopyHashMap | |
| public void | |
| public V | put(K
key with which the specified value is to be associated key, V value to be associated with the specified key value)Overrides java. Implements java. Associates the specified value with the specified key in this map (optional operation). |
| public void | putAll(Map<? extends K, ? extends V>
mappings to be stored in this map map)Overrides java. Implements java. Copies all of the mappings from the specified map to this map (optional operation). |
| private void | |
| private void | |
| private void | |
| public V | remove(Object
key whose mapping is to be removed from the map key)Overrides java. Implements java. Removes the mapping for a key from this map if it is present (optional operation). |
| private void | |
| public int | size()
Overrides java. Implements java. Returns the number of key-value mappings in this map. |
| private static final <K> K | |
| public Collection | values()
Overrides java. Implements java. Returns a |
| private void |