AtomicReferenceArray<E> | java.util.concurrent.atomic |
This threadsafe class holds an array of elements of type E. It provides volatile access semantics for these array elements and defines atomic operations for manipulating them. Its methods are like those of AtomicReference with the addition of a parameter that specifies the array index of the desired element.
public class AtomicReferenceArray<E> implements Serializable { // Public Constructors public AtomicReferenceArray (E[ ] array ); public AtomicReferenceArray (int length ); // Public Instance Methods public final boolean compareAndSet (int i , E expect , E update ); public final E get (int i ); public final E getAndSet (int i , E newValue ); public final int length ( ); public final void set (int i , E newValue ); public final boolean weakCompareAndSet (int i , E expect , E update ); // Public Methods Overriding Object public String toString ( ); }
|