1 *java.util.concurrent.atomic.AtomicIntegerArray* *AtomicIntegerArray* Anintarray
3 public class AtomicIntegerArray
4 extends |java.lang.Object|
5 implements |java.io.Serializable|
7 |java.util.concurrent.atomic.AtomicIntegerArray_Description|
8 |java.util.concurrent.atomic.AtomicIntegerArray_Fields|
9 |java.util.concurrent.atomic.AtomicIntegerArray_Constructors|
10 |java.util.concurrent.atomic.AtomicIntegerArray_Methods|
12 ================================================================================
14 *java.util.concurrent.atomic.AtomicIntegerArray_Constructors*
15 |java.util.concurrent.atomic.AtomicIntegerArray(int)|Creates a new AtomicIntege
16 |java.util.concurrent.atomic.AtomicIntegerArray(int[])|Creates a new AtomicInte
18 *java.util.concurrent.atomic.AtomicIntegerArray_Methods*
19 |java.util.concurrent.atomic.AtomicIntegerArray.addAndGet(int,int)|Atomically a
20 |java.util.concurrent.atomic.AtomicIntegerArray.compareAndSet(int,int,int)|Atom
21 |java.util.concurrent.atomic.AtomicIntegerArray.decrementAndGet(int)|Atomically
22 |java.util.concurrent.atomic.AtomicIntegerArray.get(int)|Gets the current value
23 |java.util.concurrent.atomic.AtomicIntegerArray.getAndAdd(int,int)|Atomically a
24 |java.util.concurrent.atomic.AtomicIntegerArray.getAndDecrement(int)|Atomically
25 |java.util.concurrent.atomic.AtomicIntegerArray.getAndIncrement(int)|Atomically
26 |java.util.concurrent.atomic.AtomicIntegerArray.getAndSet(int,int)|Atomically s
27 |java.util.concurrent.atomic.AtomicIntegerArray.incrementAndGet(int)|Atomically
28 |java.util.concurrent.atomic.AtomicIntegerArray.lazySet(int,int)|Eventually set
29 |java.util.concurrent.atomic.AtomicIntegerArray.length()|Returns the length of
30 |java.util.concurrent.atomic.AtomicIntegerArray.set(int,int)|Sets the element a
31 |java.util.concurrent.atomic.AtomicIntegerArray.toString()|Returns the String r
32 |java.util.concurrent.atomic.AtomicIntegerArray.weakCompareAndSet(int,int,int)|
34 *java.util.concurrent.atomic.AtomicIntegerArray_Description*
36 Anintarray in which elements may be updated atomically. See the
37 (|java.util.concurrent.atomic|) package specification for description of the
38 properties of atomic variables.
42 *java.util.concurrent.atomic.AtomicIntegerArray(int)*
44 public AtomicIntegerArray(int length)
46 Creates a new AtomicIntegerArray of given length.
48 length - the length of the array
50 *java.util.concurrent.atomic.AtomicIntegerArray(int[])*
52 public AtomicIntegerArray(int[] array)
54 Creates a new AtomicIntegerArray with the same length as, and all elements
55 copied from, the given array.
57 array - the array to copy elements from
59 *java.util.concurrent.atomic.AtomicIntegerArray.addAndGet(int,int)*
61 public final int addAndGet(
65 Atomically adds the given value to the element at indexi.
69 delta - the value to add
71 Returns: the updated value
73 *java.util.concurrent.atomic.AtomicIntegerArray.compareAndSet(int,int,int)*
75 public final boolean compareAndSet(
80 Atomically sets the element at positionito the given updated value if the
81 current value==the expected value.
85 expect - the expected value
86 update - the new value
88 Returns: true if successful. False return indicates that the actual value was not equal
89 to the expected value.
91 *java.util.concurrent.atomic.AtomicIntegerArray.decrementAndGet(int)*
93 public final int decrementAndGet(int i)
95 Atomically decrements by one the element at indexi.
100 Returns: the updated value
102 *java.util.concurrent.atomic.AtomicIntegerArray.get(int)*
104 public final int get(int i)
106 Gets the current value at positioni.
111 Returns: the current value
113 *java.util.concurrent.atomic.AtomicIntegerArray.getAndAdd(int,int)*
115 public final int getAndAdd(
119 Atomically adds the given value to the element at indexi.
123 delta - the value to add
125 Returns: the previous value
127 *java.util.concurrent.atomic.AtomicIntegerArray.getAndDecrement(int)*
129 public final int getAndDecrement(int i)
131 Atomically decrements by one the element at indexi.
136 Returns: the previous value
138 *java.util.concurrent.atomic.AtomicIntegerArray.getAndIncrement(int)*
140 public final int getAndIncrement(int i)
142 Atomically increments by one the element at indexi.
147 Returns: the previous value
149 *java.util.concurrent.atomic.AtomicIntegerArray.getAndSet(int,int)*
151 public final int getAndSet(
155 Atomically sets the element at positionito the given value and returns the old
160 newValue - the new value
162 Returns: the previous value
164 *java.util.concurrent.atomic.AtomicIntegerArray.incrementAndGet(int)*
166 public final int incrementAndGet(int i)
168 Atomically increments by one the element at indexi.
173 Returns: the updated value
175 *java.util.concurrent.atomic.AtomicIntegerArray.lazySet(int,int)*
177 public final void lazySet(
181 Eventually sets the element at positionito the given value.
185 newValue - the new value
187 *java.util.concurrent.atomic.AtomicIntegerArray.length()*
189 public final int length()
191 Returns the length of the array.
195 Returns: the length of the array
197 *java.util.concurrent.atomic.AtomicIntegerArray.set(int,int)*
199 public final void set(
203 Sets the element at positionito the given value.
207 newValue - the new value
209 *java.util.concurrent.atomic.AtomicIntegerArray.toString()*
211 public |java.lang.String| toString()
213 Returns the String representation of the current values of array.
217 Returns: the String representation of the current values of array.
219 *java.util.concurrent.atomic.AtomicIntegerArray.weakCompareAndSet(int,int,int)*
221 public final boolean weakCompareAndSet(
226 Atomically sets the element at positionito the given updated value if the
227 current value==the expected value.
229 May fail spuriously and does not provide ordering guarantees, so is only rarely
230 an appropriate alternative tocompareAndSet.
234 expect - the expected value
235 update - the new value
237 Returns: true if successful.