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

Comparing jsr166/src/main/java/util/concurrent/ConcurrentHashMap.java (file contents):
Revision 1.256 by jsr166, Sat Dec 21 21:32:34 2013 UTC vs.
Revision 1.257 by jsr166, Tue Jun 3 23:49:57 2014 UTC

# Line 104 | Line 104 | import java.util.stream.Stream;
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}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines