AtomicLong (Java SE 9 & JDK 9 ) (original) (raw)

Modifier and Type

Method

Description

long

[accumulateAndGet](../../../../java/util/concurrent/atomic/AtomicLong.html#accumulateAndGet-long-java.util.function.LongBinaryOperator-)​(long x,[LongBinaryOperator](../../../../java/util/function/LongBinaryOperator.html "interface in java.util.function") accumulatorFunction)

Atomically updates (with memory effects as specified by VarHandle.compareAndSet(java.lang.Object...)) the current value with the results of applying the given function to the current and given values, returning the updated value.

long

[addAndGet](../../../../java/util/concurrent/atomic/AtomicLong.html#addAndGet-long-)​(long delta)

long

[compareAndExchange](../../../../java/util/concurrent/atomic/AtomicLong.html#compareAndExchange-long-long-)​(long expectedValue, long newValue)

Atomically sets the value to newValue if the current value, referred to as the witness value, == expectedValue, with memory effects as specified byVarHandle.compareAndExchange(java.lang.Object...).

long

[compareAndExchangeAcquire](../../../../java/util/concurrent/atomic/AtomicLong.html#compareAndExchangeAcquire-long-long-)​(long expectedValue, long newValue)

long

[compareAndExchangeRelease](../../../../java/util/concurrent/atomic/AtomicLong.html#compareAndExchangeRelease-long-long-)​(long expectedValue, long newValue)

boolean

[compareAndSet](../../../../java/util/concurrent/atomic/AtomicLong.html#compareAndSet-long-long-)​(long expectedValue, long newValue)

long

[decrementAndGet](../../../../java/util/concurrent/atomic/AtomicLong.html#decrementAndGet--)​()

double

[doubleValue](../../../../java/util/concurrent/atomic/AtomicLong.html#doubleValue--)​()

Returns the current value of this AtomicLong as a double after a widening primitive conversion, with memory effects as specified by VarHandle.getVolatile(java.lang.Object...).

float

[floatValue](../../../../java/util/concurrent/atomic/AtomicLong.html#floatValue--)​()

Returns the current value of this AtomicLong as a float after a widening primitive conversion, with memory effects as specified by VarHandle.getVolatile(java.lang.Object...).

long

[get](../../../../java/util/concurrent/atomic/AtomicLong.html#get--)​()

long

[getAcquire](../../../../java/util/concurrent/atomic/AtomicLong.html#getAcquire--)​()

long

[getAndAccumulate](../../../../java/util/concurrent/atomic/AtomicLong.html#getAndAccumulate-long-java.util.function.LongBinaryOperator-)​(long x,[LongBinaryOperator](../../../../java/util/function/LongBinaryOperator.html "interface in java.util.function") accumulatorFunction)

Atomically updates (with memory effects as specified by VarHandle.compareAndSet(java.lang.Object...)) the current value with the results of applying the given function to the current and given values, returning the previous value.

long

[getAndAdd](../../../../java/util/concurrent/atomic/AtomicLong.html#getAndAdd-long-)​(long delta)

long

[getAndDecrement](../../../../java/util/concurrent/atomic/AtomicLong.html#getAndDecrement--)​()

long

[getAndIncrement](../../../../java/util/concurrent/atomic/AtomicLong.html#getAndIncrement--)​()

long

[getAndSet](../../../../java/util/concurrent/atomic/AtomicLong.html#getAndSet-long-)​(long newValue)

long

[getAndUpdate](../../../../java/util/concurrent/atomic/AtomicLong.html#getAndUpdate-java.util.function.LongUnaryOperator-)​([LongUnaryOperator](../../../../java/util/function/LongUnaryOperator.html "interface in java.util.function") updateFunction)

Atomically updates (with memory effects as specified by VarHandle.compareAndSet(java.lang.Object...)) the current value with the results of applying the given function, returning the previous value.

long

[getOpaque](../../../../java/util/concurrent/atomic/AtomicLong.html#getOpaque--)​()

long

[getPlain](../../../../java/util/concurrent/atomic/AtomicLong.html#getPlain--)​()

Returns the current value, with memory semantics of reading as if the variable was declared non-volatile.

long

[incrementAndGet](../../../../java/util/concurrent/atomic/AtomicLong.html#incrementAndGet--)​()

int

[intValue](../../../../java/util/concurrent/atomic/AtomicLong.html#intValue--)​()

Returns the current value of this AtomicLong as an int after a narrowing primitive conversion, with memory effects as specified by VarHandle.getVolatile(java.lang.Object...).

void

[lazySet](../../../../java/util/concurrent/atomic/AtomicLong.html#lazySet-long-)​(long newValue)

long

[longValue](../../../../java/util/concurrent/atomic/AtomicLong.html#longValue--)​()

void

[set](../../../../java/util/concurrent/atomic/AtomicLong.html#set-long-)​(long newValue)

void

[setOpaque](../../../../java/util/concurrent/atomic/AtomicLong.html#setOpaque-long-)​(long newValue)

void

[setPlain](../../../../java/util/concurrent/atomic/AtomicLong.html#setPlain-long-)​(long newValue)

Sets the value to newValue, with memory semantics of setting as if the variable was declared non-volatile and non-final.

void

[setRelease](../../../../java/util/concurrent/atomic/AtomicLong.html#setRelease-long-)​(long newValue)

[String](../../../../java/lang/String.html "class in java.lang")

[toString](../../../../java/util/concurrent/atomic/AtomicLong.html#toString--)​()

Returns the String representation of the current value.

long

[updateAndGet](../../../../java/util/concurrent/atomic/AtomicLong.html#updateAndGet-java.util.function.LongUnaryOperator-)​([LongUnaryOperator](../../../../java/util/function/LongUnaryOperator.html "interface in java.util.function") updateFunction)

Atomically updates (with memory effects as specified by VarHandle.compareAndSet(java.lang.Object...)) the current value with the results of applying the given function, returning the updated value.

boolean

[weakCompareAndSet](../../../../java/util/concurrent/atomic/AtomicLong.html#weakCompareAndSet-long-long-)​(long expectedValue, long newValue)

boolean

[weakCompareAndSetAcquire](../../../../java/util/concurrent/atomic/AtomicLong.html#weakCompareAndSetAcquire-long-long-)​(long expectedValue, long newValue)

boolean

[weakCompareAndSetPlain](../../../../java/util/concurrent/atomic/AtomicLong.html#weakCompareAndSetPlain-long-long-)​(long expectedValue, long newValue)

boolean

[weakCompareAndSetRelease](../../../../java/util/concurrent/atomic/AtomicLong.html#weakCompareAndSetRelease-long-long-)​(long expectedValue, long newValue)

boolean

[weakCompareAndSetVolatile](../../../../java/util/concurrent/atomic/AtomicLong.html#weakCompareAndSetVolatile-long-long-)​(long expectedValue, long newValue)