ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/jdk7/java/util/concurrent/ConcurrentHashMap.java
(Generate patch)

Comparing jsr166/src/jdk7/java/util/concurrent/ConcurrentHashMap.java (file contents):
Revision 1.3 by jsr166, Sun Jan 6 20:05:51 2013 UTC vs.
Revision 1.4 by jsr166, Mon Jan 14 07:15:18 2013 UTC

# Line 88 | Line 88 | import java.io.Serializable;
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.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines