43 |
|
* interoperable with {@code Hashtable} in programs that rely on its |
44 |
|
* thread safety but not on its synchronization details. |
45 |
|
* |
46 |
< |
* <p> Retrieval operations (including {@code get}) generally do not |
46 |
> |
* <p>Retrieval operations (including {@code get}) generally do not |
47 |
|
* block, so may overlap with update operations (including {@code put} |
48 |
|
* and {@code remove}). Retrievals reflect the results of the most |
49 |
|
* recently <em>completed</em> update operations holding upon their |
64 |
|
* that may be adequate for monitoring or estimation purposes, but not |
65 |
|
* for program control. |
66 |
|
* |
67 |
< |
* <p> The table is dynamically expanded when there are too many |
67 |
> |
* <p>The table is dynamically expanded when there are too many |
68 |
|
* collisions (i.e., keys that have distinct hash codes but fall into |
69 |
|
* the same slot modulo the table size), with the expected average |
70 |
|
* effect of maintaining roughly two bins per mapping (corresponding |
85 |
|
* {@code hashCode()} is a sure way to slow down performance of any |
86 |
|
* hash table. |
87 |
|
* |
88 |
< |
* <p> A {@link Set} projection of a ConcurrentHashMap may be created |
88 |
> |
* <p>A {@link Set} projection of a ConcurrentHashMap may be created |
89 |
|
* (using {@link #newKeySet()} or {@link #newKeySet(int)}), or viewed |
90 |
|
* (using {@link #keySet(Object)} when only keys are of interest, and the |
91 |
|
* mapped values are (perhaps transiently) not used or all take the |
92 |
|
* same mapping value. |
93 |
|
* |
94 |
< |
* <p> A ConcurrentHashMap can be used as scalable frequency map (a |
94 |
> |
* <p>A ConcurrentHashMap can be used as scalable frequency map (a |
95 |
|
* form of histogram or multiset) by using {@link LongAdder} values |
96 |
|
* and initializing via {@link #computeIfAbsent}. For example, to add |
97 |
|
* a count to a {@code ConcurrentHashMap<String,LongAdder> freqs}, you |
102 |
|
* <em>optional</em> methods of the {@link Map} and {@link Iterator} |
103 |
|
* interfaces. |
104 |
|
* |
105 |
< |
* <p> Like {@link Hashtable} but unlike {@link HashMap}, this class |
105 |
> |
* <p>Like {@link Hashtable} but unlike {@link HashMap}, this class |
106 |
|
* does <em>not</em> allow {@code null} to be used as a key or value. |
107 |
|
* |
108 |
|
* <p>ConcurrentHashMaps support parallel operations using the {@link |
187 |
|
* arguments can be supplied using {@code new |
188 |
|
* AbstractMap.SimpleEntry(k,v)}. |
189 |
|
* |
190 |
< |
* <p> Bulk operations may complete abruptly, throwing an |
190 |
> |
* <p>Bulk operations may complete abruptly, throwing an |
191 |
|
* exception encountered in the application of a supplied |
192 |
|
* function. Bear in mind when handling such exceptions that other |
193 |
|
* concurrently executing functions could also have thrown |
202 |
|
* Similarly, parallelization may not lead to much actual parallelism |
203 |
|
* if all processors are busy performing unrelated tasks. |
204 |
|
* |
205 |
< |
* <p> All arguments to all task methods must be non-null. |
205 |
> |
* <p>All arguments to all task methods must be non-null. |
206 |
|
* |
207 |
|
* <p><em>jsr166e note: During transition, this class |
208 |
|
* uses nested functional interfaces with different names but the |
228 |
|
* portion of the elements, and so may be amenable to parallel |
229 |
|
* execution. |
230 |
|
* |
231 |
< |
* <p> This interface exports a subset of expected JDK8 |
231 |
> |
* <p>This interface exports a subset of expected JDK8 |
232 |
|
* functionality. |
233 |
|
* |
234 |
|
* <p>Sample usage: Here is one (of the several) ways to compute |
2719 |
|
* Maps the specified key to the specified value in this table. |
2720 |
|
* Neither the key nor the value can be null. |
2721 |
|
* |
2722 |
< |
* <p> The value can be retrieved by calling the {@code get} method |
2722 |
> |
* <p>The value can be retrieved by calling the {@code get} method |
2723 |
|
* with a key that is equal to the original key. |
2724 |
|
* |
2725 |
|
* @param key key with which the specified value is to be associated |