95 |
|
* <p>A ConcurrentHashMap can be used as scalable frequency map (a |
96 |
|
* form of histogram or multiset) by using {@link |
97 |
|
* java.util.concurrent.atomic.LongAdder} values and initializing via |
98 |
< |
* {@link #computeIfAbsent}. For example, to add a count to a {@code |
99 |
< |
* ConcurrentHashMap<String,LongAdder> freqs}, you can use {@code |
100 |
< |
* freqs.computeIfAbsent(k -> new LongAdder()).increment();} |
98 |
> |
* {@link #computeIfAbsent computeIfAbsent}. For example, to add a count |
99 |
> |
* to a {@code ConcurrentHashMap<String,LongAdder> freqs}, you can use |
100 |
> |
* {@code freqs.computeIfAbsent(k -> new LongAdder()).increment();} |
101 |
|
* |
102 |
|
* <p>This class and its views and iterators implement all of the |
103 |
|
* <em>optional</em> methods of the {@link Map} and {@link Iterator} |