| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | |
| pack-priv static class |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static int | DEFAULT_INITIAL_CAPACITY
The default initial number of table slots for this table. |
| pack-priv static final float | DEFAULT_LOAD_FACTOR
The default load factor for this table. |
| pack-priv static final int | DEFAULT_SEGMENTS
The default number of concurrency control segments. |
| pack-priv static final int | MAX_SEGMENTS
The maximum number of segments to allow; used to bound constructor arguments. |
| pack-priv static final int | MAXIMUM_CAPACITY
The maximum capacity, used if a higher value is implicitly specified by either of the constructors with arguments. |
| pack-priv static final int | RETRIES_BEFORE_LOCK
Number of unsynchronized retries in size and containsValue methods before resorting to locking. |
| pack-priv final int | segmentMask
Mask value for indexing into segments. |
| pack-priv final MultiKeyConcurrentHashMap. | segments
The segments, each of which is a specialized hash table |
| pack-priv final int | segmentShift
Shift value for indexing within segments. |
| Access | Constructor and Description |
|---|---|
| public | MultiKeyConcurrentHashMap(int
the initial capacity. The implementation performs internal sizing to accommodate this many
elements. initialCapacity, float the load factor threshold, used to control resizing. Resizing may be performed when the average
number of elements per bin exceeds this threshold. loadFactor, int the estimated number of concurrently updating threads. The implementation performs internal
sizing to try to accommodate this many threads. concurrencyLevel)Creates a new, empty map with the specified initial capacity, load factor, and concurrency level. |
| public | MultiKeyConcurrentHashMap(int
the initial capacity. The implementation performs internal sizing to accommodate this many
elements. initialCapacity)Creates a new, empty map with the specified initial capacity, and with default load factor and concurrencyLevel. |
| public | MultiKeyConcurrentHashMap()
Creates a new, empty map with a default initial capacity, load factor, and concurrencyLevel. |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public boolean | |
| public boolean | Returns: true if and only if the specified object is a key in this table, as determined by the
equals method; false otherwise.possible key. key)Tests if the specified object is a key in this table. |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | Returns: true if this map maps one or more keys to the specified value.value whose presence in this map is to be tested. value)Returns |
| public Set | |
| public V | |
| public V | |
| public V | |
| public V | |
| pack-priv static int | |
| public boolean | |
| public Set | |
| public V | Returns: the previous value of the specified key in this table, ornull if it did not have one.the table key. key, V the value. value)Maps the specified |
| public V | |
| public V | |
| public V | |
| public V | Returns: previous value associated with specified key, ornull if there was no mapping for key.key with which the specified value is to be associated. key, V value to be associated with the specified key. value)If the specified key is not already associated with a value, associate it with the given value. |
| public V | |
| public V | |
| public V | |
| public V | |
| public V | |
| public V | |
| public V | |
| public boolean | Returns: true if the value was replacedkey with which the specified value is associated. key, V value expected to be associated with the specified key. oldValue, V value to be associated with the specified key. newValue)Replace entry for key only if currently mapped to given value. |
| public V | Returns: previous value associated with specified key, ornull if there was no mapping for key.key with which the specified value is associated. key, V value to be associated with the specified key. value)Replace entry for key only if currently mapped to some value. |
| pack-priv final MultiKeyConcurrentHashMap. | Returns: the segmentthe hash code for the key hash)Returns the segment that should be used for key with given hash |
| public int | |
| public Collection |
| DEFAULT_INITIAL_CAPACITY | back to summary |
|---|---|
| pack-priv static int DEFAULT_INITIAL_CAPACITY The default initial number of table slots for this table. Used when not otherwise specified in constructor. | |
| DEFAULT_LOAD_FACTOR | back to summary |
|---|---|
| pack-priv static final float DEFAULT_LOAD_FACTOR The default load factor for this table. Used when not otherwise specified in constructor. | |
| DEFAULT_SEGMENTS | back to summary |
|---|---|
| pack-priv static final int DEFAULT_SEGMENTS The default number of concurrency control segments. | |
| MAX_SEGMENTS | back to summary |
|---|---|
| pack-priv static final int MAX_SEGMENTS The maximum number of segments to allow; used to bound constructor arguments. | |
| MAXIMUM_CAPACITY | back to summary |
|---|---|
| pack-priv static final int MAXIMUM_CAPACITY The maximum capacity, used if a higher value is implicitly specified by either of the constructors with arguments. MUST be a power of two <= 1<<30 to ensure that entries are indexible using ints. | |
| RETRIES_BEFORE_LOCK | back to summary |
|---|---|
| pack-priv static final int RETRIES_BEFORE_LOCK Number of unsynchronized retries in size and containsValue methods before resorting to locking. This is used to avoid unbounded retries if tables undergo continuous modification which would make it impossible to obtain an accurate result. | |
| segmentMask | back to summary |
|---|---|
| pack-priv final int segmentMask Mask value for indexing into segments. The upper bits of a key's hash code are used to choose the segment. | |
| segments | back to summary |
|---|---|
| pack-priv final MultiKeyConcurrentHashMap. The segments, each of which is a specialized hash table | |
| segmentShift | back to summary |
|---|---|
| pack-priv final int segmentShift Shift value for indexing within segments. | |
| MultiKeyConcurrentHashMap | back to summary |
|---|---|
| public MultiKeyConcurrentHashMap(int initialCapacity, float loadFactor, int concurrencyLevel) Creates a new, empty map with the specified initial capacity, load factor, and concurrency level.
| |
| MultiKeyConcurrentHashMap | back to summary |
|---|---|
| public MultiKeyConcurrentHashMap(int initialCapacity) Creates a new, empty map with the specified initial capacity, and with default load factor and concurrencyLevel.
| |
| MultiKeyConcurrentHashMap | back to summary |
|---|---|
| public MultiKeyConcurrentHashMap() Creates a new, empty map with a default initial capacity, load factor, and concurrencyLevel. | |
| clear | back to summary |
|---|---|
| public void clear() Removes all mappings from this map. | |
| contains | back to summary |
|---|---|
| public boolean contains(Object value) Legacy method testing if some key maps into the specified value in this table. This method is identical in
functionality to
| |
| containsKey | back to summary |
|---|---|
| public boolean containsKey(Object key) Tests if the specified object is a key in this table.
| |
| containsKey | back to summary |
|---|---|
public boolean containsKey(Object key1, Object key2)
| |
| containsKey | back to summary |
|---|---|
public boolean containsKey(Object key1, Object key2, Object key3)
| |
| containsKey | back to summary |
|---|---|
public boolean containsKey(Object key1, Object key2, Object key3, Object key4)
| |
| containsValue | back to summary |
|---|---|
| public boolean containsValue(Object value) Returns Note This method requires a full
internal traversal of the hash table, and so is much slower than method
| |
| entrySet | back to summary |
|---|---|
| public Set Unsupported. | |
| get | back to summary |
|---|---|
| public V get(Object key) Returns the value to which the specified key is mapped in this table.
| |
| get | back to summary |
|---|---|
public V get(Object key1, Object key2)
| |
| get | back to summary |
|---|---|
public V get(Object key1, Object key2, Object key3)
| |
| get | back to summary |
|---|---|
public V get(Object key1, Object key2, Object key3, Object key4)
| |
| hash | back to summary |
|---|---|
| pack-priv static int hash(Object x1, Object x2, Object x3, Object x4) Returns a hash code for non-null Objects. Uses the same hash code spreader as most other java.util hash tables.
| |
| isEmpty | back to summary |
|---|---|
public boolean isEmpty()
| |
| keySet | back to summary |
|---|---|
| public Set Unsupported | |
| put | back to summary |
|---|---|
| public V put(K key, V value) Maps the specified
The value can be retrieved by calling the
| |
| put | back to summary |
|---|---|
public V put(K key1, K key2, V value)
| |
| put | back to summary |
|---|---|
public V put(K key1, K key2, K key3, V value)
| |
| put | back to summary |
|---|---|
public V put(K key1, K key2, K key3, K key4, V value)
| |
| putIfAbsent | back to summary |
|---|---|
| public V putIfAbsent(K key, V value) If the specified key is not already associated with a value, associate it with the given value. This is equivalent to
if (!map.containsKey(key))
return map.put(key, value);
else
return map.get(key);
Except that the action is performed atomically.
| |
| putIfAbsent | back to summary |
|---|---|
public V putIfAbsent(K key1, K key2, V value)
| |
| putIfAbsent | back to summary |
|---|---|
public V putIfAbsent(K key1, K key2, K key3, V value)
| |
| putIfAbsent | back to summary |
|---|---|
public V putIfAbsent(K key1, K key2, K key3, K key4, V value)
| |
| remove | back to summary |
|---|---|
public V remove(K key)
| |
| remove | back to summary |
|---|---|
public V remove(K key1, K key2)
| |
| remove | back to summary |
|---|---|
public V remove(K key1, K key2, K key3)
| |
| remove | back to summary |
|---|---|
public V remove(K key1, K key2, K key3, K key4)
| |
| replace | back to summary |
|---|---|
| public boolean replace(K key, V oldValue, V newValue) Replace entry for key only if currently mapped to given value. Acts as
if (map.get(key).equals(oldValue)) {
map.put(key, newValue);
return true;
} else
return false;
except that the action is performed atomically.
| |
| replace | back to summary |
|---|---|
| public V replace(K key, V value) Replace entry for key only if currently mapped to some value. Acts as
if ((map.containsKey(key)) {
return map.put(key, value);
} else return null;
except that the action is performed atomically.
| |
| segmentFor | back to summary |
|---|---|
| pack-priv final MultiKeyConcurrentHashMap. Returns the segment that should be used for key with given hash
| |
| size | back to summary |
|---|---|
public int size()
| |
| values | back to summary |
|---|---|
| public Collection Unsupported. | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final int | |
| pack-priv final K | |
| pack-priv final K | |
| pack-priv final K | |
| pack-priv final K | |
| pack-priv final MultiKeyConcurrentHashMap. | |
| pack-priv volatile V |
| Access | Constructor and Description |
|---|---|
| pack-priv | HashEntry(K key1, K key2, K key3, K key4, int hash, MultiKeyConcurrentHashMap.
|
| hash | back to summary |
|---|---|
| pack-priv final int hash | |
| key1 | back to summary |
|---|---|
| pack-priv final K key1 | |
| key2 | back to summary |
|---|---|
| pack-priv final K key2 | |
| key3 | back to summary |
|---|---|
| pack-priv final K key3 | |
| key4 | back to summary |
|---|---|
| pack-priv final K key4 | |
| next | back to summary |
|---|---|
| pack-priv final MultiKeyConcurrentHashMap. | |
| value | back to summary |
|---|---|
| pack-priv volatile V value | |
| HashEntry | back to summary |
|---|---|
| pack-priv HashEntry(K key1, K key2, K key3, K key4, int hash, MultiKeyConcurrentHashMap. | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv volatile int | count
The number of elements in this segment's region. |
| pack-priv final float | loadFactor
The load factor for the hash table. |
| pack-priv int | modCount
Number of updates that alter the size of the table. |
| private static final long | |
| pack-priv volatile MultiKeyConcurrentHashMap. | table
The per-segment table. |
| pack-priv int | threshold
The table is rehashed when its size exceeds this threshold. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | |
| pack-priv boolean | |
| pack-priv boolean | |
| pack-priv V | |
| pack-priv MultiKeyConcurrentHashMap. | |
| pack-priv V | |
| pack-priv V | readValueUnderLock(MultiKeyConcurrentHashMap.
Read value field of an entry under lock. |
| pack-priv void | |
| pack-priv V | |
| pack-priv boolean | |
| pack-priv V | |
| pack-priv void |
| count | back to summary |
|---|---|
| pack-priv volatile int count The number of elements in this segment's region. | |
| loadFactor | back to summary |
|---|---|
| pack-priv final float loadFactor The load factor for the hash table. Even though this value is same for all segments, it is replicated to avoid needing links to outer object. | |
| modCount | back to summary |
|---|---|
| pack-priv int modCount Number of updates that alter the size of the table. This is used during bulk-read methods to make sure they see a consistent snapshot: If modCounts change during a traversal of segments computing size or checking containsValue, then we might have an inconsistent view of state so (usually) must retry. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides java. | |
| table | back to summary |
|---|---|
| pack-priv volatile MultiKeyConcurrentHashMap. The per-segment table. Declared as a raw type, casted to HashEntry | |
| threshold | back to summary |
|---|---|
| pack-priv int threshold The table is rehashed when its size exceeds this threshold. (The value of this field is always (int)(capacity * loadFactor).) | |
| Segment | back to summary |
|---|---|
| pack-priv Segment(int initialCapacity, float lf) | |
| clear | back to summary |
|---|---|
| pack-priv void clear() | |
| containsKey | back to summary |
|---|---|
| pack-priv boolean containsKey(Object key1, Object key2, Object key3, Object key4, int hash) | |
| containsValue | back to summary |
|---|---|
| pack-priv boolean containsValue(Object value) | |
| get | back to summary |
|---|---|
| pack-priv V get(Object key1, Object key2, Object key3, Object key4, int hash) | |
| getFirst | back to summary |
|---|---|
| pack-priv MultiKeyConcurrentHashMap. Return properly casted first entry of bin for given hash | |
| put | back to summary |
|---|---|
| pack-priv V put(K key1, K key2, K key3, K key4, int hash, V value, boolean onlyIfAbsent) | |
| readValueUnderLock | back to summary |
|---|---|
| pack-priv V readValueUnderLock(MultiKeyConcurrentHashMap. Read value field of an entry under lock. Called if value field ever appears to be null. This is possible only if a compiler happens to reorder a HashEntry initialization with its table assignment, which is legal under memory model but is not known to ever occur. | |
| rehash | back to summary |
|---|---|
| pack-priv void rehash() | |
| remove | back to summary |
|---|---|
| pack-priv V remove(Object key1, Object key2, Object key3, Object key4, int hash, Object value) Remove; match on key only if value null, else match both. | |
| replace | back to summary |
|---|---|
| pack-priv boolean replace(K key1, K key2, K key3, K key4, int hash, V oldValue, V newValue) | |
| replace | back to summary |
|---|---|
| pack-priv V replace(K key1, K key2, K key3, K key4, int hash, V newValue) | |
| setTable | back to summary |
|---|---|
| pack-priv void setTable(MultiKeyConcurrentHashMap. Set table to new HashEntry array. Call only while holding lock or in constructor. | |