88 |
|
* mapped values are (perhaps transiently) not used or all take the |
89 |
|
* same mapping value. |
90 |
|
* |
91 |
– |
* <p>A ConcurrentHashMap can be used as scalable frequency map (a |
92 |
– |
* form of histogram or multiset) by using {@link LongAdder} values |
93 |
– |
* and initializing via {@link #computeIfAbsent}. For example, to add |
94 |
– |
* a count to a {@code ConcurrentHashMap<String,LongAdder> freqs}, you |
95 |
– |
* can use {@code freqs.computeIfAbsent(k -> new |
96 |
– |
* LongAdder()).increment();} |
97 |
– |
* |
91 |
|
* <p>This class and its views and iterators implement all of the |
92 |
|
* <em>optional</em> methods of the {@link Map} and {@link Iterator} |
93 |
|
* interfaces. |