|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Number
java.util.concurrent.atomic.AtomicLong
com.atlassian.util.concurrent.atomic.AtomicLong
public class AtomicLong
AtomicLong with richer functionality.
This class implements commonly implemented patterns of use of compareAndSet
such as #getAndSetIf(long, long) and update(Function).
| Constructor Summary | |
|---|---|
AtomicLong()
Creates a new AtomicLong with a zero initial value. |
|
AtomicLong(long initialValue)
Creates a new AtomicLong with the given initial value. |
|
| Method Summary | |
|---|---|
long |
getOrSetAndGetIf(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(com.google.common.base.Function<java.lang.Long,java.lang.Long> newValueFactory)
Do the actual update. |
| Methods inherited from class java.util.concurrent.atomic.AtomicLong |
|---|
addAndGet, compareAndSet, decrementAndGet, doubleValue, floatValue, get, getAndAdd, getAndDecrement, getAndIncrement, getAndSet, incrementAndGet, intValue, lazySet, longValue, set, toString, weakCompareAndSet |
| Methods inherited from class java.lang.Number |
|---|
byteValue, shortValue |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public AtomicLong()
public AtomicLong(long initialValue)
initialValue - the initial value| Method Detail |
|---|
public final long getOrSetAndGetIf(long oldValue,
long newValue)
oldValue - to check the current value againstnewValue - the new value to set it to
public final long update(com.google.common.base.Function<java.lang.Long,java.lang.Long> newValueFactory)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||