public class AtomicLongArray extends AtomicLongArray
getOrSetAndGetIf(int, long, long) and update(int, Function)
.| Constructor and Description |
|---|
AtomicLongArray(int length)
Creates a new AtomicLongArray of given length.
|
AtomicLongArray(long[] initialValue)
Creates a new AtomicLongArray with the same length as, and all elements
copied from, the given array.
|
| Modifier and Type | Method and Description |
|---|---|
long |
getOrSetAndGetIf(int index,
long oldValue,
long newValue)
Check the current value and if it matches the old value argument, set it to
the new value and return that instead.
|
long |
update(int index,
Function<Long,Long> newValueFactory)
Do the actual update.
|
accumulateAndGet, addAndGet, compareAndSet, decrementAndGet, get, getAndAccumulate, getAndAdd, getAndDecrement, getAndIncrement, getAndSet, getAndUpdate, incrementAndGet, lazySet, length, set, toString, updateAndGet, weakCompareAndSetpublic AtomicLongArray(int length)
length - the length of the arraypublic AtomicLongArray(long[] initialValue)
initialValue - the array to copy elements fromNullPointerException - if array is nullpublic final long getOrSetAndGetIf(int index,
long oldValue,
long newValue)
index - the array indexoldValue - to check the current value against (reference equality
check only)newValue - the new value to set it topublic final long update(int index,
Function<Long,Long> newValueFactory)
index - a int.newValueFactory - a Function object.Copyright © 2016 Atlassian. All rights reserved.