Class Atomics


  • @GwtIncompatible
    public final class Atomics
    extends 
    Static utility methods pertaining to classes in the java.util.concurrent.atomic package.
    Since:
    10.0
    Author:
    Kurt Alfred Kluever
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <V> <V> newReference()
      Creates an AtomicReference instance with no initial value.
      static <V> <V> V initialValue)
      Creates an AtomicReference instance with the given initial value.
      static <E> <E> newReferenceArray​(int length)
      Creates an AtomicReferenceArray instance of given length.
      static <E> <E> newReferenceArray​(E[] array)
      Creates an AtomicReferenceArray instance with the same length as, and all elements copied from, the given array.
      • Methods inherited from class java.lang.

        , , , , , , , , , ,
    • Method Detail

      • newReference

        public static <V> <V> newReference()
        Creates an AtomicReference instance with no initial value.
        Returns:
        a new AtomicReference with no initial value
      • newReference

        public static <V> <V>  V initialValue)
        Creates an AtomicReference instance with the given initial value.
        Parameters:
        initialValue - the initial value
        Returns:
        a new AtomicReference with the given initial value
      • newReferenceArray

        public static <E> <E> newReferenceArray​(int length)
        Creates an AtomicReferenceArray instance of given length.
        Parameters:
        length - the length of the array
        Returns:
        a new AtomicReferenceArray with the given length
      • newReferenceArray

        public static <E> <E> newReferenceArray​(E[] array)
        Creates an AtomicReferenceArray instance with the same length as, and all elements copied from, the given array.
        Parameters:
        array - the array to copy elements from
        Returns:
        a new AtomicReferenceArray copied from the given array