is new.
java.lang.Objectjava.util.concurrent.atomic.AtomicLongArray
public class AtomicLongArray
A long 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 Summary | |
|---|---|
AtomicLongArray
(int length)
Creates
|
|
AtomicLongArray
(long[] array)
Creates
|
|
| Method Summary | |
|---|---|
| long |
addAndGet
(int i, long delta) Atomically
adds
the
element at index
i
. |
| boolean |
compareAndSet
(int i, long expect, long update) Atomically
sets
|
| long |
decrementAndGet
(int i) Atomically
decrements by one
|
| long |
get
(int i)
Gets
|
| long |
getAndAdd
(int i, long delta) Atomically
adds
the
element at index
i
. |
| long |
getAndDecrement
(int i) Atomically
decrements
|
| long |
getAndIncrement
(int i) Atomically
increments
|
| long |
getAndSet
(int i, long newValue)
Atomically sets
returns
|
| long |
incrementAndGet
(int i) Atomically
increments by one
|
void
|
lazySet
(int i, long newValue)
Eventually sets the element at position
i
to the given value.
|
| int |
length
() Returns the length of the array. |
| void |
set
(int i, long newValue)
Sets
|
| String |
toString
() Returns the String representation of the current values of array. |
| boolean |
weakCompareAndSet
(int i, long expect, long update) Atomically
sets
|
| Methods inherited from class java.lang. Object |
|---|
| clone , equals , finalize , getClass , hashCode , notify , notifyAll , wait , wait , wait |
| Constructor Detail |
|---|
public AtomicLongArray(int length)
Creates
public AtomicLongArray(long[] array)
Creates
| Method Detail |
|---|
public final int length()
public final long get(int i)
Gets
public final void set(int i,
long newValue)
Sets
lazySet
public final void
lazySet
(int i, long newValue)
Eventually sets the element at position
i
to the given value.
Parameters:
i - the index
newValue - the new value
Since:
1.6
public final long getAndSet(int i,
long newValue)
Atomically sets
returns
public final boolean compareAndSet(int i,
long expect,
long update)
sets
public final boolean weakCompareAndSet(int i,
long expect,
long update)
sets
public final long getAndIncrement(int i)
increments
value
public final long getAndDecrement(int i)
decrements
value
public final long getAndAdd(int i,
long delta)
adds
the
element at index
i
.
value
public final long incrementAndGet(int i)
increments by one
value
public final long decrementAndGet(int i)
decrements by one
value
public long addAndGet(int i,
long delta)
adds
the
element at index
i
.
value
public String toString()