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 |
31 |
|
*/ |
32 |
|
public class DoubleMaxUpdater extends Striped64 implements Serializable { |
140 |
|
|
141 |
|
/** |
142 |
|
* Returns the String representation of the {@link #max}. |
143 |
< |
* @return the String representation of the {@link #max}. |
143 |
> |
* @return the String representation of the {@link #max} |
144 |
|
*/ |
145 |
|
public String toString() { |
146 |
|
return Double.toString(max()); |
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(); |