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

Print this page

        

*** 244,265 **** --- 244,284 ---- public String toString() { return Integer.toString(get()); } + /** + * Returns the value of this {@code AtomicInteger} as an + * {@code int}. + */ public int intValue() { return get(); } + /** + * Returns the value of this {@code AtomicInteger} as a {@code long} + * after a widening primitive conversion. + * @jls 5.1.2 Widening Primitive Conversions + */ public long longValue() { return (long)get(); } + /** + * Returns the value of this {@code AtomicInteger} 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 AtomicInteger} as a {@code double} + * after a widening primitive conversion. + * @jls 5.1.2 Widening Primitive Conversions + */ public double doubleValue() { return (double)get(); } }