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

Modifier and Type

Method

Description

int

[accumulateAndGet](../../../../java/util/concurrent/atomic/AtomicInteger.html#accumulateAndGet-int-java.util.function.IntBinaryOperator-)​(int x,[IntBinaryOperator](../../../../java/util/function/IntBinaryOperator.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.

int

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

int

[compareAndExchange](../../../../java/util/concurrent/atomic/AtomicInteger.html#compareAndExchange-int-int-)​(int expectedValue, int 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...).

int

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

int

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

boolean

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

int

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

double

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

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

float

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

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

int

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

int

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

int

[getAndAccumulate](../../../../java/util/concurrent/atomic/AtomicInteger.html#getAndAccumulate-int-java.util.function.IntBinaryOperator-)​(int x,[IntBinaryOperator](../../../../java/util/function/IntBinaryOperator.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.

int

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

int

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

int

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

int

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

int

[getAndUpdate](../../../../java/util/concurrent/atomic/AtomicInteger.html#getAndUpdate-java.util.function.IntUnaryOperator-)​([IntUnaryOperator](../../../../java/util/function/IntUnaryOperator.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.

int

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

int

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

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

int

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

int

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

void

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

long

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

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

void

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

void

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

void

[setPlain](../../../../java/util/concurrent/atomic/AtomicInteger.html#setPlain-int-)​(int 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/AtomicInteger.html#setRelease-int-)​(int newValue)

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

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

Returns the String representation of the current value.

int

[updateAndGet](../../../../java/util/concurrent/atomic/AtomicInteger.html#updateAndGet-java.util.function.IntUnaryOperator-)​([IntUnaryOperator](../../../../java/util/function/IntUnaryOperator.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/AtomicInteger.html#weakCompareAndSet-int-int-)​(int expectedValue, int newValue)

boolean

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

boolean

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

boolean

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

boolean

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