19 |
|
* variables maintaining the sum. |
20 |
|
* |
21 |
|
* <p>This class extends {@link Number}, but does <em>not</em> define |
22 |
< |
* methods such as {@code hashCode} and {@code compareTo} because |
23 |
< |
* instances are expected to be mutated, and so are not useful as |
24 |
< |
* collection keys. |
22 |
> |
* methods such as {@code equals}, {@code hashCode} and {@code |
23 |
> |
* compareTo} because instances are expected to be mutated, and so are |
24 |
> |
* not useful as collection keys. |
25 |
|
* |
26 |
|
* <p><em>jsr166e note: This class is targeted to be placed in |
27 |
< |
* java.util.concurrent.atomic<em> |
27 |
> |
* java.util.concurrent.atomic.</em> |
28 |
|
* |
29 |
|
* @since 1.8 |
30 |
|
* @author Doug Lea |
162 |
|
|
163 |
|
/** |
164 |
|
* Returns the {@link #sum} as a {@code long} after a |
165 |
< |
* primitive conversion. |
165 |
> |
* narrowing primitive conversion. |
166 |
|
*/ |
167 |
|
public long longValue() { |
168 |
|
return (long)sum(); |
170 |
|
|
171 |
|
/** |
172 |
|
* Returns the {@link #sum} as an {@code int} after a |
173 |
< |
* primitive conversion. |
173 |
> |
* narrowing primitive conversion. |
174 |
|
*/ |
175 |
|
public int intValue() { |
176 |
|
return (int)sum(); |
178 |
|
|
179 |
|
/** |
180 |
|
* Returns the {@link #sum} as a {@code float} |
181 |
< |
* after a primitive conversion. |
181 |
> |
* after a narrowing primitive conversion. |
182 |
|
*/ |
183 |
|
public float floatValue() { |
184 |
|
return (float)sum(); |