Save This Page
Home » Open-JDK-6.b17-src » java » util » concurrent » atomic » [javadoc | source]
java.util.concurrent.atomic
public class: AtomicIntegerArray [javadoc | source]
java.lang.Object
   java.util.concurrent.atomic.AtomicIntegerArray

All Implemented Interfaces:
    Serializable

An {@code int} array in which elements may be updated atomically. See the java.util.concurrent.atomic package specification for description of the properties of atomic variables.
Constructor:
 public AtomicIntegerArray(int length) 
 public AtomicIntegerArray(int[] array) 
Method from java.util.concurrent.atomic.AtomicIntegerArray Summary:
addAndGet,   compareAndSet,   decrementAndGet,   get,   getAndAdd,   getAndDecrement,   getAndIncrement,   getAndSet,   incrementAndGet,   lazySet,   length,   set,   toString,   weakCompareAndSet
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from java.util.concurrent.atomic.AtomicIntegerArray Detail:
 public final int addAndGet(int i,
    int delta) 
    Atomically adds the given value to the element at index {@code i}.
 public final boolean compareAndSet(int i,
    int expect,
    int update) 
    Atomically sets the element at position {@code i} to the given updated value if the current value {@code ==} the expected value.
 public final int decrementAndGet(int i) 
    Atomically decrements by one the element at index {@code i}.
 public final int get(int i) 
    Gets the current value at position {@code i}.
 public final int getAndAdd(int i,
    int delta) 
    Atomically adds the given value to the element at index {@code i}.
 public final int getAndDecrement(int i) 
    Atomically decrements by one the element at index {@code i}.
 public final int getAndIncrement(int i) 
    Atomically increments by one the element at index {@code i}.
 public final int getAndSet(int i,
    int newValue) 
    Atomically sets the element at position {@code i} to the given value and returns the old value.
 public final int incrementAndGet(int i) 
    Atomically increments by one the element at index {@code i}.
 public final  void lazySet(int i,
    int newValue) 
    Eventually sets the element at position {@code i} to the given value.
 public final int length() 
    Returns the length of the array.
 public final  void set(int i,
    int newValue) 
    Sets the element at position {@code i} to the given value.
 public String toString() 
    Returns the String representation of the current values of array.
 public final boolean weakCompareAndSet(int i,
    int expect,
    int update) 
    Atomically sets the element at position {@code i} to the given updated value if the current value {@code ==} the expected value.

    May fail spuriously and does not provide ordering guarantees, so is only rarely an appropriate alternative to {@code compareAndSet}.