1 *java.util.concurrent.atomic.AtomicReferenceArray* *AtomicReferenceArray* An arr
3 public class AtomicReferenceArray<E>
4 extends |java.lang.Object|
5 implements |java.io.Serializable|
7 |java.util.concurrent.atomic.AtomicReferenceArray_Description|
8 |java.util.concurrent.atomic.AtomicReferenceArray_Fields|
9 |java.util.concurrent.atomic.AtomicReferenceArray_Constructors|
10 |java.util.concurrent.atomic.AtomicReferenceArray_Methods|
12 ================================================================================
14 *java.util.concurrent.atomic.AtomicReferenceArray_Constructors*
15 |java.util.concurrent.atomic.AtomicReferenceArray(E[])|Creates a new AtomicRefe
16 |java.util.concurrent.atomic.AtomicReferenceArray(int)|Creates a new AtomicRefe
18 *java.util.concurrent.atomic.AtomicReferenceArray_Methods*
19 |java.util.concurrent.atomic.AtomicReferenceArray.compareAndSet(int,E,E)|Atomic
20 |java.util.concurrent.atomic.AtomicReferenceArray.get(int)|Gets the current val
21 |java.util.concurrent.atomic.AtomicReferenceArray.getAndSet(int,E)|Atomically s
22 |java.util.concurrent.atomic.AtomicReferenceArray.lazySet(int,E)|Eventually set
23 |java.util.concurrent.atomic.AtomicReferenceArray.length()|Returns the length o
24 |java.util.concurrent.atomic.AtomicReferenceArray.set(int,E)|Sets the element a
25 |java.util.concurrent.atomic.AtomicReferenceArray.toString()|Returns the String
26 |java.util.concurrent.atomic.AtomicReferenceArray.weakCompareAndSet(int,E,E)|At
28 *java.util.concurrent.atomic.AtomicReferenceArray_Description*
30 An array of object references in which elements may be updated atomically. See
31 the (|java.util.concurrent.atomic|) package specification for description of
32 the properties of atomic variables.
36 *java.util.concurrent.atomic.AtomicReferenceArray(E[])*
38 public AtomicReferenceArray(E[] array)
40 Creates a new AtomicReferenceArray with the same length as, and all elements
41 copied from, the given array.
43 array - the array to copy elements from
45 *java.util.concurrent.atomic.AtomicReferenceArray(int)*
47 public AtomicReferenceArray(int length)
49 Creates a new AtomicReferenceArray of given length.
51 length - the length of the array
53 *java.util.concurrent.atomic.AtomicReferenceArray.compareAndSet(int,E,E)*
55 public final boolean compareAndSet(
60 Atomically sets the element at positionito the given updated value if the
61 current value==the expected value.
65 expect - the expected value
66 update - the new value
68 Returns: true if successful. False return indicates that the actual value was not equal
69 to the expected value.
71 *java.util.concurrent.atomic.AtomicReferenceArray.get(int)*
73 public final |E| get(int i)
75 Gets the current value at positioni.
80 Returns: the current value
82 *java.util.concurrent.atomic.AtomicReferenceArray.getAndSet(int,E)*
84 public final |E| getAndSet(
88 Atomically sets the element at positionito the given value and returns the old
93 newValue - the new value
95 Returns: the previous value
97 *java.util.concurrent.atomic.AtomicReferenceArray.lazySet(int,E)*
99 public final void lazySet(
103 Eventually sets the element at positionito the given value.
107 newValue - the new value
109 *java.util.concurrent.atomic.AtomicReferenceArray.length()*
111 public final int length()
113 Returns the length of the array.
117 Returns: the length of the array
119 *java.util.concurrent.atomic.AtomicReferenceArray.set(int,E)*
121 public final void set(
125 Sets the element at positionito the given value.
129 newValue - the new value
131 *java.util.concurrent.atomic.AtomicReferenceArray.toString()*
133 public |java.lang.String| toString()
135 Returns the String representation of the current values of array.
139 Returns: the String representation of the current values of array.
141 *java.util.concurrent.atomic.AtomicReferenceArray.weakCompareAndSet(int,E,E)*
143 public final boolean weakCompareAndSet(
148 Atomically sets the element at positionito the given updated value if the
149 current value==the expected value.
151 May fail spuriously and does not provide ordering guarantees, so is only rarely
152 an appropriate alternative tocompareAndSet.
156 expect - the expected value
157 update - the new value
159 Returns: true if successful.