src/share/classes/java/util/concurrent/atomic/AtomicLong.java

Print this page

        

*** 258,279 **** --- 258,298 ---- public String toString() { return Long.toString(get()); } + /** + * Returns the value of this {@code AtomicLong} as an {@code int} + * after a narrowing primitive conversion. + * @jls 5.1.3 Narrowing Primitive Conversions + */ public int intValue() { return (int)get(); } + /** + * Returns the value of this {@code AtomicLong} as a {@code long} + * value. + */ public long longValue() { return get(); } + /** + * Returns the value of this {@code AtomicLong} as a {@code float} + * after a widening primitive conversion. + * @jls 5.1.2 Widening Primitive Conversions + */ public float floatValue() { return (float)get(); } + /** + * Returns the value of this {@code AtomicLong} as a {@code + * double} after a widening primitive conversion. + * @jls 5.1.2 Widening Primitive Conversions + */ public double doubleValue() { return (double)get(); } }