19 |
|
* #longValue}) returns the current total combined across the |
20 |
|
* variables maintaining the sum. |
21 |
|
* |
22 |
< |
* <p> This class is usually preferable to {@link AtomicLong} when |
22 |
> |
* <p>This class is usually preferable to {@link AtomicLong} when |
23 |
|
* multiple threads update a common sum that is used for purposes such |
24 |
|
* as collecting statistics, not for fine-grained synchronization |
25 |
|
* control. Under low update contention, the two classes have similar |
33 |
|
* collection keys. |
34 |
|
* |
35 |
|
* <p><em>jsr166e note: This class is targeted to be placed in |
36 |
< |
* java.util.concurrent.atomic<em> |
36 |
> |
* java.util.concurrent.atomic.</em> |
37 |
|
* |
38 |
+ |
* @since 1.8 |
39 |
|
* @author Doug Lea |
40 |
|
*/ |
41 |
|
public class LongAdder extends Striped64 implements Serializable { |
146 |
|
|
147 |
|
/** |
148 |
|
* Returns the String representation of the {@link #sum}. |
149 |
< |
* @return the String representation of the {@link #sum}. |
149 |
> |
* @return the String representation of the {@link #sum} |
150 |
|
*/ |
151 |
|
public String toString() { |
152 |
|
return Long.toString(sum()); |