19 |
|
* current maximum across the variables maintaining updates. |
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 |
75 |
|
|
76 |
|
/** |
77 |
|
* Returns the current maximum. The returned value is |
78 |
< |
* <em>NOT</em> an atomic snapshot: Invocation in the absence of |
78 |
> |
* <em>NOT</em> an atomic snapshot: invocation in the absence of |
79 |
|
* concurrent updates returns an accurate result, but concurrent |
80 |
|
* updates that occur while the value is being calculated might |
81 |
|
* not be incorporated. |
157 |
|
|
158 |
|
/** |
159 |
|
* Returns the {@link #max} as a {@code long} after a |
160 |
< |
* primitive conversion. |
160 |
> |
* narrowing primitive conversion. |
161 |
|
*/ |
162 |
|
public long longValue() { |
163 |
|
return (long)max(); |
165 |
|
|
166 |
|
/** |
167 |
|
* Returns the {@link #max} as an {@code int} after a |
168 |
< |
* primitive conversion. |
168 |
> |
* narrowing primitive conversion. |
169 |
|
*/ |
170 |
|
public int intValue() { |
171 |
|
return (int)max(); |
173 |
|
|
174 |
|
/** |
175 |
|
* Returns the {@link #max} as a {@code float} |
176 |
< |
* after a primitive conversion. |
176 |
> |
* after a narrowing primitive conversion. |
177 |
|
*/ |
178 |
|
public float floatValue() { |
179 |
|
return (float)max(); |