14 |
|
* See the {@link java.util.concurrent.atomic} package specification |
15 |
|
* for description of the properties of atomic variables. |
16 |
|
* |
17 |
< |
* <p><a name="bitEquals">This class compares primitive {@code double} |
17 |
> |
* <p id="bitEquals">This class compares primitive {@code double} |
18 |
|
* values in methods such as {@link #compareAndSet} by comparing their |
19 |
|
* bitwise representation using {@link Double#doubleToRawLongBits}, |
20 |
|
* which differs from both the primitive double {@code ==} operator |
24 |
|
* long xBits = Double.doubleToRawLongBits(x); |
25 |
|
* long yBits = Double.doubleToRawLongBits(y); |
26 |
|
* return xBits == yBits; |
27 |
< |
* }}</pre></a> |
27 |
> |
* }}</pre> |
28 |
|
* |
29 |
|
* @author Doug Lea |
30 |
|
* @author Martin Buchholz |
162 |
|
* if the current value is <a href="#bitEquals">bitwise equal</a> |
163 |
|
* to the expected value. |
164 |
|
* |
165 |
< |
* <p>May <a |
165 |
> |
* <p><a |
166 |
|
* href="http://download.oracle.com/javase/7/docs/api/java/util/concurrent/atomic/package-summary.html#Spurious"> |
167 |
< |
* fail spuriously</a> |
168 |
< |
* and does not provide ordering guarantees, so is only rarely an |
169 |
< |
* appropriate alternative to {@code compareAndSet}. |
167 |
> |
* May fail spuriously and does not provide ordering guarantees</a>, |
168 |
> |
* so is only rarely an appropriate alternative to {@code compareAndSet}. |
169 |
|
* |
170 |
|
* @param i the index |
171 |
|
* @param expect the expected value |
237 |
|
/** |
238 |
|
* Saves the state to a stream (that is, serializes it). |
239 |
|
* |
240 |
+ |
* @param s the stream |
241 |
+ |
* @throws java.io.IOException if an I/O error occurs |
242 |
|
* @serialData The length of the array is emitted (int), followed by all |
243 |
|
* of its elements (each a {@code double}) in the proper order. |
244 |
|
*/ |
257 |
|
|
258 |
|
/** |
259 |
|
* Reconstitutes the instance from a stream (that is, deserializes it). |
260 |
+ |
* @param s the stream |
261 |
+ |
* @throws ClassNotFoundException if the class of a serialized object |
262 |
+ |
* could not be found |
263 |
+ |
* @throws java.io.IOException if an I/O error occurs |
264 |
|
*/ |
265 |
|
private void readObject(java.io.ObjectInputStream s) |
266 |
|
throws java.io.IOException, ClassNotFoundException { |