104 |
|
* mapped values are (perhaps transiently) not used or all take the |
105 |
|
* same mapping value. |
106 |
|
* |
107 |
< |
* <p>A ConcurrentHashMap can be used as scalable frequency map (a |
107 |
> |
* <p>A ConcurrentHashMap can be used as a scalable frequency map (a |
108 |
|
* form of histogram or multiset) by using {@link |
109 |
|
* java.util.concurrent.atomic.LongAdder} values and initializing via |
110 |
|
* {@link #computeIfAbsent computeIfAbsent}. For example, to add a count |
111 |
|
* to a {@code ConcurrentHashMap<String,LongAdder> freqs}, you can use |
112 |
< |
* {@code freqs.computeIfAbsent(k -> new LongAdder()).increment();} |
112 |
> |
* {@code freqs.computeIfAbsent(key, k -> new LongAdder()).increment();} |
113 |
|
* |
114 |
|
* <p>This class and its views and iterators implement all of the |
115 |
|
* <em>optional</em> methods of the {@link Map} and {@link Iterator} |